diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index b4b8b9f245e..6d56fdb2dc3 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1475,7 +1475,7 @@ public: static std::optional lockedPluginName(PluginManagerPrivate *pm) { const QString lockFilePath = LockFile::filePath(pm); - if (QFile::exists(lockFilePath)) { + if (QFileInfo::exists(lockFilePath)) { QFile f(lockFilePath); if (f.open(QIODevice::ReadOnly)) { const auto pluginName = QString::fromUtf8(f.readLine()).trimmed(); diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp index 38805264f93..f188d6aa40a 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp +++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp @@ -259,7 +259,7 @@ void ContextPaneWidgetImage::setProperties(QmlJS::PropertyReader *propertyReader if (propertyReader->hasProperty(QLatin1String("source"))) { QString source = propertyReader->readProperty(QLatin1String("source")).toString(); m_fileWidget->setFileName(source); - if (QFile::exists(m_path + QLatin1Char('/') + source)) + if (QFileInfo::exists(m_path + QLatin1Char('/') + source)) setPixmap(m_path + QLatin1Char('/') + source); else setPixmap(source); diff --git a/src/libs/utils/mimetypes2/mimeprovider.cpp b/src/libs/utils/mimetypes2/mimeprovider.cpp index c20e367517f..682cbb7e8a5 100644 --- a/src/libs/utils/mimetypes2/mimeprovider.cpp +++ b/src/libs/utils/mimetypes2/mimeprovider.cpp @@ -505,7 +505,7 @@ bool MimeBinaryProvider::loadMimeTypePrivate(MimeTypePrivate &data) // shared-mime-info since 1.3 lowercases the xml files QString mimeFile = m_directory + QLatin1Char('/') + data.name.toLower() + QLatin1String(".xml"); - if (!QFile::exists(mimeFile)) + if (!QFileInfo::exists(mimeFile)) mimeFile = m_directory + QLatin1Char('/') + data.name + QLatin1String(".xml"); // pre-1.3 QFile qfile(mimeFile); diff --git a/src/libs/utils/savefile.cpp b/src/libs/utils/savefile.cpp index 4cf579ac0b9..a9d0cca3a40 100644 --- a/src/libs/utils/savefile.cpp +++ b/src/libs/utils/savefile.cpp @@ -111,7 +111,7 @@ bool SaveFile::commit() if (!result) { DWORD replaceErrorCode = GetLastError(); QString errorStr; - if (!QFile::exists(finalFileName)) { + if (!QFileInfo::exists(finalFileName)) { // Replace failed because finalFileName does not exist, try rename. if (!(result = rename(finalFileName))) errorStr = errorString(); @@ -148,7 +148,7 @@ bool SaveFile::commit() // Back up current file. // If it's opened by another application, the lock follows the move. - if (QFile::exists(finalFileName)) { + if (QFileInfo::exists(finalFileName)) { // Kill old backup. Might be useful if creator crashed before removing backup. QFile::remove(backupName); QFile finalFile(finalFileName); diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index cc860e715a9..2f205da9359 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -847,7 +847,7 @@ QString StyleHelper::dpiSpecificImageFile(const QString &fileName) if (qApp->devicePixelRatio() > 1.0) { const QString atDprfileName = imageFileWithResolution(fileName, qRound(qApp->devicePixelRatio())); - if (QFile::exists(atDprfileName)) + if (QFileInfo::exists(atDprfileName)) return atDprfileName; } return fileName; @@ -867,7 +867,7 @@ QList StyleHelper::availableImageResolutions(const QString &fileName) QList result; const int maxResolutions = qApp->devicePixelRatio(); for (int i = 1; i <= maxResolutions; ++i) - if (QFile::exists(imageFileWithResolution(fileName, i))) + if (QFileInfo::exists(imageFileWithResolution(fileName, i))) result.append(i); return result; } diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index ececc547481..13348492e73 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -48,10 +48,10 @@ static FilePath sdkFromUrl(const QUrl &url) if (basename.isEmpty()) basename = "sdk-tools.zip"; - if (QFile::exists(basename)) { + if (QFileInfo::exists(basename)) { int i = 0; basename += '.'; - while (QFile::exists(basename + QString::number(i))) + while (QFileInfo::exists(basename + QString::number(i))) ++i; basename += QString::number(i); } diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 943ffa194a4..cfbc5a1f4c0 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -828,7 +828,7 @@ QStringList ClearCasePluginPrivate::ccGetActiveVobs() const // Snapshot views does not necessarily have all active VOBs loaded, so we'll have to // check if the dirs exists as well. Else the command will work, but the output will // complain about the element not being loaded. - if (QFile::exists(prefix + relativeDir)) + if (QFileInfo::exists(prefix + relativeDir)) res.append(relativeDir); } return res; diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp index 37c0d29d8d6..2ca95d6ecb7 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp @@ -391,7 +391,7 @@ void CompilationDatabaseBuildSystem::buildTreeAndProjectParts() root->addNode(std::make_unique(projectFilePath(), FileType::Project)); - if (QFile::exists(dbContents.extraFileName)) + if (QFileInfo::exists(dbContents.extraFileName)) root->addNode(std::make_unique(Utils::FilePath::fromString(dbContents.extraFileName), FileType::Project)); diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 0837afb6e11..175d2c29825 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -228,7 +228,7 @@ void SourceSettings::fillLanguageIdModel(StringSelectionAspect::ResultCallback c auto *newItem = new QStandardItem(language.name); newItem->setData(language.id); - if (QFile::exists(":/compilerexplorer/logos/" + language.logoUrl)) { + if (QFileInfo::exists(":/compilerexplorer/logos/" + language.logoUrl)) { QIcon icon(":/compilerexplorer/logos/" + language.logoUrl); newItem->setIcon(icon); } diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 84297254919..c922dae9515 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -957,7 +957,7 @@ void SplitterOrView::restoreState(const QByteArray &state) stream >> historyData; view()->m_editorHistory = loadHistory(historyData); - if (!QFile::exists(fileName)) + if (!QFileInfo::exists(fileName)) return; IEditor *e = EditorManagerPrivate::openEditor(view(), FilePath::fromString(fileName), Id::fromString(id), EditorManager::IgnoreNavigationHistory diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 4cc865de8ea..f0d2046a32f 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -174,7 +174,7 @@ static bool hasQmFilesForLocale(const QString &locale, const QString &creatorTrP static const QString qtTrPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath); const QString trFile = QLatin1String("/qt_") + locale + QLatin1String(".qm"); - return QFile::exists(qtTrPath + trFile) || QFile::exists(creatorTrPath + trFile); + return QFileInfo::exists(qtTrPath + trFile) || QFileInfo::exists(creatorTrPath + trFile); } void GeneralSettingsWidget::fillLanguageBox() const diff --git a/src/plugins/coreplugin/mimetypesettings.cpp b/src/plugins/coreplugin/mimetypesettings.cpp index 347ece7fcec..814dd7be20f 100644 --- a/src/plugins/coreplugin/mimetypesettings.cpp +++ b/src/plugins/coreplugin/mimetypesettings.cpp @@ -633,7 +633,7 @@ void MimeTypeSettingsPrivate::writeUserModifiedMimeTypes() { static Utils::FilePath modifiedMimeTypesFile = ICore::userResourcePath(kModifiedMimeTypesFile); - if (QFile::exists(modifiedMimeTypesFile.toString()) + if (QFileInfo::exists(modifiedMimeTypesFile.toString()) || QDir().mkpath(modifiedMimeTypesFile.parentDir().toString())) { QFile file(modifiedMimeTypesFile.toString()); if (file.open(QFile::WriteOnly | QFile::Truncate)) { diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index d58e02e7518..85f2f3effef 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -109,7 +109,7 @@ public: bool isComplete() const final { const FilePath path = m_data->sourcePath; - if (!QFile::exists(path.toString())) { + if (!QFileInfo::exists(path.toString())) { m_info->setText(Tr::tr("File does not exist.")); return false; } diff --git a/src/plugins/cppeditor/compileroptionsbuilder.cpp b/src/plugins/cppeditor/compileroptionsbuilder.cpp index 317cf7b25dd..8376f7d1acc 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder.cpp +++ b/src/plugins/cppeditor/compileroptionsbuilder.cpp @@ -376,7 +376,7 @@ void CompilerOptionsBuilder::addHeaderPathOptions() void CompilerOptionsBuilder::addIncludeFile(const QString &file) { - if (QFile::exists(file)) { + if (QFileInfo::exists(file)) { add({isClStyle() ? QLatin1String(includeFileOptionCl) : QLatin1String(includeFileOptionGcc), QDir::toNativeSeparators(file)}); diff --git a/src/plugins/debugger/procinterrupt.cpp b/src/plugins/debugger/procinterrupt.cpp index 65d49055cb5..113fbeefc4f 100644 --- a/src/plugins/debugger/procinterrupt.cpp +++ b/src/plugins/debugger/procinterrupt.cpp @@ -120,7 +120,7 @@ GDB 32bit | Api | Api | NA | Win32 const QString executable = breakApi == UseWin32Interrupt ? QCoreApplication::applicationDirPath() + "/win32interrupt.exe" : QCoreApplication::applicationDirPath() + "/win64interrupt.exe"; - if (!QFile::exists(executable)) { + if (!QFileInfo::exists(executable)) { *errorMessage = QString::fromLatin1( "%1 does not exist. If you have built %2 " "on your own, checkout " diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 436a8ca765f..090f01cf6ef 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -916,7 +916,7 @@ void setQtPluginPath(const QString &qtPluginPath) *sQtPluginPath = Utils::trimBack(*sQtPluginPath, '/'); if (sQtPluginPath->endsWith(postfix)) sQtPluginPath->chop(postfix.size()); - if (!QFile::exists(*sQtPluginPath + postfix)) { + if (!QFileInfo::exists(*sQtPluginPath + postfix)) { qWarning() << qPrintable( QLatin1String( "Warning: The path \"%1\" passed to -designer-qt-pluginpath does not exist. " diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index be00253d826..ad6c667428f 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2529,7 +2529,7 @@ FilePath GitClient::gitBinDirectory() const // Git for Windows uses Git/usr/bin. Prefer that if it exists. QString usrBinPath = path; usrBinPath.replace(usrBinPath.size() - 3, 3, "usr/bin"); - if (QFile::exists(usrBinPath)) + if (QFileInfo::exists(usrBinPath)) path = usrBinPath; } } diff --git a/src/plugins/macros/macromanager.cpp b/src/plugins/macros/macromanager.cpp index 507ed92179d..a5e01155893 100644 --- a/src/plugins/macros/macromanager.cpp +++ b/src/plugins/macros/macromanager.cpp @@ -372,7 +372,7 @@ void MacroManager::saveLastMacro() QString MacroManager::macrosDirectory() { const QString path = Core::ICore::userResourcePath("macros").toString(); - if (QFile::exists(path) || QDir().mkpath(path)) + if (QFileInfo::exists(path) || QDir().mkpath(path)) return path; return QString(); } diff --git a/src/plugins/mesonprojectmanager/mesonwrapper.h b/src/plugins/mesonprojectmanager/mesonwrapper.h index 4312a63c34e..7cf194a2736 100644 --- a/src/plugins/mesonprojectmanager/mesonwrapper.h +++ b/src/plugins/mesonprojectmanager/mesonwrapper.h @@ -24,7 +24,7 @@ namespace Internal { template bool containsFiles(const QString &path, const File_t &file) { - return QFile::exists(QString("%1/%2").arg(path).arg(file)); + return QFileInfo::exists(QString("%1/%2").arg(path).arg(file)); } template diff --git a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp index 023dddb3375..70412124462 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp @@ -163,7 +163,7 @@ GDB 32bit | Api | Api | N/A | Win32 executable += si == Win32Interrupt ? QLatin1String("/win32interrupt.exe") : QLatin1String("/win64interrupt.exe"); - if (!QFile::exists(executable)) { + if (!QFileInfo::exists(executable)) { appendMsgCannotInterrupt(pid, Tr::tr("%1 does not exist. If you built %2 " "yourself, check out https://code.qt.io/cgit/" diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index d90f7d3d985..c6f435a9f4f 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1210,8 +1210,8 @@ void MsvcToolChain::rescanForCompiler() env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FilePath &name) { QDir dir(QDir::cleanPath(name.toFileInfo().absolutePath() + QStringLiteral("/.."))); do { - if (QFile::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat"))) - || QFile::exists(dir.absolutePath() + "/Auxiliary/Build/vcvarsall.bat")) + if (QFileInfo::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat"))) + || QFileInfo::exists(dir.absolutePath() + "/Auxiliary/Build/vcvarsall.bat")) return true; } while (dir.cdUp() && !dir.isRoot()); return false; diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index f3e234b02d8..8a18d238017 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -1917,7 +1917,7 @@ FilePaths QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader, else realFile = realDir; - if (QFile::exists(realFile)) { + if (QFileInfo::exists(realFile)) { realFile = QDir::cleanPath(realFile); subProjectPaths << FilePath::fromString(realFile); if (subProjectsNotToDeploy && !subProjectsNotToDeploy->contains(realFile) diff --git a/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp b/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp index 71cde5f0ba8..1d6fc0dd77d 100644 --- a/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp +++ b/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp @@ -115,7 +115,7 @@ void AssetsLibraryModel::deleteFiles(const QStringList &filePaths, bool dontAskA QmlDesignerPlugin::settings().insert(DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET, false); for (const QString &filePath : filePaths) { - if (QFile::exists(filePath) && !QFile::remove(filePath)) { + if (QFileInfo::exists(filePath) && !QFile::remove(filePath)) { QMessageBox::warning(Core::ICore::dialogParent(), tr("Failed to Delete File"), tr("Could not delete \"%1\".").arg(filePath)); diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp index 75976fd7210..4a119d88a53 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp @@ -86,7 +86,7 @@ bool fileComponentExists(const ModelNode &modelNode) if (fileName.contains("qml/QtQuick")) return false; - return QFile::exists(fileName); + return QFileInfo::exists(fileName); } bool selectionIsComponent(const SelectionContext &selectionState) diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp index e5ee371002e..f8e284d7bea 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp @@ -291,7 +291,7 @@ void ContentLibraryMaterialsModel::loadMaterialBundle(const QDir &matBundleDir) for (const QString &s : std::as_const(sharedFiles)) { const QString fullSharedFilePath = matBundleDir.filePath(s); - if (!QFile::exists(fullSharedFilePath)) + if (!QFileInfo::exists(fullSharedFilePath)) missingSharedFiles.push_back(s); } diff --git a/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp b/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp index 33c0eb7388d..7799c960289 100644 --- a/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp +++ b/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp @@ -165,7 +165,7 @@ void LocalQmlProfilerRunnerTest::testFindFreeSocket() QUrl serverUrl = Utils::urlFromLocalSocket(); QString socket = serverUrl.path(); QVERIFY(!socket.isEmpty()); - QVERIFY(!QFile::exists(socket)); + QVERIFY(!QFileInfo::exists(socket)); QFile file(socket); QVERIFY(file.open(QIODevice::WriteOnly)); file.close(); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index bd41cfd068d..a139d853fed 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -822,7 +822,7 @@ static QString qtVersionsFile(const QString &baseDir) static std::optional currentlyLinkedQtDir(bool *hasInstallSettings) { const QString installSettingsFilePath = settingsFile(Core::ICore::resourcePath().toString()); - const bool installSettingsExist = QFile::exists(installSettingsFilePath); + const bool installSettingsExist = QFileInfo::exists(installSettingsFilePath); if (hasInstallSettings) *hasInstallSettings = installSettingsExist; if (installSettingsExist) { @@ -934,8 +934,8 @@ static std::optional settingsDirForQtDir(const FilePath &baseDirectory return qtDir / dir; }); const FilePath validDir = Utils::findOrDefault(dirsToCheck, [baseDirectory](const FilePath &dir) { - return QFile::exists(settingsFile(baseDirectory.resolvePath(dir).toString())) - || QFile::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString())); + return QFileInfo::exists(settingsFile(baseDirectory.resolvePath(dir).toString())) + || QFileInfo::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString())); }); if (!validDir.isEmpty()) return validDir; diff --git a/src/plugins/resourceeditor/qrceditor/qrceditor.cpp b/src/plugins/resourceeditor/qrceditor/qrceditor.cpp index e08f52340fd..4340fc6123d 100644 --- a/src/plugins/resourceeditor/qrceditor/qrceditor.cpp +++ b/src/plugins/resourceeditor/qrceditor/qrceditor.cpp @@ -229,7 +229,7 @@ QString ResolveLocationContext::execCopyFileDialog(QWidget *parent, const QDir & // Helper to copy a file with message boxes static inline bool copyFile(const QString &file, const QString ©Name, QWidget *parent) { - if (QFile::exists(copyName)) { + if (QFileInfo::exists(copyName)) { if (!QFile::remove(copyName)) { QMessageBox::critical(parent, Tr::tr("Overwriting Failed"), Tr::tr("Could not overwrite file %1.") diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 8d8d6dc9f2b..ef1c077ca9b 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -50,7 +50,7 @@ void File::checkExistence() bool File::exists() { if (!m_checked) { - m_exists = QFile::exists(name); + m_exists = QFileInfo::exists(name); m_checked = true; } @@ -363,7 +363,7 @@ bool ResourceFile::renameFile(const QString &fileName, const QString &newFileNam } if (success) { - const bool exists = QFile::exists(newFileName); + const bool exists = QFileInfo::exists(newFileName); for (File *file : std::as_const(entries)) { file->name = newFileName; file->setExists(exists); @@ -1230,7 +1230,7 @@ EntryBackup * RelativeResourceModel::removeEntry(const QModelIndex &index) } else { const QString fileNameBackup = file(index); const QString aliasBackup = alias(index); - if (!QFile::exists(fileNameBackup)) { + if (!QFileInfo::exists(fileNameBackup)) { deleteItem(index); return new FileEntryBackup(*this, prefixIndex.row(), index.row(), fileNameBackup, aliasBackup); } diff --git a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp index 4ee7ebc6197..a2beac1167b 100644 --- a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp +++ b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp @@ -349,7 +349,7 @@ bool ScxmlDocument::pasteData(const QByteArray &data, const QPointF &minPos, con void ScxmlDocument::load(const QString &fileName) { - if (QFile::exists(fileName)) { + if (QFileInfo::exists(fileName)) { QFile file(fileName); if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (load(&file)) { diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index bb26655dfb6..6482f9ac5f5 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -778,7 +778,7 @@ void MemcheckToolPrivate::heobAction() // heob executable const QString heob = QString("heob%1.exe").arg(abi.wordWidth()); const QString heobPath = dialog.path() + '/' + heob; - if (!QFile::exists(heobPath)) { + if (!QFileInfo::exists(heobPath)) { QMessageBox::critical( Core::ICore::dialogParent(), Tr::tr("Heob"), @@ -791,7 +791,7 @@ void MemcheckToolPrivate::heobAction() if (abi.osFlavor() == Abi::WindowsMSysFlavor) { const QString dwarfstack = QString("dwarfstack%1.dll").arg(abi.wordWidth()); const QString dwarfstackPath = dialog.path() + '/' + dwarfstack; - if (!QFile::exists(dwarfstackPath) + if (!QFileInfo::exists(dwarfstackPath) && CheckableMessageBox::information( Core::ICore::dialogParent(), Tr::tr("Heob"), diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp index 9832c16da3b..96bf9023eec 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp @@ -91,7 +91,7 @@ static QString makeFrameName(const Frame &frame, bool withLocation) else path = frame.object(); - if (QFile::exists(path)) + if (QFileInfo::exists(path)) path = QFileInfo(path).canonicalFilePath(); if (frame.line() != -1) diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 0df7b928ee7..1ad32d4684f 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -1156,7 +1156,7 @@ void VcsBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor) return; const QString fileName = findDiffFile(fileNameFromDiffSpecification(block)); - const bool exists = fileName.isEmpty() ? false : QFile::exists(fileName); + const bool exists = fileName.isEmpty() ? false : QFileInfo::exists(fileName); if (!exists) return; diff --git a/src/shared/proparser/qmakeglobals.cpp b/src/shared/proparser/qmakeglobals.cpp index 03e0fd60559..7fa8915920f 100644 --- a/src/shared/proparser/qmakeglobals.cpp +++ b/src/shared/proparser/qmakeglobals.cpp @@ -79,7 +79,7 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s QString ret = QDir::cleanPath(spec); if (ret.contains(QLatin1Char('/'))) { QString absRet = IoUtils::resolvePath(device_root, state.pwd, ret); - if (QFile::exists(absRet)) + if (QFileInfo::exists(absRet)) ret = absRet; } return ret; diff --git a/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp b/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp index 5fe89323a90..e38889f5ea5 100644 --- a/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp +++ b/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp @@ -554,7 +554,7 @@ int main(int argc, char *argv[]) // Process files const QStringList files = args; for (const QString &fileName : files) { - if (! QFile::exists(fileName)) { + if (! QFileInfo::exists(fileName)) { std::cerr << "Error: File \"" << qPrintable(fileName) << "\" does not exist." << std::endl; exit(EXIT_FAILURE); diff --git a/src/tools/cplusplus-shared/utils.cpp b/src/tools/cplusplus-shared/utils.cpp index 562cd96d65b..b7feb7023c8 100644 --- a/src/tools/cplusplus-shared/utils.cpp +++ b/src/tools/cplusplus-shared/utils.cpp @@ -76,7 +76,7 @@ SystemPreprocessor::SystemPreprocessor(bool verbose) void SystemPreprocessor::check() const { QTextStream out(stderr); - if (!QFile::exists(QLatin1String(PATH_PREPROCESSOR_CONFIG))) { + if (!QFileInfo::exists(QLatin1String(PATH_PREPROCESSOR_CONFIG))) { out << QString::fromLatin1("Error: File \"%1\" does not exist.") .arg(QLatin1String(PATH_PREPROCESSOR_CONFIG)) << Qt::endl; @@ -94,7 +94,7 @@ void SystemPreprocessor::check() const void SystemPreprocessor::preprocessFile(const QString &inputFile, const QString &outputFile) const { check(); - if (!QFile::exists(inputFile)) { + if (!QFileInfo::exists(inputFile)) { QTextStream out(stderr); out << QString::fromLatin1("Error: File \"%1\" does not exist.").arg(inputFile) << Qt::endl; exit(EXIT_FAILURE); diff --git a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp index 71b4221872a..f202b8b8946 100644 --- a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp +++ b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp @@ -1606,7 +1606,7 @@ int main(int argc, char *argv[]) } QDir cplusplusDir(pathCppFrontend); - if (!QFile::exists(pathCppFrontend)) { + if (!QFileInfo::exists(pathCppFrontend)) { std::cerr << "Error: Directory \"" << qPrintable(cplusplusDir.absolutePath()) << "\" does not exist." << std::endl; return EXIT_FAILURE; @@ -1616,7 +1616,7 @@ int main(int argc, char *argv[]) << "\"." << std::endl; return EXIT_FAILURE; } - if (!QFile::exists(pathDumpersFile)) { + if (!QFileInfo::exists(pathDumpersFile)) { std::cerr << "Error: File \"" << qPrintable(pathDumpersFile) << "\" does not exist." << std::endl; return EXIT_FAILURE; diff --git a/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp b/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp index 6d3fa2ce36a..610685499c2 100644 --- a/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp +++ b/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp @@ -108,14 +108,14 @@ void QmlPuppet::initQmlRunner() if (m_argParser.isSet("readcapturedstream") && m_coreApp->arguments().count() > 2) { QString fileName = m_argParser.value("readcapturedstream"); - if (!QFile::exists(fileName)) { + if (!QFileInfo::exists(fileName)) { qDebug() << "Input stream does not exist:" << fileName; exit(-1); } if (m_coreApp->arguments().count() > 3) { fileName = m_coreApp->arguments().at(3); - if (!QFile::exists(fileName)) { + if (!QFileInfo::exists(fileName)) { qDebug() << "Output stream does not exist:" << fileName; exit(-1); } diff --git a/src/tools/sdktool/sdkpersistentsettings.cpp b/src/tools/sdktool/sdkpersistentsettings.cpp index b72fffa4c57..43b92d7d470 100644 --- a/src/tools/sdktool/sdkpersistentsettings.cpp +++ b/src/tools/sdktool/sdkpersistentsettings.cpp @@ -173,7 +173,7 @@ bool SdkSaveFile::commit() if (!result) { DWORD replaceErrorCode = GetLastError(); QString errorStr; - if (!QFile::exists(finalFileName)) { + if (!QFileInfo::exists(finalFileName)) { // Replace failed because finalFileName does not exist, try rename. if (!(result = rename(finalFileName))) errorStr = errorString(); @@ -210,7 +210,7 @@ bool SdkSaveFile::commit() // Back up current file. // If it's opened by another application, the lock follows the move. - if (QFile::exists(finalFileName)) { + if (QFileInfo::exists(finalFileName)) { // Kill old backup. Might be useful if creator crashed before removing backup. QFile::remove(backupName); QFile finalFile(finalFileName); diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index d3c9640d49c..f58f8f73731 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1252,7 +1252,7 @@ void tst_Dumpers::initTestCase() QString cdbextPath = qEnvironmentVariable("QTC_CDBEXT_PATH"); if (cdbextPath.isEmpty()) cdbextPath = QString(CDBEXT_PATH "\\qtcreatorcdbext64"); - QVERIFY(QFile::exists(cdbextPath + "\\qtcreatorcdbext.dll")); + QVERIFY(QFileInfo::exists(cdbextPath + "\\qtcreatorcdbext.dll")); env.set("_NT_DEBUGGER_EXTENSION_PATH", cdbextPath); env.prependOrSetPath(Utils::FilePath::fromString(m_qmakeBinary).parentDir()); m_makeBinary = env.searchInPath("nmake.exe").toString();