aboutsummaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2016-04-06 09:19:05 +0300
committerOrgad Shaneh <orgads@gmail.com>2016-04-06 08:27:14 +0000
commitfce4bf49acd6f63aabaf188fcc6686e019dead45 (patch)
tree2f96be1a373c0a64d1ba79fcf8b4bd62a9193919 /src/app
parent583af3783790396cf56d9eeace126b0b864aa91d (diff)
setup-toolchains: Minor optimizations for QFileInfo usages
Change-Id: I459a116e14395669d699bed639bb2accd1219ea8 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/qbs-setup-toolchains/probe.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/app/qbs-setup-toolchains/probe.cpp b/src/app/qbs-setup-toolchains/probe.cpp
index aa3a2f3ef..4a9c94b95 100644
--- a/src/app/qbs-setup-toolchains/probe.cpp
+++ b/src/app/qbs-setup-toolchains/probe.cpp
@@ -66,7 +66,7 @@ static QString findExecutable(const QString &fileName)
const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
foreach (const QString &ppath, path.split(HostOsInfo::pathListSeparator())) {
const QString fullPath = ppath + QLatin1Char('/') + fullFileName;
- if (QFileInfo(fullPath).exists())
+ if (QFileInfo::exists(fullPath))
return QDir::cleanPath(fullPath);
}
return QString();
@@ -138,7 +138,7 @@ static void setCommonProperties(Profile &profile, const QString &compilerFilePat
const QStringList &toolchainTypes, const QString &architecture)
{
const QFileInfo cfi(compilerFilePath);
- const QString compilerName = QFileInfo(compilerFilePath).fileName();
+ const QString compilerName = cfi.fileName();
if (toolchainTypes.contains(QStringLiteral("mingw")))
profile.setValue(QStringLiteral("qbs.targetOS"), QStringList(QStringLiteral("windows")));
@@ -237,11 +237,12 @@ static void gccProbe(Settings *settings, QList<Profile> &profiles, const QString
const QString crossCompilePrefix = QString::fromLocal8Bit(qgetenv("CROSS_COMPILE"));
const QString compilerFilePath = findExecutable(crossCompilePrefix + compilerName);
- if (!QFileInfo(compilerFilePath).exists()) {
+ QFileInfo cfi(compilerFilePath);
+ if (!cfi.exists()) {
qStderr << Tr::tr("%1 not found.").arg(compilerName) << endl;
return;
}
- const QString profileName = QFileInfo(compilerFilePath).completeBaseName();
+ const QString profileName = cfi.completeBaseName();
const QStringList toolchainTypes = toolchainTypeFromCompilerName(compilerName);
profiles << createGccProfile(compilerFilePath, settings, toolchainTypes, profileName);
}