Commit a439483d authored by hjk's avatar hjk

Use QFileInfo::exist(f) instead of QFileInfo(f).exists() if possible

Faster.

Change-Id: I91aa67462e11ff3258600d7f158de79942d0dc81
Reviewed-by: default avatarMarc Reilly <marc.reilly@gmail.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 1e9b561c
...@@ -142,7 +142,7 @@ void SshKeyCreationDialog::saveKeys() ...@@ -142,7 +142,7 @@ void SshKeyCreationDialog::saveKeys()
bool SshKeyCreationDialog::userForbidsOverwriting() bool SshKeyCreationDialog::userForbidsOverwriting()
{ {
if (!QFileInfo(privateKeyFilePath()).exists() && !QFileInfo(publicKeyFilePath()).exists()) if (!QFileInfo::exists(privateKeyFilePath()) && !QFileInfo::exists(publicKeyFilePath()))
return false; return false;
const QMessageBox::StandardButton reply = QMessageBox::question(this, tr("File Exists"), const QMessageBox::StandardButton reply = QMessageBox::question(this, tr("File Exists"),
tr("There already is a file of that name. Do you want to overwrite it?"), tr("There already is a file of that name. Do you want to overwrite it?"),
......
...@@ -269,7 +269,7 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments, ...@@ -269,7 +269,7 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
log->append(newline); log->append(newline);
const FileName makeFullPath = arguments.environment.searchInPath(arguments.makeCommand); const FileName makeFullPath = arguments.environment.searchInPath(arguments.makeCommand);
if (QFileInfo(arguments.directory + QLatin1String("/Makefile")).exists()) { if (QFileInfo::exists(arguments.directory + QLatin1String("/Makefile"))) {
if (makeFullPath.isEmpty()) { if (makeFullPath.isEmpty()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary", *errorMessage = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary",
"%1 not found in PATH\n").arg(arguments.makeCommand); "%1 not found in PATH\n").arg(arguments.makeCommand);
......
...@@ -1213,7 +1213,7 @@ static FileName javaHomeForJavac(const FileName &location) ...@@ -1213,7 +1213,7 @@ static FileName javaHomeForJavac(const FileName &location)
while (tries > 0) { while (tries > 0) {
QDir dir = fileInfo.dir(); QDir dir = fileInfo.dir();
dir.cdUp(); dir.cdUp();
if (QFileInfo(dir.filePath(QLatin1String("lib/tools.jar"))).exists()) if (QFileInfo::exists(dir.filePath(QLatin1String("lib/tools.jar"))))
return FileName::fromString(dir.path()); return FileName::fromString(dir.path());
if (fileInfo.isSymLink()) if (fileInfo.isSymLink())
fileInfo.setFile(fileInfo.symLinkTarget()); fileInfo.setFile(fileInfo.symLinkTarget());
...@@ -1252,7 +1252,7 @@ void AndroidConfigurations::load() ...@@ -1252,7 +1252,7 @@ void AndroidConfigurations::load()
} }
} else if (HostOsInfo::isMacHost()) { } else if (HostOsInfo::isMacHost()) {
QString javaHome = QLatin1String("/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home"); QString javaHome = QLatin1String("/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home");
if (QFileInfo(javaHome).exists()) if (QFileInfo::exists(javaHome))
m_config.setOpenJDKLocation(Utils::FileName::fromString(javaHome)); m_config.setOpenJDKLocation(Utils::FileName::fromString(javaHome));
} else if (HostOsInfo::isWindowsHost()) { } else if (HostOsInfo::isWindowsHost()) {
QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Javasoft\\Java Development Kit"), QSettings::NativeFormat); QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Javasoft\\Java Development Kit"), QSettings::NativeFormat);
...@@ -1275,7 +1275,7 @@ void AndroidConfigurations::load() ...@@ -1275,7 +1275,7 @@ void AndroidConfigurations::load()
settings.beginGroup(version); settings.beginGroup(version);
QString tmpJavaHome = settings.value(QLatin1String("JavaHome")).toString(); QString tmpJavaHome = settings.value(QLatin1String("JavaHome")).toString();
settings.endGroup(); settings.endGroup();
if (!QFileInfo(tmpJavaHome).exists()) if (!QFileInfo::exists(tmpJavaHome))
continue; continue;
major = tmpMajor; major = tmpMajor;
......
...@@ -1259,7 +1259,7 @@ QIcon AndroidManifestEditorWidget::icon(const QString &baseDir, IconDPI dpi) ...@@ -1259,7 +1259,7 @@ QIcon AndroidManifestEditorWidget::icon(const QString &baseDir, IconDPI dpi)
void AndroidManifestEditorWidget::copyIcon(IconDPI dpi, const QString &baseDir, const QString &filePath) void AndroidManifestEditorWidget::copyIcon(IconDPI dpi, const QString &baseDir, const QString &filePath)
{ {
if (!QFileInfo(filePath).exists()) if (!QFileInfo::exists(filePath))
return; return;
const QString targetPath = iconPath(baseDir, dpi); const QString targetPath = iconPath(baseDir, dpi);
......
...@@ -122,7 +122,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const ...@@ -122,7 +122,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
env.set(QLatin1String("ANDROID_NDK_TOOLS_PREFIX"), AndroidConfig::toolsPrefix(targetAbi().architecture())); env.set(QLatin1String("ANDROID_NDK_TOOLS_PREFIX"), AndroidConfig::toolsPrefix(targetAbi().architecture()));
env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_VERSION"), m_ndkToolChainVersion); env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_VERSION"), m_ndkToolChainVersion);
QString javaHome = AndroidConfigurations::currentConfig().openJDKLocation().toString(); QString javaHome = AndroidConfigurations::currentConfig().openJDKLocation().toString();
if (!javaHome.isEmpty() && QFileInfo(javaHome).exists()) if (!javaHome.isEmpty() && QFileInfo::exists(javaHome))
env.set(QLatin1String("JAVA_HOME"), javaHome); env.set(QLatin1String("JAVA_HOME"), javaHome);
env.set(QLatin1String("ANDROID_HOME"), AndroidConfigurations::currentConfig().sdkLocation().toString()); env.set(QLatin1String("ANDROID_HOME"), AndroidConfigurations::currentConfig().sdkLocation().toString());
env.set(QLatin1String("ANDROID_SDK_ROOT"), AndroidConfigurations::currentConfig().sdkLocation().toString()); env.set(QLatin1String("ANDROID_SDK_ROOT"), AndroidConfigurations::currentConfig().sdkLocation().toString());
......
...@@ -173,9 +173,8 @@ void AutoreconfStep::run(QFutureInterface<bool> &interface) ...@@ -173,9 +173,8 @@ void AutoreconfStep::run(QFutureInterface<bool> &interface)
// Check whether we need to run autoreconf // Check whether we need to run autoreconf
const QString projectDir(bc->target()->project()->projectDirectory().toString()); const QString projectDir(bc->target()->project()->projectDirectory().toString());
const QFileInfo configureInfo(projectDir + QLatin1String("/configure"));
if (!configureInfo.exists()) if (!QFileInfo::exists(projectDir + QLatin1String("/configure")))
m_runAutoreconf = true; m_runAutoreconf = true;
if (!m_runAutoreconf) { if (!m_runAutoreconf) {
......
...@@ -219,7 +219,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, ...@@ -219,7 +219,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor,
if (fi.isDir()) { if (fi.isDir()) {
QDir subDir(fi.absoluteFilePath()); QDir subDir(fi.absoluteFilePath());
QString subProject = subDir.filePath(QLatin1String("CMakeLists.txt")); QString subProject = subDir.filePath(QLatin1String("CMakeLists.txt"));
if (QFileInfo(subProject).exists()) if (QFileInfo::exists(subProject))
fileName = subProject; fileName = subProject;
else else
return link; return link;
......
...@@ -147,10 +147,7 @@ CMakeManager *CMakeOpenProjectWizard::cmakeManager() const ...@@ -147,10 +147,7 @@ CMakeManager *CMakeOpenProjectWizard::cmakeManager() const
bool CMakeOpenProjectWizard::hasInSourceBuild() const bool CMakeOpenProjectWizard::hasInSourceBuild() const
{ {
QFileInfo fi(m_sourceDirectory + QLatin1String("/CMakeCache.txt")); return QFileInfo::exists(m_sourceDirectory + QLatin1String("/CMakeCache.txt"));
if (fi.exists())
return true;
return false;
} }
bool CMakeOpenProjectWizard::compatibleKitExist() const bool CMakeOpenProjectWizard::compatibleKitExist() const
......
...@@ -379,9 +379,9 @@ BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(Ge ...@@ -379,9 +379,9 @@ BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(Ge
static const QString symLinkMsg = tr("[symbolic link]"); static const QString symLinkMsg = tr("[symbolic link]");
foreach (const GeneratedFile &file, *files) { foreach (const GeneratedFile &file, *files) {
const QFileInfo fi(file.path()); const QString path = file.path();
if (fi.exists()) if (QFileInfo::exists(path))
existingFiles.append(file.path()); existingFiles.append(path);
} }
if (existingFiles.isEmpty()) if (existingFiles.isEmpty())
return OverwriteOk; return OverwriteOk;
......
...@@ -441,7 +441,7 @@ void HelpManager::verifyDocumenation() ...@@ -441,7 +441,7 @@ void HelpManager::verifyDocumenation()
{ {
const QStringList &registeredDocs = d->m_helpEngine->registeredDocumentations(); const QStringList &registeredDocs = d->m_helpEngine->registeredDocumentations();
foreach (const QString &nameSpace, registeredDocs) { foreach (const QString &nameSpace, registeredDocs) {
if (!QFileInfo(d->m_helpEngine->documentationFileName(nameSpace)).exists()) if (!QFileInfo::exists(d->m_helpEngine->documentationFileName(nameSpace)))
d->m_nameSpacesToUnregister.append(nameSpace); d->m_nameSpacesToUnregister.append(nameSpace);
} }
} }
......
...@@ -410,8 +410,7 @@ QString ICore::userResourcePath() ...@@ -410,8 +410,7 @@ QString ICore::userResourcePath()
const QString configDir = QFileInfo(settings(QSettings::UserScope)->fileName()).path(); const QString configDir = QFileInfo(settings(QSettings::UserScope)->fileName()).path();
const QString urp = configDir + QLatin1String("/qtcreator"); const QString urp = configDir + QLatin1String("/qtcreator");
QFileInfo fi(urp + QLatin1Char('/')); if (!QFileInfo::exists(urp + QLatin1Char('/'))) {
if (!fi.exists()) {
QDir dir; QDir dir;
if (!dir.mkpath(urp)) if (!dir.mkpath(urp))
qWarning() << "could not create" << urp; qWarning() << "could not create" << urp;
......
...@@ -134,7 +134,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<Core::Lo ...@@ -134,7 +134,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<Core::Lo
// "create and open" functionality // "create and open" functionality
const QString fullFilePath = dirInfo.filePath(name); const QString fullFilePath = dirInfo.filePath(name);
if (!QFileInfo(fullFilePath).exists() && dirInfo.exists()) { if (!QFileInfo::exists(fullFilePath) && dirInfo.exists()) {
LocatorFilterEntry createAndOpen(this, tr("Create and Open \"%1\"").arg(entry), fullFilePath); LocatorFilterEntry createAndOpen(this, tr("Create and Open \"%1\"").arg(entry), fullFilePath);
createAndOpen.extraInfo = Utils::FileUtils::shortNativePath( createAndOpen.extraInfo = Utils::FileUtils::shortNativePath(
Utils::FileName::fromString(dirInfo.absolutePath())); Utils::FileName::fromString(dirInfo.absolutePath()));
......
...@@ -171,8 +171,7 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti ...@@ -171,8 +171,7 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti
// Process all files from the projects // Process all files from the projects
foreach (const QString filePath, filesToOpen) { foreach (const QString filePath, filesToOpen) {
// Skip e.g. "<configuration>" // Skip e.g. "<configuration>"
const QFileInfo fileInfo(filePath); if (!QFileInfo::exists(filePath))
if (!fileInfo.exists())
continue; continue;
qDebug() << " --" << filePath; qDebug() << " --" << filePath;
......
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
ExampleProjectConfigurator(const QString &projectFile) ExampleProjectConfigurator(const QString &projectFile)
{ {
const QString projectUserFile = projectFile + _(".user"); const QString projectUserFile = projectFile + _(".user");
QVERIFY(!QFileInfo(projectUserFile).exists()); QVERIFY(!QFileInfo::exists(projectUserFile));
// Open project // Open project
QString errorOpeningProject; QString errorOpeningProject;
......
...@@ -195,7 +195,7 @@ bool TestCase::writeFile(const QString &filePath, const QByteArray &contents) ...@@ -195,7 +195,7 @@ bool TestCase::writeFile(const QString &filePath, const QByteArray &contents)
FileWriterAndRemover::FileWriterAndRemover(const QString &filePath, const QByteArray &contents) FileWriterAndRemover::FileWriterAndRemover(const QString &filePath, const QByteArray &contents)
: m_filePath(filePath) : m_filePath(filePath)
{ {
if (QFileInfo(filePath).exists()) { if (QFileInfo::exists(filePath)) {
const QString warning = QString::fromLatin1( const QString warning = QString::fromLatin1(
"Will not overwrite existing file: \"%1\"." "Will not overwrite existing file: \"%1\"."
" If this file is left over due to a(n) abort/crash, please remove manually.") " If this file is left over due to a(n) abort/crash, please remove manually.")
......
...@@ -1417,7 +1417,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1417,7 +1417,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
//qDebug() << "BP " << rid << data.toString(); //qDebug() << "BP " << rid << data.toString();
// Quickly set the location marker. // Quickly set the location marker.
if (lineNumber && !boolSetting(OperateByInstruction) if (lineNumber && !boolSetting(OperateByInstruction)
&& QFileInfo(fullName).exists() && QFileInfo::exists(fullName)
&& !isQmlStepBreakpoint(rid) && !isQmlStepBreakpoint(rid)
&& !isQFatalBreakpoint(rid)) && !isQFatalBreakpoint(rid))
gotoLocation(Location(fullName, lineNumber)); gotoLocation(Location(fullName, lineNumber));
......
...@@ -172,22 +172,22 @@ void GdbServerStarter::attach(int port) ...@@ -172,22 +172,22 @@ void GdbServerStarter::attach(int port)
QString binary; QString binary;
QString localExecutable; QString localExecutable;
QString candidate = sysroot + d->process.exe; QString candidate = sysroot + d->process.exe;
if (QFileInfo(candidate).exists()) if (QFileInfo::exists(candidate))
localExecutable = candidate; localExecutable = candidate;
if (localExecutable.isEmpty()) { if (localExecutable.isEmpty()) {
binary = d->process.cmdLine.section(QLatin1Char(' '), 0, 0); binary = d->process.cmdLine.section(QLatin1Char(' '), 0, 0);
candidate = sysroot + QLatin1Char('/') + binary; candidate = sysroot + QLatin1Char('/') + binary;
if (QFileInfo(candidate).exists()) if (QFileInfo::exists(candidate))
localExecutable = candidate; localExecutable = candidate;
} }
if (localExecutable.isEmpty()) { if (localExecutable.isEmpty()) {
candidate = sysroot + QLatin1String("/usr/bin/") + binary; candidate = sysroot + QLatin1String("/usr/bin/") + binary;
if (QFileInfo(candidate).exists()) if (QFileInfo::exists(candidate))
localExecutable = candidate; localExecutable = candidate;
} }
if (localExecutable.isEmpty()) { if (localExecutable.isEmpty()) {
candidate = sysroot + QLatin1String("/bin/") + binary; candidate = sysroot + QLatin1String("/bin/") + binary;
if (QFileInfo(candidate).exists()) if (QFileInfo::exists(candidate))
localExecutable = candidate; localExecutable = candidate;
} }
if (localExecutable.isEmpty()) { if (localExecutable.isEmpty()) {
......
...@@ -768,7 +768,7 @@ void PdbEngine::handleBacktrace(const PdbResponse &response) ...@@ -768,7 +768,7 @@ void PdbEngine::handleBacktrace(const PdbResponse &response)
frame.line = lineNumber; frame.line = lineNumber;
frame.function = _(line.mid(pos2 + 1)); frame.function = _(line.mid(pos2 + 1));
frame.usable = QFileInfo(frame.file).isReadable(); frame.usable = QFileInfo(frame.file).isReadable();
if (frame.line > 0 && QFileInfo(frame.file).exists()) { if (frame.line > 0 && QFileInfo::exists(frame.file)) {
if (line.startsWith("> ")) if (line.startsWith("> "))
currentIndex = level; currentIndex = level;
frame.level = level; frame.level = level;
......
...@@ -3225,8 +3225,8 @@ bool GitClient::synchronousMerge(const QString &workingDirectory, const QString ...@@ -3225,8 +3225,8 @@ bool GitClient::synchronousMerge(const QString &workingDirectory, const QString
bool GitClient::canRebase(const QString &workingDirectory) const bool GitClient::canRebase(const QString &workingDirectory) const
{ {
const QString gitDir = findGitDirForRepository(workingDirectory); const QString gitDir = findGitDirForRepository(workingDirectory);
if (QFileInfo(gitDir + QLatin1String("/rebase-apply")).exists() if (QFileInfo::exists(gitDir + QLatin1String("/rebase-apply"))
|| QFileInfo(gitDir + QLatin1String("/rebase-merge")).exists()) { || QFileInfo::exists(gitDir + QLatin1String("/rebase-merge"))) {
VcsOutputWindow::appendError( VcsOutputWindow::appendError(
tr("Rebase, merge or am is in progress. Finish " tr("Rebase, merge or am is in progress. Finish "
"or abort it and then try again.")); "or abort it and then try again."));
......
...@@ -117,7 +117,7 @@ void IosRunner::start() ...@@ -117,7 +117,7 @@ void IosRunner::start()
} }
m_cleanExit = false; m_cleanExit = false;
m_qmlPort = 0; m_qmlPort = 0;
if (!QFileInfo(m_bundleDir).exists()) { if (!QFileInfo::exists(m_bundleDir)) {
TaskHub::addTask(Task::Warning, TaskHub::addTask(Task::Warning,
tr("Could not find %1.").arg(m_bundleDir), tr("Could not find %1.").arg(m_bundleDir),
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
......
...@@ -181,8 +181,7 @@ void PerforceChecker::parseOutput(const QString &response) ...@@ -181,8 +181,7 @@ void PerforceChecker::parseOutput(const QString &response)
return; return;
} }
// Check existence. No precise check here, might be a symlink // Check existence. No precise check here, might be a symlink
const QFileInfo fi(repositoryRoot); if (QFileInfo::exists(repositoryRoot)) {
if (fi.exists()) {
emitSucceeded(repositoryRoot); emitSucceeded(repositoryRoot);
} else { } else {
emitFailed(tr("The repository \"%1\" does not exist."). emitFailed(tr("The repository \"%1\" does not exist.").
......
...@@ -203,10 +203,8 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi) ...@@ -203,10 +203,8 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
} }
} }
QString effectiveCommand = m_param.effectiveCommand(); QString effectiveCommand = m_param.effectiveCommand();
if (!QFileInfo(effectiveCommand).exists()) { if (!QFileInfo::exists(effectiveCommand)) {
processStartupFailed(); processStartupFailed();
fi.reportResult(false); fi.reportResult(false);
emit finished(); emit finished();
......
...@@ -511,7 +511,7 @@ bool JsonWizardFactory::initialize(const QVariantMap &data, const QDir &baseDir, ...@@ -511,7 +511,7 @@ bool JsonWizardFactory::initialize(const QVariantMap &data, const QDir &baseDir,
strVal = data.value(QLatin1String(ICON_KEY)).toString(); strVal = data.value(QLatin1String(ICON_KEY)).toString();
if (!strVal.isEmpty()) { if (!strVal.isEmpty()) {
strVal = baseDir.absoluteFilePath(strVal); strVal = baseDir.absoluteFilePath(strVal);
if (!QFileInfo(strVal).exists()) { if (!QFileInfo::exists(strVal)) {
*errorMessage = tr("Icon \"%1\" not found.").arg(strVal); *errorMessage = tr("Icon \"%1\" not found.").arg(strVal);
return false; return false;
} }
......
...@@ -99,7 +99,7 @@ void LocalApplicationRunControl::start() ...@@ -99,7 +99,7 @@ void LocalApplicationRunControl::start()
if (m_executable.isEmpty()) { if (m_executable.isEmpty()) {
appendMessage(tr("No executable specified.") + QLatin1Char('\n'), Utils::ErrorMessageFormat); appendMessage(tr("No executable specified.") + QLatin1Char('\n'), Utils::ErrorMessageFormat);
emit finished(); emit finished();
} else if (!QFileInfo(m_executable).exists()){ } else if (!QFileInfo::exists(m_executable)) {
appendMessage(tr("Executable %1 does not exist.").arg(QDir::toNativeSeparators(m_executable)) + QLatin1Char('\n'), appendMessage(tr("Executable %1 does not exist.").arg(QDir::toNativeSeparators(m_executable)) + QLatin1Char('\n'),
Utils::ErrorMessageFormat); Utils::ErrorMessageFormat);
emit finished(); emit finished();
......
...@@ -308,7 +308,7 @@ static QString winExpandDelayedEnvReferences(QString in, const Utils::Environmen ...@@ -308,7 +308,7 @@ static QString winExpandDelayedEnvReferences(QString in, const Utils::Environmen
Utils::Environment MsvcToolChain::readEnvironmentSetting(Utils::Environment& env) const Utils::Environment MsvcToolChain::readEnvironmentSetting(Utils::Environment& env) const
{ {
Utils::Environment result = env; Utils::Environment result = env;
if (!QFileInfo(m_vcvarsBat).exists()) if (!QFileInfo::exists(m_vcvarsBat))
return result; return result;
QMap<QString, QString> envPairs; QMap<QString, QString> envPairs;
...@@ -354,7 +354,7 @@ bool MsvcToolChain::isValid() const ...@@ -354,7 +354,7 @@ bool MsvcToolChain::isValid() const
if (!AbstractMsvcToolChain::isValid()) if (!AbstractMsvcToolChain::isValid())
return false; return false;
QString vcVarsBat = MsvcToolChainFactory::vcVarsBatFor(QFileInfo(m_vcvarsBat).absolutePath(), m_varsBatArg); QString vcVarsBat = MsvcToolChainFactory::vcVarsBatFor(QFileInfo(m_vcvarsBat).absolutePath(), m_varsBatArg);
return QFileInfo(vcVarsBat).exists(); return QFileInfo::exists(vcVarsBat);
} }
MsvcToolChain::MsvcToolChain() : MsvcToolChain::MsvcToolChain() :
......
...@@ -117,7 +117,7 @@ static QString winExpandDelayedEnvReferences(QString in, const Utils::Environmen ...@@ -117,7 +117,7 @@ static QString winExpandDelayedEnvReferences(QString in, const Utils::Environmen
Utils::Environment WinCEToolChain::readEnvironmentSetting(Utils::Environment &env) const Utils::Environment WinCEToolChain::readEnvironmentSetting(Utils::Environment &env) const
{ {
Utils::Environment result = env; Utils::Environment result = env;
if (!QFileInfo(m_vcvarsBat).exists()) if (!QFileInfo::exists(m_vcvarsBat))
return result; return result;
// Get the env pairs // Get the env pairs
......
...@@ -91,7 +91,7 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, ...@@ -91,7 +91,7 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
// Some people don't like it when files are created as a side effect of opening a project, // Some people don't like it when files are created as a side effect of opening a project,
// so do not store the build graph if the build directory does not exist yet. // so do not store the build graph if the build directory does not exist yet.
params.setDryRun(!QFileInfo(dir).exists()); params.setDryRun(!QFileInfo::exists(dir));
params.setBuildRoot(dir); params.setBuildRoot(dir);
params.setProjectFilePath(m_projectFilePath); params.setProjectFilePath(m_projectFilePath);
......
...@@ -281,7 +281,7 @@ void MakeStep::run(QFutureInterface<bool> & fi) ...@@ -281,7 +281,7 @@ void MakeStep::run(QFutureInterface<bool> & fi)
return; return;
} }
if (!QFileInfo(m_makeFileToCheck).exists()) { if (!QFileInfo::exists(m_makeFileToCheck)) {
if (!ignoreReturnValue()) if (!ignoreReturnValue())
emit addOutput(tr("Cannot find Makefile. Check your build settings."), BuildStep::MessageOutput); emit addOutput(tr("Cannot find Makefile. Check your build settings."), BuildStep::MessageOutput);
fi.reportResult(ignoreReturnValue()); fi.reportResult(ignoreReturnValue());
......
...@@ -144,7 +144,7 @@ ProFileEditorWidget::Link ProFileEditorWidget::findLinkAt(const QTextCursor &cur ...@@ -144,7 +144,7 @@ ProFileEditorWidget::Link ProFileEditorWidget::findLinkAt(const QTextCursor &cur
if (fi.isDir()) { if (fi.isDir()) {
QDir subDir(fi.absoluteFilePath()); QDir subDir(fi.absoluteFilePath());
QString subProject = subDir.filePath(subDir.dirName() + QLatin1String(".pro")); QString subProject = subDir.filePath(subDir.dirName() + QLatin1String(".pro"));
if (QFileInfo(subProject).exists()) if (QFileInfo::exists(subProject))
fileName = subProject; fileName = subProject;
else else
return link; return link;
......
...@@ -361,7 +361,7 @@ MakeStep *QmakeBuildConfiguration::makeStep() const ...@@ -361,7 +361,7 @@ MakeStep *QmakeBuildConfiguration::makeStep() const
QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportFrom(const QString &makefile) QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportFrom(const QString &makefile)
{ {
QMakeStep *qs = qmakeStep(); QMakeStep *qs = qmakeStep();
if (QFileInfo(makefile).exists() && qs) { if (QFileInfo::exists(makefile) && qs) {
FileName qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(makefile); FileName qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(makefile);
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit()); BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
if (!version) if (!version)
...@@ -507,7 +507,7 @@ FileName QmakeBuildConfiguration::extractSpecFromArguments(QString *args, ...@@ -507,7 +507,7 @@ FileName QmakeBuildConfiguration::extractSpecFromArguments(QString *args,
// if it is the former we need to get the canonical form // if it is the former we need to get the canonical form
// for the other one we don't need to do anything // for the other one we don't need to do anything
if (parsedSpec.toFileInfo().isRelative()) { if (parsedSpec.toFileInfo().isRelative()) {
if (QFileInfo(directory + QLatin1Char('/') + parsedSpec.toString()).exists()) if (QFileInfo::exists(directory + QLatin1Char('/') + parsedSpec.toString()))
parsedSpec = FileName::fromUserInput(directory + QLatin1Char('/') + parsedSpec.toString()); parsedSpec = FileName::fromUserInput(directory + QLatin1Char('/') + parsedSpec.toString());
else else
parsedSpec = FileName::fromUserInput(baseMkspecDir.toString() + QLatin1Char('/') + parsedSpec.toString()); parsedSpec = FileName::fromUserInput(baseMkspecDir.toString() + QLatin1Char('/') + parsedSpec.toString());
......
...@@ -1437,7 +1437,7 @@ bool QmakeProject::requiresTargetPanel() const ...@@ -1437,7 +1437,7 @@ bool QmakeProject::requiresTargetPanel() const
// but more pratical then duplicated the code everywhere // but more pratical then duplicated the code everywhere
QString QmakeProject::disabledReasonForRunConfiguration(const QString &proFilePath) QString QmakeProject::disabledReasonForRunConfiguration(const QString &proFilePath)
{