summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp4
-rw-r--r--src/plugins/debugger/debuggerrunner.cpp12
-rw-r--r--src/plugins/madde/maemoglobal.cpp7
-rw-r--r--src/plugins/madde/maemoinstalltosysrootstep.cpp10
-rw-r--r--src/plugins/madde/maemopackagecreationstep.cpp4
-rw-r--r--src/plugins/madde/maemopublisherfremantlefree.cpp2
-rw-r--r--src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp2
-rw-r--r--src/plugins/madde/maemopublishingwizardfactories.cpp2
-rw-r--r--src/plugins/madde/maemoqemuruntimeparser.cpp6
-rw-r--r--src/plugins/madde/maemoqtversion.cpp16
-rw-r--r--src/plugins/madde/maemoqtversion.h2
-rw-r--r--src/plugins/madde/maemoqtversionfactory.cpp7
-rw-r--r--src/plugins/madde/maemoqtversionfactory.h2
-rw-r--r--src/plugins/madde/maemoremotemounter.cpp2
-rw-r--r--src/plugins/madde/maemotoolchain.cpp14
-rw-r--r--src/plugins/madde/maemotoolchain.h2
-rw-r--r--src/plugins/madde/qt4maemotarget.cpp4
-rw-r--r--src/plugins/projectexplorer/customexecutablerunconfiguration.cpp4
-rw-r--r--src/plugins/projectexplorer/gcctoolchain.cpp36
-rw-r--r--src/plugins/projectexplorer/gcctoolchain.h8
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.cpp10
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.h3
-rw-r--r--src/plugins/projectexplorer/toolchain.h4
-rw-r--r--src/plugins/projectexplorer/wincetoolchain.cpp4
-rw-r--r--src/plugins/projectexplorer/wincetoolchain.h2
-rw-r--r--src/plugins/qt4projectmanager/qmakestep.cpp28
-rw-r--r--src/plugins/qt4projectmanager/qmakestep.h5
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp2
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp2
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp2
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h2
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h2
-rw-r--r--src/plugins/qt4projectmanager/qt4buildconfiguration.cpp78
-rw-r--r--src/plugins/qt4projectmanager/qt4buildconfiguration.h2
-rw-r--r--src/plugins/qt4projectmanager/qt4project.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt4target.cpp18
-rw-r--r--src/plugins/qt4projectmanager/qt4target.h2
-rw-r--r--src/plugins/qt4projectmanager/winceqtversion.cpp4
-rw-r--r--src/plugins/qt4projectmanager/winceqtversion.h2
-rw-r--r--src/plugins/qt4projectmanager/winceqtversionfactory.cpp4
-rw-r--r--src/plugins/qt4projectmanager/winceqtversionfactory.h5
-rw-r--r--src/plugins/qtsupport/baseqtversion.cpp132
-rw-r--r--src/plugins/qtsupport/baseqtversion.h32
-rw-r--r--src/plugins/qtsupport/debugginghelperbuildtask.cpp4
-rw-r--r--src/plugins/qtsupport/debugginghelperbuildtask.h7
-rw-r--r--src/plugins/qtsupport/qtoptionspage.cpp31
-rw-r--r--src/plugins/qtsupport/qtoptionspage.h2
-rw-r--r--src/plugins/qtsupport/qtversionfactory.cpp8
-rw-r--r--src/plugins/qtsupport/qtversionfactory.h7
-rw-r--r--src/plugins/qtsupport/qtversionmanager.cpp49
-rw-r--r--src/plugins/qtsupport/qtversionmanager.h8
-rw-r--r--src/plugins/remotelinux/embeddedlinuxqtversion.cpp2
-rw-r--r--src/plugins/remotelinux/embeddedlinuxqtversion.h2
-rw-r--r--src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp4
-rw-r--r--src/plugins/remotelinux/embeddedlinuxqtversionfactory.h2
-rw-r--r--src/plugins/remotelinux/embeddedlinuxtarget.cpp4
-rw-r--r--src/plugins/remotelinux/embeddedlinuxtarget.h2
71 files changed, 326 insertions, 343 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
index f0e298f50e..f6d84d5fef 100644
--- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
@@ -241,7 +241,7 @@ void CMakeRunConfiguration::setCommandLineArguments(const QString &newText)
QString CMakeRunConfiguration::dumperLibrary() const
{
- QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
+ Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath);
QString dhl = ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData);
return dhl;
@@ -249,7 +249,7 @@ QString CMakeRunConfiguration::dumperLibrary() const
QStringList CMakeRunConfiguration::dumperLibraryLocations() const
{
- QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
+ Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath);
return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData);
}
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index 7c2b2351a3..60fc25695a 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -678,26 +678,26 @@ QString DebuggerRunControlFactory::displayName() const
}
// Find Qt installation by running qmake
-static inline QString findQtInstallPath(const QString &qmakePath)
+static inline QString findQtInstallPath(const Utils::FileName &qmakePath)
{
QProcess proc;
QStringList args;
args.append(_("-query"));
args.append(_("QT_INSTALL_HEADERS"));
- proc.start(qmakePath, args);
+ proc.start(qmakePath.toString(), args);
if (!proc.waitForStarted()) {
- qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(qmakePath),
+ qWarning("%s: Cannot start '%s': %s", Q_FUNC_INFO, qPrintable(qmakePath.toString()),
qPrintable(proc.errorString()));
return QString();
}
proc.closeWriteChannel();
if (!proc.waitForFinished()) {
Utils::SynchronousProcess::stopProcess(proc);
- qWarning("%s: Timeout running '%s'.", Q_FUNC_INFO, qPrintable(qmakePath));
+ qWarning("%s: Timeout running '%s'.", Q_FUNC_INFO, qPrintable(qmakePath.toString()));
return QString();
}
if (proc.exitStatus() != QProcess::NormalExit) {
- qWarning("%s: '%s' crashed.", Q_FUNC_INFO, qPrintable(qmakePath));
+ qWarning("%s: '%s' crashed.", Q_FUNC_INFO, qPrintable(qmakePath.toString()));
return QString();
}
const QByteArray ba = proc.readAllStandardOutput().trimmed();
@@ -738,7 +738,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
if (const ProjectExplorer::Target *target = runConfiguration->target()) {
if (QByteArray(target->metaObject()->className()).contains("Qt4")) {
- const QString qmake = Utils::BuildableHelperLibrary::findSystemQt(sp.environment);
+ const Utils::FileName qmake = Utils::BuildableHelperLibrary::findSystemQt(sp.environment);
if (!qmake.isEmpty())
sp.qtInstallPath = findQtInstallPath(qmake);
}
diff --git a/src/plugins/madde/maemoglobal.cpp b/src/plugins/madde/maemoglobal.cpp
index cd41e096d0..e28cfc189f 100644
--- a/src/plugins/madde/maemoglobal.cpp
+++ b/src/plugins/madde/maemoglobal.cpp
@@ -176,7 +176,12 @@ QString MaemoGlobal::maddeRoot(const QString &qmakePath)
QString MaemoGlobal::targetRoot(const QString &qmakePath)
{
- return QDir::cleanPath(qmakePath).remove(binQmake);
+#ifdef Q_OS_WIN
+ Qt::CaseSensitivity cs = Qt::CaseInsensitive;
+#else
+ Qt::CaseSensitivity cs = Qt::CaseSensitive;
+#endif
+ return QDir::cleanPath(qmakePath).remove(binQmake, cs);
}
QString MaemoGlobal::targetName(const QString &qmakePath)
diff --git a/src/plugins/madde/maemoinstalltosysrootstep.cpp b/src/plugins/madde/maemoinstalltosysrootstep.cpp
index 56987e3a3e..d09a0ddf24 100644
--- a/src/plugins/madde/maemoinstalltosysrootstep.cpp
+++ b/src/plugins/madde/maemoinstalltosysrootstep.cpp
@@ -179,7 +179,7 @@ bool AbstractMaemoInstallPackageToSysrootStep::init()
return false;
}
- m_qmakeCommand = bc->qtVersion()->qmakeCommand();
+ m_qmakeCommand = bc->qtVersion()->qmakeCommand().toString();
m_packageFilePath = pStep->packageFilePath();
return true;
}
@@ -403,12 +403,12 @@ bool MaemoMakeInstallToSysrootStep::init()
}
Utils::Environment env = bc->environment();
- MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand());
- QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand());
+ MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand().toString());
+ QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand().toString());
QStringList args = QStringList() << QLatin1String("-t")
- << MaemoGlobal::targetName(qtVersion->qmakeCommand()) << QLatin1String("make")
+ << MaemoGlobal::targetName(qtVersion->qmakeCommand().toString()) << QLatin1String("make")
<< QLatin1String("install") << (QLatin1String("INSTALL_ROOT=") + qtVersion->systemRoot());
- MaemoGlobal::transformMaddeCall(command, args, qtVersion->qmakeCommand());
+ MaemoGlobal::transformMaddeCall(command, args, qtVersion->qmakeCommand().toString());
processParameters()->setCommand(command);
processParameters()->setArguments(args.join(QLatin1String(" ")));
processParameters()->setEnvironment(env);
diff --git a/src/plugins/madde/maemopackagecreationstep.cpp b/src/plugins/madde/maemopackagecreationstep.cpp
index 205ae1fafa..f795657193 100644
--- a/src/plugins/madde/maemopackagecreationstep.cpp
+++ b/src/plugins/madde/maemopackagecreationstep.cpp
@@ -101,7 +101,7 @@ bool AbstractMaemoPackageCreationStep::init()
return false;
}
- m_qmakeCommand = qt4BuildConfiguration()->qtVersion()->qmakeCommand();
+ m_qmakeCommand = qt4BuildConfiguration()->qtVersion()->qmakeCommand().toString();
return true;
}
@@ -292,7 +292,7 @@ bool MaemoDebianPackageCreationStep::init()
{
if (!AbstractMaemoPackageCreationStep::init())
return false;
- m_maddeRoot = MaemoGlobal::maddeRoot(qt4BuildConfiguration()->qtVersion()->qmakeCommand());
+ m_maddeRoot = MaemoGlobal::maddeRoot(qt4BuildConfiguration()->qtVersion()->qmakeCommand().toString());
m_projectDirectory = project()->projectDirectory();
m_pkgFileName = maemoTarget()->packageFileName();
m_packageName = maemoTarget()->packageName();
diff --git a/src/plugins/madde/maemopublisherfremantlefree.cpp b/src/plugins/madde/maemopublisherfremantlefree.cpp
index 70bd593a0e..9cb32c51ec 100644
--- a/src/plugins/madde/maemopublisherfremantlefree.cpp
+++ b/src/plugins/madde/maemopublisherfremantlefree.cpp
@@ -378,7 +378,7 @@ void MaemoPublisherFremantleFree::runDpkgBuildPackage()
emit progressReport(tr("Building source package..."));
const QStringList args = QStringList() << QLatin1String("dpkg-buildpackage")
<< QLatin1String("-S") << QLatin1String("-us") << QLatin1String("-uc");
- MaemoGlobal::callMad(*m_process, args, lqt->qmakeCommand(), true);
+ MaemoGlobal::callMad(*m_process, args, lqt->qmakeCommand().toString(), true);
}
// We have to implement the SCP protocol, because the maemo.org
diff --git a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp
index 6e68c1956b..f606215200 100644
--- a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp
+++ b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp
@@ -86,7 +86,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
QtSupport::BaseQtVersion *lqt = qt4Bc->qtVersion();
if (!lqt)
continue;
- if (MaemoGlobal::osType(lqt->qmakeCommand()) == QLatin1String(Maemo5OsType))
+ if (MaemoGlobal::osType(lqt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
m_buildConfigs << qt4Bc;
}
break;
diff --git a/src/plugins/madde/maemopublishingwizardfactories.cpp b/src/plugins/madde/maemopublishingwizardfactories.cpp
index d21b3603c1..02d65d27c2 100644
--- a/src/plugins/madde/maemopublishingwizardfactories.cpp
+++ b/src/plugins/madde/maemopublishingwizardfactories.cpp
@@ -84,7 +84,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
QtSupport::BaseQtVersion *qt = qt4Bc->qtVersion();
if (!qt)
continue;
- if (MaemoGlobal::osType(qt->qmakeCommand()) == QLatin1String(Maemo5OsType))
+ if (MaemoGlobal::osType(qt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
return true;
}
break;
diff --git a/src/plugins/madde/maemoqemuruntimeparser.cpp b/src/plugins/madde/maemoqemuruntimeparser.cpp
index 0e49137c57..0c78221661 100644
--- a/src/plugins/madde/maemoqemuruntimeparser.cpp
+++ b/src/plugins/madde/maemoqemuruntimeparser.cpp
@@ -93,14 +93,14 @@ MaemoQemuRuntimeParser::MaemoQemuRuntimeParser(const QString &madInfoOutput,
MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtSupport::BaseQtVersion *qtVersion)
{
MaemoQemuRuntime runtime;
- const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion->qmakeCommand());
+ const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion->qmakeCommand().toString());
QProcess madProc;
- if (!MaemoGlobal::callMad(madProc, QStringList() << QLatin1String("info"), qtVersion->qmakeCommand(), false))
+ if (!MaemoGlobal::callMad(madProc, QStringList() << QLatin1String("info"), qtVersion->qmakeCommand().toString(), false))
return runtime;
if (!madProc.waitForStarted() || !madProc.waitForFinished())
return runtime;
const QByteArray &madInfoOutput = madProc.readAllStandardOutput();
- const QString &targetName = MaemoGlobal::targetName(qtVersion->qmakeCommand());
+ const QString &targetName = MaemoGlobal::targetName(qtVersion->qmakeCommand().toString());
runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath)
.parseRuntime();
if (!runtime.m_name.isEmpty()) {
diff --git a/src/plugins/madde/maemoqtversion.cpp b/src/plugins/madde/maemoqtversion.cpp
index d7c60bf61a..4ab595d11e 100644
--- a/src/plugins/madde/maemoqtversion.cpp
+++ b/src/plugins/madde/maemoqtversion.cpp
@@ -52,10 +52,10 @@ MaemoQtVersion::MaemoQtVersion() : QtSupport::BaseQtVersion()
}
-MaemoQtVersion::MaemoQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
+MaemoQtVersion::MaemoQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource),
- m_osType(MaemoGlobal::osType(path)),
- m_isvalidVersion(MaemoGlobal::isValidMaemoQtVersion(path, m_osType))
+ m_osType(MaemoGlobal::osType(path.toString())),
+ m_isvalidVersion(MaemoGlobal::isValidMaemoQtVersion(path.toString(), m_osType))
{
}
@@ -68,7 +68,7 @@ MaemoQtVersion::~MaemoQtVersion()
void MaemoQtVersion::fromMap(const QVariantMap &map)
{
QtSupport::BaseQtVersion::fromMap(map);
- QString path = qmakeCommand();
+ QString path = qmakeCommand().toString();
m_osType = MaemoGlobal::osType(path);
m_isvalidVersion = MaemoGlobal::isValidMaemoQtVersion(path, m_osType);
}
@@ -91,7 +91,7 @@ MaemoQtVersion *MaemoQtVersion::clone() const
QString MaemoQtVersion::systemRoot() const
{
if (m_systemRoot.isNull()) {
- QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(qmakeCommand()))
+ QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(qmakeCommand().toString()))
+ QLatin1String("/information"));
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream stream(&file);
@@ -101,7 +101,7 @@ QString MaemoQtVersion::systemRoot() const
if (list.count() <= 1)
continue;
if (list.at(0) == QLatin1String("sysroot")) {
- m_systemRoot = MaemoGlobal::maddeRoot(qmakeCommand())
+ m_systemRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString())
+ QLatin1String("/sysroots/") + list.at(1);
}
}
@@ -178,7 +178,7 @@ QString MaemoQtVersion::osType() const
void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const
{
- const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand());
+ const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString());
// Needed to make pkg-config stuff work.
env.prependOrSet(QLatin1String("SYSROOT_DIR"), QDir::toNativeSeparators(systemRoot()));
@@ -191,7 +191,7 @@ void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin").arg(maddeRoot)));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
- .arg(MaemoGlobal::targetRoot(qmakeCommand()))));
+ .arg(MaemoGlobal::targetRoot(qmakeCommand().toString()))));
}
} // namespace Internal
diff --git a/src/plugins/madde/maemoqtversion.h b/src/plugins/madde/maemoqtversion.h
index 6da0bf4a4d..b5b0620608 100644
--- a/src/plugins/madde/maemoqtversion.h
+++ b/src/plugins/madde/maemoqtversion.h
@@ -41,7 +41,7 @@ class MaemoQtVersion : public QtSupport::BaseQtVersion
{
public:
MaemoQtVersion();
- MaemoQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
+ MaemoQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
~MaemoQtVersion();
void fromMap(const QVariantMap &map);
diff --git a/src/plugins/madde/maemoqtversionfactory.cpp b/src/plugins/madde/maemoqtversionfactory.cpp
index e6ac8760b9..126c4ec172 100644
--- a/src/plugins/madde/maemoqtversionfactory.cpp
+++ b/src/plugins/madde/maemoqtversionfactory.cpp
@@ -72,18 +72,19 @@ int MaemoQtVersionFactory::priority() const
return 50;
}
-QtSupport::BaseQtVersion *MaemoQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
+QtSupport::BaseQtVersion *MaemoQtVersionFactory::create(const Utils::FileName &qmakeCommand, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
Q_UNUSED(evaluator);
// we are the fallback :) so we don't care what kinf of qt it is
- QFileInfo fi(qmakePath);
+ QFileInfo fi = qmakeCommand.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0;
+ QString qmakePath = qmakeCommand.toString();
if (MaemoGlobal::isValidMaemo5QtVersion(qmakePath)
|| MaemoGlobal::isValidHarmattanQtVersion(qmakePath)
|| MaemoGlobal::isValidMeegoQtVersion(qmakePath))
- return new MaemoQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
+ return new MaemoQtVersion(qmakeCommand, isAutoDetected, autoDetectionSource);
return 0;
}
diff --git a/src/plugins/madde/maemoqtversionfactory.h b/src/plugins/madde/maemoqtversionfactory.h
index 620aeabcbf..868446875d 100644
--- a/src/plugins/madde/maemoqtversionfactory.h
+++ b/src/plugins/madde/maemoqtversionfactory.h
@@ -48,7 +48,7 @@ public:
virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
virtual int priority() const;
- virtual QtSupport::BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
};
} // namespace Internal
diff --git a/src/plugins/madde/maemoremotemounter.cpp b/src/plugins/madde/maemoremotemounter.cpp
index 6144036243..21d78e850c 100644
--- a/src/plugins/madde/maemoremotemounter.cpp
+++ b/src/plugins/madde/maemoremotemounter.cpp
@@ -82,7 +82,7 @@ void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
const AbstractQt4MaemoTarget * const maemoTarget
= qobject_cast<AbstractQt4MaemoTarget *>(bc->target());
m_remoteMountsAllowed = maemoTarget && maemoTarget->allowsRemoteMounts();
- m_maddeRoot = qtVersion ? MaemoGlobal::maddeRoot(qtVersion->qmakeCommand()) : QString();
+ m_maddeRoot = qtVersion ? MaemoGlobal::maddeRoot(qtVersion->qmakeCommand().toString()) : QString();
}
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
diff --git a/src/plugins/madde/maemotoolchain.cpp b/src/plugins/madde/maemotoolchain.cpp
index 491497f436..aff7449fb4 100644
--- a/src/plugins/madde/maemotoolchain.cpp
+++ b/src/plugins/madde/maemotoolchain.cpp
@@ -83,9 +83,9 @@ ProjectExplorer::Abi MaemoToolChain::targetAbi() const
return m_targetAbi;
}
-QString MaemoToolChain::mkspec() const
+Utils::FileName MaemoToolChain::mkspec() const
{
- return QString(); // always use default
+ return Utils::FileName(); // always use default
}
bool MaemoToolChain::isValid() const
@@ -189,8 +189,8 @@ MaemoToolChainConfigWidget::MaemoToolChainConfigWidget(MaemoToolChain *tc) :
"<tr><td>Path to MADDE:</td><td>%1</td></tr>"
"<tr><td>Path to MADDE target:</td><td>%2</td></tr>"
"<tr><td>Debugger:</td/><td>%3</td></tr></body></html>")
- .arg(QDir::toNativeSeparators(MaemoGlobal::maddeRoot(v->qmakeCommand())),
- QDir::toNativeSeparators(MaemoGlobal::targetRoot(v->qmakeCommand())),
+ .arg(QDir::toNativeSeparators(MaemoGlobal::maddeRoot(v->qmakeCommand().toString())),
+ QDir::toNativeSeparators(MaemoGlobal::targetRoot(v->qmakeCommand().toString())),
QDir::toNativeSeparators(tc->debuggerCommand())));
layout->addWidget(label);
}
@@ -282,11 +282,11 @@ QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::createToolChainList(c
target = "Maemo 6";
else if (v->supportsTargetId(Constants::MEEGO_DEVICE_TARGET_ID))
target = "Meego";
- mTc->setDisplayName(tr("%1 GCC (%2)").arg(target).arg(MaemoGlobal::maddeRoot(mqv->qmakeCommand())));
- mTc->setCompilerPath(MaemoGlobal::targetRoot(mqv->qmakeCommand()) + QLatin1String("/bin/gcc"));
+ mTc->setDisplayName(tr("%1 GCC (%2)").arg(target).arg(MaemoGlobal::maddeRoot(mqv->qmakeCommand().toString())));
+ mTc->setCompilerPath(MaemoGlobal::targetRoot(mqv->qmakeCommand().toString()) + QLatin1String("/bin/gcc"));
mTc->setDebuggerCommand(ProjectExplorer::ToolChainManager::instance()->defaultDebugger(mqv->qtAbis().at(0)));
if (mTc->debuggerCommand().isEmpty())
- mTc->setDebuggerCommand(MaemoGlobal::targetRoot(mqv->qmakeCommand()) + QLatin1String("/bin/gdb"));
+ mTc->setDebuggerCommand(MaemoGlobal::targetRoot(mqv->qmakeCommand().toString()) + QLatin1String("/bin/gdb"));
result.append(mTc);
}
return result;
diff --git a/src/plugins/madde/maemotoolchain.h b/src/plugins/madde/maemotoolchain.h
index d066cf2362..c26caa6121 100644
--- a/src/plugins/madde/maemotoolchain.h
+++ b/src/plugins/madde/maemotoolchain.h
@@ -50,7 +50,7 @@ public:
QString typeName() const;
ProjectExplorer::Abi targetAbi() const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
bool isValid() const;
bool canClone() const;
diff --git a/src/plugins/madde/qt4maemotarget.cpp b/src/plugins/madde/qt4maemotarget.cpp
index 278f314193..e7072ece73 100644
--- a/src/plugins/madde/qt4maemotarget.cpp
+++ b/src/plugins/madde/qt4maemotarget.cpp
@@ -767,7 +767,7 @@ AbstractQt4MaemoTarget::ActionStatus AbstractDebBasedQt4MaemoTarget::createSpeci
raiseError(tr("Unable to create Debian templates: No Qt version set"));
return ActionFailed;
}
- if (!MaemoGlobal::callMad(dh_makeProc, dh_makeArgs, lqt->qmakeCommand(), true)
+ if (!MaemoGlobal::callMad(dh_makeProc, dh_makeArgs, lqt->qmakeCommand().toString(), true)
|| !dh_makeProc.waitForStarted()) {
raiseError(tr("Unable to create Debian templates: dh_make failed (%1)")
.arg(dh_makeProc.errorString()));
@@ -1005,7 +1005,7 @@ QString AbstractRpmBasedQt4MaemoTarget::packageFileName() const
return QString();
return packageName() + QLatin1Char('-') + projectVersion() + QLatin1Char('-')
+ QString::fromUtf8(getValueForTag(ReleaseTag, 0)) + QLatin1Char('.')
- + MaemoGlobal::architecture(lqt->qmakeCommand())
+ + MaemoGlobal::architecture(lqt->qmakeCommand().toString())
+ QLatin1String(".rpm");
}
diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
index 7740b638e3..8cb89f70d7 100644
--- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
+++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
@@ -323,14 +323,14 @@ QWidget *CustomExecutableRunConfiguration::createConfigurationWidget()
QString CustomExecutableRunConfiguration::dumperLibrary() const
{
- QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
+ Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath);
return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData);
}
QStringList CustomExecutableRunConfiguration::dumperLibraryLocations() const
{
- QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
+ Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath);
return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData);
}
diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp
index 24aeb95908..2cc25bd857 100644
--- a/src/plugins/projectexplorer/gcctoolchain.cpp
+++ b/src/plugins/projectexplorer/gcctoolchain.cpp
@@ -398,17 +398,17 @@ QString GccToolChain::debuggerCommand() const
return m_debuggerCommand;
}
-QString GccToolChain::mkspec() const
+Utils::FileName GccToolChain::mkspec() const
{
Abi abi = targetAbi();
if (abi.os() == Abi::MacOS) {
QString v = version();
// prefer versioned g++ on mac. This is required to enable building for older Mac OS versions
if (v.startsWith(QLatin1String("4.0")))
- return QLatin1String("macx-g++40");
+ return Utils::FileName::fromString("macx-g++40");
if (v.startsWith(QLatin1String("4.2")))
- return QLatin1String("macx-g++42");
- return QLatin1String("macx-g++");
+ return Utils::FileName::fromString("macx-g++42");
+ return Utils::FileName::fromString("macx-g++");
}
QList<Abi> gccAbiList = Abi::abisOfBinary(m_compilerPath);
@@ -420,18 +420,18 @@ QString GccToolChain::mkspec() const
|| gccAbi.os() != abi.os()
|| gccAbi.osFlavor() != abi.osFlavor())) {
// Note: This can fail:-(
- return QString(); // this is a cross-compiler, leave the mkspec alone!
+ return Utils::FileName(); // this is a cross-compiler, leave the mkspec alone!
}
if (abi.os() == Abi::LinuxOS) {
if (abi.osFlavor() != Abi::GenericLinuxFlavor)
- return QString(); // most likely not a desktop, so leave the mkspec alone.
+ return Utils::FileName(); // most likely not a desktop, so leave the mkspec alone.
if (abi.wordWidth() == gccAbi.wordWidth())
- return QLatin1String("linux-g++"); // no need to explicitly set the word width
- return QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth());
+ return Utils::FileName::fromString("linux-g++"); // no need to explicitly set the word width
+ return Utils::FileName::fromString("linux-g++-" + QString::number(m_targetAbi.wordWidth()));
}
if (abi.os() == Abi::BsdOS && abi.osFlavor() == Abi::FreeBsdFlavor)
- return QLatin1String("freebsd-g++");
- return QString();
+ return Utils::FileName::fromString("freebsd-g++");
+ return Utils::FileName();
}
QString GccToolChain::makeCommand() const
@@ -781,14 +781,14 @@ QString ClangToolChain::makeCommand() const
#endif
}
-QString ClangToolChain::mkspec() const
+Utils::FileName ClangToolChain::mkspec() const
{
Abi abi = targetAbi();
if (abi.os() == Abi::MacOS)
- return QLatin1String("unsupported/macx-clang");
+ return Utils::FileName::fromString("unsupported/macx-clang");
else if (abi.os() == Abi::LinuxOS)
- return QLatin1String("unsupported/linux-clang");
- return QString(); // Note: Not supported by Qt yet, so default to the mkspec the Qt was build with
+ return Utils::FileName::fromString("unsupported/linux-clang");
+ return Utils::FileName(); // Note: Not supported by Qt yet, so default to the mkspec the Qt was build with
}
IOutputParser *ClangToolChain::outputParser() const
@@ -864,9 +864,9 @@ QString MingwToolChain::typeName() const
return Internal::MingwToolChainFactory::tr("MinGW");
}
-QString MingwToolChain::mkspec() const
+Utils::FileName MingwToolChain::mkspec() const
{
- return QLatin1String("win32-g++");
+ return Utils::FileName::fromString("win32-g++");
}
QString MingwToolChain::makeCommand() const
@@ -958,9 +958,9 @@ IOutputParser *LinuxIccToolChain::outputParser() const
return new LinuxIccParser;
}
-QString LinuxIccToolChain::mkspec() const
+Utils::FileName LinuxIccToolChain::mkspec() const
{
- return QLatin1String("linux-icc-") + QString::number(targetAbi().wordWidth());
+ return Utils::FileName::fromString("linux-icc-" + QString::number(targetAbi().wordWidth()));
}
ToolChain *LinuxIccToolChain::clone() const
diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h
index e5d4eefbca..8ab8111e5c 100644
--- a/src/plugins/projectexplorer/gcctoolchain.h
+++ b/src/plugins/projectexplorer/gcctoolchain.h
@@ -65,7 +65,7 @@ public:
QByteArray predefinedMacros() const;
QList<HeaderPath> systemHeaderPaths() const;
void addToEnvironment(Utils::Environment &env) const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
QString makeCommand() const;
void setDebuggerCommand(const QString &);
QString debuggerCommand() const;
@@ -122,7 +122,7 @@ class PROJECTEXPLORER_EXPORT ClangToolChain : public GccToolChain
public:
QString typeName() const;
QString makeCommand() const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
IOutputParser *outputParser() const;
@@ -143,7 +143,7 @@ class PROJECTEXPLORER_EXPORT MingwToolChain : public GccToolChain
{
public:
QString typeName() const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
QString makeCommand() const;
ToolChain *clone() const;
@@ -167,7 +167,7 @@ public:
IOutputParser *outputParser() const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
ToolChain *clone() const;
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp
index d7577b6a06..d8eb176ffd 100644
--- a/src/plugins/projectexplorer/msvctoolchain.cpp
+++ b/src/plugins/projectexplorer/msvctoolchain.cpp
@@ -324,15 +324,15 @@ QString MsvcToolChain::typeName() const
return MsvcToolChainFactory::tr("MSVC");
}
-QString MsvcToolChain::mkspec() const
+Utils::FileName MsvcToolChain::mkspec() const
{
if (m_abi.osFlavor() == Abi::WindowsMsvc2005Flavor)
- return QLatin1String("win32-msvc2005");
+ return Utils::FileName::fromString(QLatin1String("win32-msvc2005"));
if (m_abi.osFlavor() == Abi::WindowsMsvc2008Flavor)
- return QLatin1String("win32-msvc2008");
+ return Utils::FileName::fromString(QLatin1String("win32-msvc2008"));
if (m_abi.osFlavor() == Abi::WindowsMsvc2010Flavor)
- return QLatin1String("win32-msvc2010");
- return QString();
+ return Utils::FileName::fromString(QLatin1String("win32-msvc2010"));
+ return Utils::FileName();
}
QVariantMap MsvcToolChain::toMap() const
diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h
index fde8e1bb46..7fe4f01d2e 100644
--- a/src/plugins/projectexplorer/msvctoolchain.h
+++ b/src/plugins/projectexplorer/msvctoolchain.h
@@ -60,8 +60,7 @@ public:
static MsvcToolChain *readFromMap(const QVariantMap &data);
QString typeName() const;
-
- QString mkspec() const;
+ Utils::FileName mkspec() const;
QVariantMap toMap() const;
bool fromMap(const QVariantMap &data);
diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h
index f325ff6bd8..e9c5786e3a 100644
--- a/src/plugins/projectexplorer/toolchain.h
+++ b/src/plugins/projectexplorer/toolchain.h
@@ -36,6 +36,8 @@
#include "projectexplorer_export.h"
#include "headerpath.h"
+#include <utils/fileutils.h>
+
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QVariantMap>
@@ -83,7 +85,7 @@ public:
virtual void addToEnvironment(Utils::Environment &env) const = 0;
virtual QString makeCommand() const = 0;
- virtual QString mkspec() const = 0;
+ virtual Utils::FileName mkspec() const = 0;
virtual QString debuggerCommand() const = 0;
virtual QString defaultMakeTarget() const;
diff --git a/src/plugins/projectexplorer/wincetoolchain.cpp b/src/plugins/projectexplorer/wincetoolchain.cpp
index 9e42b4aeaa..6210a2f352 100644
--- a/src/plugins/projectexplorer/wincetoolchain.cpp
+++ b/src/plugins/projectexplorer/wincetoolchain.cpp
@@ -300,7 +300,7 @@ QString WinCEToolChain::typeName() const
return WinCEToolChainFactory::tr("WinCE");
}
-QString WinCEToolChain::mkspec() const
+Utils::FileName WinCEToolChain::mkspec() const
{
const QChar specSeperator('-');
@@ -312,7 +312,7 @@ QString WinCEToolChain::mkspec() const
specString += specSeperator;
specString += m_msvcVer;
- return specString;
+ return Utils::FileName::fromString(specString);
}
diff --git a/src/plugins/projectexplorer/wincetoolchain.h b/src/plugins/projectexplorer/wincetoolchain.h
index 431cfd3012..8a7097c2cf 100644
--- a/src/plugins/projectexplorer/wincetoolchain.h
+++ b/src/plugins/projectexplorer/wincetoolchain.h
@@ -61,7 +61,7 @@ public:
QString typeName() const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
QString ceVer() const;
diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp
index 34ad5319f4..f74bc02830 100644
--- a/src/plugins/qt4projectmanager/qmakestep.cpp
+++ b/src/plugins/qt4projectmanager/qmakestep.cpp
@@ -145,9 +145,9 @@ QString QMakeStep::allArguments(bool shorted)
}
}
}
- QString specArg = mkspec();
+ Utils::FileName specArg = mkspec();
if (!userProvidedMkspec && !specArg.isEmpty())
- arguments << "-spec" << specArg;
+ arguments << "-spec" << specArg.toUserOutput();
// Find out what flags we pass on to qmake
arguments << bc->configCommandLineArguments();
@@ -235,7 +235,7 @@ bool QMakeStep::init()
else
workingDirectory = qt4bc->buildDirectory();
- QString program = qtVersion->qmakeCommand();
+ Utils::FileName program = qtVersion->qmakeCommand();
QString makefile = workingDirectory;
@@ -255,7 +255,7 @@ bool QMakeStep::init()
// Check whether we need to run qmake
bool makefileOutDated = true;
if (QFileInfo(makefile).exists()) {
- QString qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
+ Utils::FileName qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
if (qtVersion->qmakeCommand() == qmakePath) {
makefileOutDated = !qt4bc->compareToImportFrom(makefile);
}
@@ -269,7 +269,7 @@ bool QMakeStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(qt4bc->macroExpander());
pp->setWorkingDirectory(workingDirectory);
- pp->setCommand(program);
+ pp->setCommand(program.toString());
pp->setArguments(args);
pp->setEnvironment(qt4bc->environment());
@@ -445,14 +445,14 @@ QString QMakeStep::userArguments()
return m_userArgs;
}
-QString QMakeStep::mkspec()
+Utils::FileName QMakeStep::mkspec()
{
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
QString additionalArguments = m_userArgs;
for (Utils::QtcProcess::ArgIterator ait(&additionalArguments); ait.next(); ) {
if (ait.value() == QLatin1String("-spec")) {
if (ait.next())
- return ait.value();
+ return Utils::FileName::fromUserInput(ait.value());
}
}
@@ -523,8 +523,8 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, SLOT(qtVersionChanged()));
connect(step->qt4BuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(qmakeBuildConfigChanged()));
- connect(QtSupport::QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(QString)),
- this, SLOT(qtVersionsDumpUpdated(QString)));
+ connect(QtSupport::QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(Utils::FileName)),
+ this, SLOT(qtVersionsDumpUpdated(Utils::FileName)));
}
QMakeStepConfigWidget::~QMakeStepConfigWidget()
@@ -554,7 +554,7 @@ void QMakeStepConfigWidget::qtVersionChanged()
updateQmlDebuggingOption();
}
-void QMakeStepConfigWidget::qtVersionsDumpUpdated(const QString &qmakeCommand)
+void QMakeStepConfigWidget::qtVersionsDumpUpdated(const Utils::FileName &qmakeCommand)
{
QtSupport::BaseQtVersion *version = m_step->qt4BuildConfiguration()->qtVersion();
if (version && version->qmakeCommand() == qmakeCommand)
@@ -675,16 +675,16 @@ void QMakeStepConfigWidget::updateSummaryLabel()
// We don't want the full path to the .pro file
QString args = m_step->allArguments(true);
// And we only use the .pro filename not the full path
- QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
+ QString program = qtVersion->qmakeCommand().toFileInfo().fileName();
setSummaryText(tr("<b>qmake:</b> %1 %2").arg(program, args));
ToolChain *tc = qt4bc->toolChain();
if (!tc)
return;
- QString tcSpec = tc->mkspec();
+ Utils::FileName tcSpec = tc->mkspec();
if (!tcSpec.isEmpty() && tcSpec != m_step->mkspec())
- setAdditionalSummaryText(tr("<b>Warning:</b> The tool chain suggested \"%1\" as mkspec.").arg(tcSpec));
+ setAdditionalSummaryText(tr("<b>Warning:</b> The tool chain suggested \"%1\" as mkspec.").arg(tcSpec.toUserOutput()));
else
setAdditionalSummaryText(QString());
}
@@ -711,7 +711,7 @@ void QMakeStepConfigWidget::updateEffectiveQMakeCall()
QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion();
QString program = tr("<No Qt version>");
if (qtVersion)
- program = QFileInfo(qtVersion->qmakeCommand()).fileName();
+ program = qtVersion->qmakeCommand().toFileInfo().fileName();
m_ui->qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + m_step->allArguments());
}
diff --git a/src/plugins/qt4projectmanager/qmakestep.h b/src/plugins/qt4projectmanager/qmakestep.h
index 131d2d3ece..719f3fcf80 100644
--- a/src/plugins/qt4projectmanager/qmakestep.h
+++ b/src/plugins/qt4projectmanager/qmakestep.h
@@ -34,6 +34,7 @@
#define QMAKESTEP_H
#include "qt4projectmanager_global.h"
+#include <utils/fileutils.h>
#include <projectexplorer/abstractprocessstep.h>
#include <QtCore/QStringList>
@@ -101,7 +102,7 @@ public:
QStringList moreArgumentsAfter();
QStringList parserArguments();
QString userArguments();
- QString mkspec();
+ Utils::FileName mkspec();
void setUserArguments(const QString &arguments);
bool linkQmlDebuggingLibrary() const;
void setLinkQmlDebuggingLibrary(bool enable);
@@ -146,7 +147,7 @@ public:
private slots:
// slots for handling buildconfiguration/step signals
void qtVersionChanged();
- void qtVersionsDumpUpdated(const QString &qmakeCommand);
+ void qtVersionsDumpUpdated(const Utils::FileName &qmakeCommand);
void qmakeBuildConfigChanged();
void userArgumentsChanged();
void linkQmlDebuggingLibraryChanged();
diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
index b17b17d74f..23518b1486 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
+++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
@@ -49,7 +49,7 @@ DesktopQtVersion::DesktopQtVersion()
}
-DesktopQtVersion::DesktopQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
+DesktopQtVersion::DesktopQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
: BaseQtVersion(path, isAutodetected, autodetectionSource)
{
diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h
index 221fc6d74b..3031f286a4 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h
+++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.h
@@ -43,7 +43,7 @@ class DesktopQtVersion : public QtSupport::BaseQtVersion
{
public:
DesktopQtVersion();
- DesktopQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
+ DesktopQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
~DesktopQtVersion();
DesktopQtVersion *clone() const;
diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp
index b608f9798e..0b886144a5 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp
+++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.cpp
@@ -73,11 +73,11 @@ int DesktopQtVersionFactory::priority() const
return 0;
}
-QtSupport::BaseQtVersion *DesktopQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
+QtSupport::BaseQtVersion *DesktopQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
Q_UNUSED(evaluator);
// we are the fallback :) so we don't care what kind of qt it is
- QFileInfo fi(qmakePath);
+ QFileInfo fi = qmakePath.toFileInfo();
if (fi.exists() && fi.isExecutable() && fi.isFile())
return new DesktopQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
return 0;
diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.h b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.h
index 19faddd1f6..f4881b7e12 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.h
+++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversionfactory.h
@@ -48,7 +48,7 @@ public:
virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
virtual int priority() const;
- virtual QtSupport::BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
};
} // Internal
diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp
index 63f4b5e134..b6e5b44089 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp
+++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp
@@ -49,7 +49,7 @@ SimulatorQtVersion::SimulatorQtVersion()
}
-SimulatorQtVersion::SimulatorQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
+SimulatorQtVersion::SimulatorQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource)
{
diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h
index caa6b5a3c1..1645345962 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h
+++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.h
@@ -43,7 +43,7 @@ class SimulatorQtVersion : public QtSupport::BaseQtVersion
{
public:
SimulatorQtVersion();
- SimulatorQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
+ SimulatorQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
~SimulatorQtVersion();
SimulatorQtVersion *clone() const;
diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.cpp
index 8e44cdcc69..6771cdee72 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.cpp
+++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.cpp
@@ -73,9 +73,9 @@ int SimulatorQtVersionFactory::priority() const
return 50;
}
-QtSupport::BaseQtVersion *SimulatorQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
+QtSupport::BaseQtVersion *SimulatorQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
- QFileInfo fi(qmakePath);
+ QFileInfo fi = qmakePath.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0;
QStringList configValues = evaluator->values("CONFIG");
diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.h b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.h
index a5717ef3a1..d9c0f50782 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.h
+++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversionfactory.h
@@ -48,7 +48,7 @@ public:
virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
virtual int priority() const;
- virtual QtSupport::BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
};
} // Internal
diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp
index 3775a74ada..f7dc6d3adb 100644
--- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp
@@ -128,9 +128,9 @@ QString GcceToolChain::makeCommand() const
#endif
}
-QString GcceToolChain::mkspec() const
+Utils::FileName GcceToolChain::mkspec() const
{
- return QString(); // always use default from Qt version
+ return Utils::FileName(); // always use default from Qt version
}
QString GcceToolChain::defaultMakeTarget() const
diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h
index 4b3c0b6e73..9ffdc5b436 100644
--- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h
+++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h
@@ -50,7 +50,7 @@ public:
QByteArray predefinedMacros() const;
void addToEnvironment(Utils::Environment &env) const;
QString makeCommand() const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
QString defaultMakeTarget() const;
void setCompilerPath(const QString &);
diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp
index 70dd0e7de3..9ea44df2a9 100644
--- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp
@@ -225,9 +225,9 @@ void RvctToolChain::addToEnvironment(Utils::Environment &env) const
env.set(QLatin1String("LANG"), QString(QLatin1Char('C')));
}
-QString RvctToolChain::mkspec() const
+Utils::FileName RvctToolChain::mkspec() const
{
- return QString(); // Always use default from Qt version
+ return Utils::FileName(); // Always use default from Qt version
}
QString RvctToolChain::makeCommand() const
diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h
index 5b89278880..e6105e9257 100644
--- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h
+++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h
@@ -89,7 +89,7 @@ public:
QByteArray predefinedMacros() const;
QList<ProjectExplorer::HeaderPath> systemHeaderPaths() const;
void addToEnvironment(Utils::Environment &env) const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
QString makeCommand() const;
QString defaultMakeTarget() const;
ProjectExplorer::IOutputParser *outputParser() const;
diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp
index c93c3e50ee..64393852e0 100644
--- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp
@@ -59,7 +59,7 @@ SymbianQtVersion::SymbianQtVersion()
{
}
-SymbianQtVersion::SymbianQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
+SymbianQtVersion::SymbianQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
: BaseQtVersion(path, isAutodetected, autodetectionSource),
m_validSystemRoot(false)
{
diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h
index d690d313d2..c405d3845d 100644
--- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h
+++ b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h
@@ -42,7 +42,7 @@ class SymbianQtVersion : public QtSupport::BaseQtVersion
{
public:
SymbianQtVersion();
- SymbianQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
+ SymbianQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
SymbianQtVersion *clone() const;
~SymbianQtVersion();
diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp
index 167d60ec85..dc80380ee5 100644
--- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp
@@ -73,9 +73,9 @@ int SymbianQtVersionFactory::priority() const
return 50;
}
-QtSupport::BaseQtVersion *SymbianQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
+QtSupport::BaseQtVersion *SymbianQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
- QFileInfo fi(qmakePath);
+ QFileInfo fi = qmakePath.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0;
diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h b/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h
index d45b9e7b5d..62b459fced 100644
--- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h
+++ b/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h
@@ -48,7 +48,7 @@ public:
virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
virtual int priority() const;
- virtual QtSupport::BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
};
} // Internal
diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp
index 1f4b64610a..c317fcc92d 100644
--- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp
@@ -183,9 +183,9 @@ void WinscwToolChain::addToEnvironment(Utils::Environment &env) const
}
-QString WinscwToolChain::mkspec() const
+Utils::FileName WinscwToolChain::mkspec() const
{
- return QString(); // Always use default from Qt version
+ return Utils::FileName(); // Always use default from Qt version
}
QString WinscwToolChain::makeCommand() const
diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h
index 83770ef97a..6003e96bbe 100644
--- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h
+++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h
@@ -60,7 +60,7 @@ public:
QByteArray predefinedMacros() const;
QList<ProjectExplorer::HeaderPath> systemHeaderPaths() const;
void addToEnvironment(Utils::Environment &env) const;
- QString mkspec() const;
+ Utils::FileName mkspec() const;
QString makeCommand() const;
virtual QString debuggerCommand() const;
QString defaultMakeTarget() const;
diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
index 3aa0ce69a4..f4699251d2 100644
--- a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
@@ -123,7 +123,7 @@ static inline QString msgBuildConfigNotApplicable(const QString &d, const QtSupp
const Target *target)
{
return QString::fromLatin1("Warning: Buildconfiguration '%1' : Qt '%2' from %3 not supported by target '%4'").
- arg(d, qtVersion->displayName(), qtVersion->qmakeCommand(), target->id());
+ arg(d, qtVersion->displayName(), qtVersion->qmakeCommand().toUserOutput(), target->id());
}
bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
@@ -171,7 +171,7 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
if (!toolChain()) {
if (version && version->isValid()) {
qWarning("Warning: No tool chain available for '%s' from %s used in '%s'.",
- qPrintable(version->displayName()), qPrintable(version->qmakeCommand()),
+ qPrintable(version->displayName()), qPrintable(version->qmakeCommand().toUserOutput()),
qPrintable(target()->id()));
} else {
qWarning("Warning: No tool chain available for invalid Qt version used in '%s'.",
@@ -475,7 +475,7 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
{
QMakeStep *qs = qmakeStep();
if (QFileInfo(makefile).exists() && qs) {
- QString qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
+ Utils::FileName qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
QtSupport::BaseQtVersion *version = qtVersion();
if (!version)
return false;
@@ -495,17 +495,17 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
// are not interested in), splitting them up into individual strings:
extractSpecFromArguments(&userArgs, workingDirectory, version, &actualArgs),
actualArgs = qs->moreArguments() + actualArgs + qs->moreArgumentsAfter();
- QString actualSpec = qs->mkspec();
+ Utils::FileName actualSpec = qs->mkspec();
QString qmakeArgs = result.second;
QStringList parsedArgs;
- QString parsedSpec = extractSpecFromArguments(&qmakeArgs, workingDirectory, version, &parsedArgs);
+ Utils::FileName parsedSpec = extractSpecFromArguments(&qmakeArgs, workingDirectory, version, &parsedArgs);
if (debug) {
qDebug()<<"Actual args:"<<actualArgs;
qDebug()<<"Parsed args:"<<parsedArgs;
- qDebug()<<"Actual spec:"<<actualSpec;
- qDebug()<<"Parsed spec:"<<parsedSpec;
+ qDebug()<<"Actual spec:"<<actualSpec.toString();
+ qDebug()<<"Parsed spec:"<<parsedSpec.toString();
}
// Comparing the sorted list is obviously wrong
@@ -530,15 +530,15 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
return true;
// Actual spec is the default one
// qDebug()<<"AS vs VS"<<actualSpec<<version->mkspec();
- if ((actualSpec == version->mkspec() || actualSpec == "default")
- && (parsedSpec == version->mkspec() || parsedSpec == "default" || parsedSpec.isEmpty()))
+ if ((actualSpec == version->mkspec() || actualSpec == Utils::FileName::fromString(QLatin1String("default")))
+ && (parsedSpec == version->mkspec() || parsedSpec == Utils::FileName::fromString(QLatin1String("default")) || parsedSpec.isEmpty()))
return true;
}
} else if (debug) {
qDebug()<<"different qmake buildconfigurations buildconfiguration:"<<qmakeBuildConfiguration()<<" Makefile:"<<result.first;
}
} else if (debug) {
- qDebug()<<"diffrent qt versions, buildconfiguration:"<<version->qmakeCommand()<<" Makefile:"<<qmakePath;
+ qDebug()<<"diffrent qt versions, buildconfiguration:"<<version->qmakeCommand().toString()<<" Makefile:"<<qmakePath.toString();
}
}
return false;
@@ -558,11 +558,11 @@ bool Qt4BuildConfiguration::removeQMLInspectorFromArguments(QString *args)
return removedArgument;
}
-QString Qt4BuildConfiguration::extractSpecFromArguments(QString *args,
- const QString &directory, const QtSupport::BaseQtVersion *version,
- QStringList *outArgs)
+Utils::FileName Qt4BuildConfiguration::extractSpecFromArguments(QString *args,
+ const QString &directory, const QtSupport::BaseQtVersion *version,
+ QStringList *outArgs)
{
- QString parsedSpec;
+ Utils::FileName parsedSpec;
bool ignoreNext = false;
bool nextIsSpec = false;
@@ -572,7 +572,7 @@ QString Qt4BuildConfiguration::extractSpecFromArguments(QString *args,
ait.deleteArg();
} else if (nextIsSpec) {
nextIsSpec = false;
- parsedSpec = QDir::cleanPath(ait.value());
+ parsedSpec = Utils::FileName::fromUserInput(ait.value());
ait.deleteArg();
} else if (ait.value() == QLatin1String("-spec") || ait.value() == QLatin1String("-platform")) {
nextIsSpec = true;
@@ -592,49 +592,39 @@ QString Qt4BuildConfiguration::extractSpecFromArguments(QString *args,
}
if (parsedSpec.isEmpty())
- return QString();
+ return Utils::FileName();
- QString baseMkspecDir = version->versionInfo().value("QMAKE_MKSPECS");
+ Utils::FileName baseMkspecDir = Utils::FileName::fromUserInput(version->versionInfo().value("QMAKE_MKSPECS"));
if (baseMkspecDir.isEmpty())
- baseMkspecDir = version->versionInfo().value("QT_INSTALL_DATA") + "/mkspecs";
+ baseMkspecDir = Utils::FileName::fromUserInput(version->versionInfo().value("QT_INSTALL_DATA") + "/mkspecs");
-#ifdef Q_OS_WIN
- baseMkspecDir = baseMkspecDir.toLower();
- parsedSpec = parsedSpec.toLower();
-#endif
// if the path is relative it can be
// relative to the working directory (as found in the Makefiles)
// or relatively to the mkspec directory
// if it is the former we need to get the canonical form
// for the other one we don't need to do anything
- if (QFileInfo(parsedSpec).isRelative()) {
- if(QFileInfo(directory + QLatin1Char('/') + parsedSpec).exists()) {
- parsedSpec = QDir::cleanPath(directory + QLatin1Char('/') + parsedSpec);
-#ifdef Q_OS_WIN
- parsedSpec = parsedSpec.toLower();
-#endif
+ if (parsedSpec.toFileInfo().isRelative()) {
+ if (QFileInfo(directory + QLatin1Char('/') + parsedSpec.toString()).exists()) {
+ parsedSpec = Utils::FileName::fromUserInput(directory + QLatin1Char('/') + parsedSpec.toString());
} else {
- parsedSpec = baseMkspecDir + QLatin1Char('/') + parsedSpec;
+ parsedSpec = Utils::FileName::fromUserInput(baseMkspecDir.toString() + QLatin1Char('/') + parsedSpec.toString());
}
}
- QFileInfo f2(parsedSpec);
+ QFileInfo f2 = parsedSpec.toFileInfo();
while (f2.isSymLink()) {
- parsedSpec = f2.symLinkTarget();
- f2.setFile(parsedSpec);
+ parsedSpec = Utils::FileName::fromString(f2.symLinkTarget());
+ f2.setFile(parsedSpec.toString());
}
- if (parsedSpec.startsWith(baseMkspecDir)) {
- parsedSpec = parsedSpec.mid(baseMkspecDir.length() + 1);
+ if (parsedSpec.isChildOf(baseMkspecDir)) {
+ parsedSpec = parsedSpec.relativeChildPath(baseMkspecDir);
} else {
- QString sourceMkSpecPath = version->sourcePath() + "/mkspecs";
- if (parsedSpec.startsWith(sourceMkSpecPath)) {
- parsedSpec = parsedSpec.mid(sourceMkSpecPath.length() + 1);
+ Utils::FileName sourceMkSpecPath = Utils::FileName::fromString(version->sourcePath().toString() + "/mkspecs");
+ if (parsedSpec.isChildOf(sourceMkSpecPath)) {
+ parsedSpec = parsedSpec.relativeChildPath(sourceMkSpecPath);
}
}
-#ifdef Q_OS_WIN
- parsedSpec = parsedSpec.toLower();
-#endif
return parsedSpec;
}
@@ -837,7 +827,7 @@ void Qt4BuildConfiguration::importFromBuildDirectory()
else
mkfile.append(makefile());
- QString qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(mkfile);
+ Utils::FileName qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(mkfile);
if (!qmakePath.isEmpty()) {
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
QtSupport::BaseQtVersion *version = vm->qtVersionForQMakeBinary(qmakePath);
@@ -851,7 +841,7 @@ void Qt4BuildConfiguration::importFromBuildDirectory()
QtSupport::BaseQtVersion::QmakeBuildConfigs qmakeBuildConfig = result.first;
QString additionalArguments = result.second;
- QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, directory, version);
+ Utils::FileName parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, directory, version);
const bool enableQmlDebugger =
Qt4BuildConfiguration::removeQMLInspectorFromArguments(&additionalArguments);
@@ -861,8 +851,8 @@ void Qt4BuildConfiguration::importFromBuildDirectory()
QMakeStep *qs = qmakeStep();
qs->setUserArguments(additionalArguments);
qs->setLinkQmlDebuggingLibrary(enableQmlDebugger);
- if (!parsedSpec.isEmpty() && parsedSpec != QLatin1String("default") && qs->mkspec() != parsedSpec) {
- Utils::QtcProcess::addArgs(&additionalArguments, (QStringList() << "-spec" << parsedSpec));
+ if (!parsedSpec.isEmpty() && parsedSpec != Utils::FileName::fromString(QLatin1String("default")) && qs->mkspec() != parsedSpec) {
+ Utils::QtcProcess::addArgs(&additionalArguments, (QStringList() << QLatin1String("-spec") << parsedSpec.toUserOutput()));
qs->setUserArguments(additionalArguments);
}
diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.h b/src/plugins/qt4projectmanager/qt4buildconfiguration.h
index 1bb12488c7..7631325c10 100644
--- a/src/plugins/qt4projectmanager/qt4buildconfiguration.h
+++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.h
@@ -108,7 +108,7 @@ public:
bool compareToImportFrom(const QString &makefile);
static bool removeQMLInspectorFromArguments(QString *args);
- static QString extractSpecFromArguments(QString *arguments,
+ static Utils::FileName extractSpecFromArguments(QString *arguments,
const QString &directory, const QtSupport::BaseQtVersion *version,
QStringList *outArgs = 0);
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index a99037840b..3959f77e2f 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -559,7 +559,7 @@ void Qt4Project::updateCppCodeModel()
if (rootQt4ProjectNode())
allIncludePaths.append(rootQt4ProjectNode()->resolvedMkspecPath());
else if (activeBC->qtVersion())
- allIncludePaths.append(activeBC->qtVersion()->mkspecPath());
+ allIncludePaths.append(activeBC->qtVersion()->mkspecPath().toString());
allIncludePaths.append(predefinedIncludePaths);
@@ -966,7 +966,7 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
QStringList args;
if (QMakeStep *qs = bc->qmakeStep()) {
args = qs->parserArguments();
- m_proFileOption->qmakespec = qs->mkspec();
+ m_proFileOption->qmakespec = qs->mkspec().toString();
} else {
args = bc->configCommandLineArguments();
}
diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
index 9dafa8fe90..68be86bb38 100644
--- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
+++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
@@ -357,7 +357,7 @@ void Qt4ProjectConfigWidget::updateImportLabel()
else
makefile.append(m_buildConfiguration->makefile());
- QString qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
+ Utils::FileName qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
QtSupport::BaseQtVersion *version = m_buildConfiguration->qtVersion();
// check that there's a makefile
if (!qmakePath.isEmpty()) {
@@ -367,7 +367,7 @@ void Qt4ProjectConfigWidget::updateImportLabel()
if (mc == QtSupport::QtVersionManager::DifferentProject) {
incompatibleBuild = true;
} else if (mc == QtSupport::QtVersionManager::SameProject) {
- if (qmakePath != (version ? version->qmakeCommand() : QString())) {
+ if (qmakePath != (version ? version->qmakeCommand() : Utils::FileName())) {
// and that the qmake path is different from the current version
// import enable
visible = true;
diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp
index b903efe0b8..54ce902480 100644
--- a/src/plugins/qt4projectmanager/qt4target.cpp
+++ b/src/plugins/qt4projectmanager/qt4target.cpp
@@ -303,21 +303,21 @@ ProjectExplorer::ToolChain *Qt4BaseTarget::preferredToolChain(ProjectExplorer::B
return Target::preferredToolChain(bc);
QList<ProjectExplorer::ToolChain *> tcs = possibleToolChains(bc);
- const QString mkspec = qtBc->qtVersion()->mkspec();
+ const Utils::FileName mkspec = qtBc->qtVersion()->mkspec();
foreach (ProjectExplorer::ToolChain *tc, tcs)
if (tc->mkspec() == mkspec)
return tc;
return tcs.isEmpty() ? 0 : tcs.at(0);
}
-QString Qt4BaseTarget::mkspec(const Qt4BuildConfiguration *bc) const
+Utils::FileName Qt4BaseTarget::mkspec(const Qt4BuildConfiguration *bc) const
{
QtSupport::BaseQtVersion *version = bc->qtVersion();
// We do not know which abi the Qt version has, so let's stick with the defaults
if (version && version->qtAbis().count() == 1 && version->qtAbis().first().isNull())
- return QString();
+ return Utils::FileName();
- const QString tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : QString();
+ const Utils::FileName tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : Utils::FileName();
if (!version)
return tcSpec;
if (!tcSpec.isEmpty() && version->hasMkspec(tcSpec))
@@ -1185,7 +1185,7 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::checkForBuild(const QStrin
QList<BuildConfigurationInfo> infos;
foreach (const QString &file, makefiles) {
QString makefile = directory + '/' + file;
- QString qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
+ Utils::FileName qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
if (qmakeBinary.isEmpty())
continue;
if (QtSupport::QtVersionManager::makefileIsFor(makefile, proFilePath) != QtSupport::QtVersionManager::SameProject)
@@ -1204,15 +1204,15 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::checkForBuild(const QStrin
QtSupport::QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
QString additionalArguments = makefileBuildConfig.second;
- QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, directory, version);
- QString versionSpec = version->mkspec();
+ Utils::FileName parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, directory, version);
+ Utils::FileName versionSpec = version->mkspec();
QString specArgument;
// Compare mkspecs and add to additional arguments
- if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == "default") {
+ if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == Utils::FileName::fromString("default")) {
// using the default spec, don't modify additional arguments
} else {
- specArgument = "-spec " + Utils::QtcProcess::quoteArg(parsedSpec);
+ specArgument = "-spec " + Utils::QtcProcess::quoteArg(parsedSpec.toUserOutput());
}
Utils::QtcProcess::addArgs(&specArgument, additionalArguments);
diff --git a/src/plugins/qt4projectmanager/qt4target.h b/src/plugins/qt4projectmanager/qt4target.h
index daab9ad976..64f2c604a9 100644
--- a/src/plugins/qt4projectmanager/qt4target.h
+++ b/src/plugins/qt4projectmanager/qt4target.h
@@ -92,7 +92,7 @@ public:
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
ProjectExplorer::ToolChain *preferredToolChain(ProjectExplorer::BuildConfiguration *) const;
- virtual QString mkspec(const Qt4BuildConfiguration *bc) const;
+ virtual Utils::FileName mkspec(const Qt4BuildConfiguration *bc) const;
signals:
void buildDirectoryInitialized();
diff --git a/src/plugins/qt4projectmanager/winceqtversion.cpp b/src/plugins/qt4projectmanager/winceqtversion.cpp
index c86852f182..a18635f6be 100644
--- a/src/plugins/qt4projectmanager/winceqtversion.cpp
+++ b/src/plugins/qt4projectmanager/winceqtversion.cpp
@@ -44,7 +44,7 @@ WinCeQtVersion::WinCeQtVersion()
{
}
-WinCeQtVersion::WinCeQtVersion(const QString &path, const QString &archType,
+WinCeQtVersion::WinCeQtVersion(const Utils::FileName &path, const QString &archType,
bool isAutodetected, const QString &autodetectionSource)
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource),
m_archType(ProjectExplorer::Abi::ArmArchitecture)
@@ -104,7 +104,7 @@ void WinCeQtVersion::fromMap(const QVariantMap &map)
// named <Description>-<Architecture>-<Compiler> with no other '-' characters.
m_archType = ProjectExplorer::Abi::ArmArchitecture;
- const QStringList splitSpec = mkspec().split("-");
+ const QStringList splitSpec = mkspec().toString().split("-");
if (splitSpec.length() == 3) {
const QString archString = splitSpec.value(1);
if (archString.contains("x86", Qt::CaseInsensitive))
diff --git a/src/plugins/qt4projectmanager/winceqtversion.h b/src/plugins/qt4projectmanager/winceqtversion.h
index 60f37ff39a..2b15528602 100644
--- a/src/plugins/qt4projectmanager/winceqtversion.h
+++ b/src/plugins/qt4projectmanager/winceqtversion.h
@@ -42,7 +42,7 @@ class WinCeQtVersion : public QtSupport::BaseQtVersion
{
public:
WinCeQtVersion();
- WinCeQtVersion(const QString &path, const QString &archType,
+ WinCeQtVersion(const Utils::FileName &path, const QString &archType,
bool isAutodetected = false, const QString &autodetectionSource = QString());
~WinCeQtVersion();
WinCeQtVersion *clone() const;
diff --git a/src/plugins/qt4projectmanager/winceqtversionfactory.cpp b/src/plugins/qt4projectmanager/winceqtversionfactory.cpp
index 26a42fd549..e7fe956f15 100644
--- a/src/plugins/qt4projectmanager/winceqtversionfactory.cpp
+++ b/src/plugins/qt4projectmanager/winceqtversionfactory.cpp
@@ -69,9 +69,9 @@ int WinCeQtVersionFactory::priority() const
return 50;
}
-QtSupport::BaseQtVersion *WinCeQtVersionFactory::create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
+QtSupport::BaseQtVersion *WinCeQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
- QFileInfo fi(qmakePath);
+ QFileInfo fi = qmakePath.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0;
diff --git a/src/plugins/qt4projectmanager/winceqtversionfactory.h b/src/plugins/qt4projectmanager/winceqtversionfactory.h
index f0a9ac3253..f290704dbb 100644
--- a/src/plugins/qt4projectmanager/winceqtversionfactory.h
+++ b/src/plugins/qt4projectmanager/winceqtversionfactory.h
@@ -49,8 +49,9 @@ public:
virtual int priority() const;
- virtual QtSupport::BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator,
- bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
+ bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+
};
} // Internal
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index c56a92ac5d..95415c2433 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -162,7 +162,7 @@ int BaseQtVersion::getUniqueId()
return QtVersionManager::instance()->getUniqueId();
}
-BaseQtVersion::BaseQtVersion(const QString &qmakeCommand, bool isAutodetected, const QString &autodetectionSource)
+BaseQtVersion::BaseQtVersion(const Utils::FileName &qmakeCommand, bool isAutodetected, const QString &autodetectionSource)
: m_id(getUniqueId()),
m_isAutodetected(isAutodetected),
m_autodetectionSource(autodetectionSource),
@@ -202,17 +202,12 @@ BaseQtVersion::BaseQtVersion()
m_hasDocumentation(false),
m_qmakeIsExecutable(true)
{
- ctor(QString());
+ ctor(Utils::FileName());
}
-void BaseQtVersion::ctor(const QString& qmakePath)
+void BaseQtVersion::ctor(const Utils::FileName &qmakePath)
{
- m_qmakeCommand = QDir::fromNativeSeparators(qmakePath);
-#ifdef Q_OS_WIN
- m_qmakeCommand = m_qmakeCommand.toLower();
-#endif
- if (m_qmakeCommand.startsWith('~'))
- m_qmakeCommand.remove(0, 1).prepend(QDir::homePath());
+ m_qmakeCommand = qmakePath;
m_designerCommand.clear();
m_linguistCommand.clear();
m_qmlviewerCommand.clear();
@@ -228,7 +223,7 @@ BaseQtVersion::~BaseQtVersion()
{
}
-QString BaseQtVersion::defaultDisplayName(const QString &versionString, const QString &qmakePath,
+QString BaseQtVersion::defaultDisplayName(const QString &versionString, const Utils::FileName &qmakePath,
bool fromPath)
{
QString location;
@@ -237,7 +232,7 @@ QString BaseQtVersion::defaultDisplayName(const QString &versionString, const QS
} else {
// Deduce a description from '/foo/qt-folder/[qtbase]/bin/qmake' -> '/foo/qt-folder'.
// '/usr' indicates System Qt 4.X on Linux.
- QDir dir = QFileInfo(qmakePath).absoluteDir();
+ QDir dir = qmakePath.toFileInfo().absoluteDir();
do {
const QString dirName = dir.dirName();
if (dirName == QLatin1String("usr")) { // System-installed Qt.
@@ -276,7 +271,10 @@ void BaseQtVersion::fromMap(const QVariantMap &map)
m_isAutodetected = map.value(QLatin1String(QTVERSIONAUTODETECTED)).toBool();
if (m_isAutodetected)
m_autodetectionSource = map.value(QLatin1String(QTVERSIONAUTODETECTIONSOURCE)).toString();
- ctor(map.value(QLatin1String(QTVERSIONQMAKEPATH)).toString());
+ QString string = map.value(QLatin1String(QTVERSIONQMAKEPATH)).toString();
+ if (string.startsWith('~'))
+ string.remove(0, 1).prepend(QDir::homePath());
+ ctor(Utils::FileName::fromUserInput(string));
}
QVariantMap BaseQtVersion::toMap() const
@@ -287,7 +285,7 @@ QVariantMap BaseQtVersion::toMap() const
result.insert(QLatin1String(QTVERSIONAUTODETECTED), isAutodetected());
if (isAutodetected())
result.insert(QLatin1String(QTVERSIONAUTODETECTIONSOURCE), autodetectionSource());
- result.insert(QLatin1String(QTVERSIONQMAKEPATH), qmakeCommand());
+ result.insert(QLatin1String(QTVERSIONQMAKEPATH), qmakeCommand().toString());
return result;
}
@@ -328,7 +326,7 @@ QString BaseQtVersion::warningReason() const
return QString();
}
-QString BaseQtVersion::qmakeCommand() const
+Utils::FileName BaseQtVersion::qmakeCommand() const
{
return m_qmakeCommand;
}
@@ -411,11 +409,11 @@ QString BaseQtVersion::toHtml(bool verbose) const
prefix = QLatin1String("<tr><td></td>");
}
str << "<tr><td><b>" << QCoreApplication::translate("BaseQtVersion", "Source:")
- << "</b></td><td>" << sourcePath() << "</td></tr>";
+ << "</b></td><td>" << sourcePath().toUserOutput() << "</td></tr>";
str << "<tr><td><b>" << QCoreApplication::translate("BaseQtVersion", "mkspec:")
- << "</b></td><td>" << mkspec() << "</td></tr>";
+ << "</b></td><td>" << mkspec().toUserOutput() << "</td></tr>";
str << "<tr><td><b>" << QCoreApplication::translate("BaseQtVersion", "qmake:")
- << "</b></td><td>" << m_qmakeCommand << "</td></tr>";
+ << "</b></td><td>" << m_qmakeCommand.toUserOutput() << "</td></tr>";
ensureMkSpecParsed();
if (!mkspecPath().isEmpty()) {
if (m_defaultConfigIsDebug || m_defaultConfigIsDebugAndRelease) {
@@ -447,7 +445,7 @@ void BaseQtVersion::updateSourcePath() const
return;
updateVersionInfo();
const QString installData = m_versionInfo["QT_INSTALL_DATA"];
- m_sourcePath = installData;
+ QString sourcePath = installData;
QFile qmakeCache(installData + QLatin1String("/.qmake.cache"));
if (qmakeCache.exists()) {
qmakeCache.open(QIODevice::ReadOnly | QIODevice::Text);
@@ -455,22 +453,19 @@ void BaseQtVersion::updateSourcePath() const
while (!stream.atEnd()) {
QString line = stream.readLine().trimmed();
if (line.startsWith(QLatin1String("QT_SOURCE_TREE"))) {
- m_sourcePath = line.split(QLatin1Char('=')).at(1).trimmed();
- if (m_sourcePath.startsWith(QLatin1String("$$quote("))) {
- m_sourcePath.remove(0, 8);
- m_sourcePath.chop(1);
+ sourcePath = line.split(QLatin1Char('=')).at(1).trimmed();
+ if (sourcePath.startsWith(QLatin1String("$$quote("))) {
+ sourcePath.remove(0, 8);
+ sourcePath.chop(1);
}
break;
}
}
}
- m_sourcePath = QDir::cleanPath(m_sourcePath);
-#ifdef Q_OS_WIN
- m_sourcePath = m_sourcePath.toLower();
-#endif
+ m_sourcePath = Utils::FileName::fromUserInput(sourcePath);
}
-QString BaseQtVersion::sourcePath() const
+Utils::FileName BaseQtVersion::sourcePath() const
{
updateSourcePath();
return m_sourcePath;
@@ -616,21 +611,17 @@ void BaseQtVersion::updateMkspec() const
if (m_mkspecFullPath.isEmpty())
return;
- QString baseMkspecDir = versionInfo().value("QMAKE_MKSPECS");
+ Utils::FileName baseMkspecDir = Utils::FileName::fromUserInput(versionInfo().value("QMAKE_MKSPECS"));
if (baseMkspecDir.isEmpty())
- baseMkspecDir = versionInfo().value("QT_INSTALL_DATA") + "/mkspecs";
-
-#ifdef Q_OS_WIN
- baseMkspecDir = baseMkspecDir.toLower();
-#endif
+ baseMkspecDir = Utils::FileName::fromUserInput(versionInfo().value("QT_INSTALL_DATA") + "/mkspecs");
- if (m_mkspec.startsWith(baseMkspecDir)) {
- m_mkspec = m_mkspec.mid(baseMkspecDir.length() + 1);
+ if (m_mkspec.isChildOf(baseMkspecDir)) {
+ m_mkspec = m_mkspec.relativeChildPath(baseMkspecDir);
// qDebug() << "Setting mkspec to"<<mkspec;
} else {
- QString sourceMkSpecPath = sourcePath() + "/mkspecs";
- if (m_mkspec.startsWith(sourceMkSpecPath)) {
- m_mkspec = m_mkspec.mid(sourceMkSpecPath.length() + 1);
+ Utils::FileName sourceMkSpecPath = sourcePath().appendPath("mkspecs");
+ if (m_mkspec.isChildOf(sourceMkSpecPath)) {
+ m_mkspec = m_mkspec.relativeChildPath(sourceMkSpecPath);
} else {
// Do nothing
}
@@ -652,7 +643,7 @@ void BaseQtVersion::ensureMkSpecParsed() const
ProFileCacheManager::instance()->incRefCount();
ProFileParser parser(ProFileCacheManager::instance()->cache(), &msgHandler);
ProFileEvaluator evaluator(&option, &parser, &msgHandler);
- if (ProFile *pro = parser.parsedProFile(mkspecPath() + "/qmake.conf")) {
+ if (ProFile *pro = parser.parsedProFile(mkspecPath().toString() + "/qmake.conf")) {
evaluator.setCumulative(false);
evaluator.accept(pro, ProFileEvaluator::LoadProOnly);
pro->deref();
@@ -680,26 +671,26 @@ void BaseQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
m_mkspecValues.insert("QT.declarative.bins", evaluator->value("QT.declarative.bins"));
}
-QString BaseQtVersion::mkspec() const
+Utils::FileName BaseQtVersion::mkspec() const
{
updateMkspec();
return m_mkspec;
}
-QString BaseQtVersion::mkspecPath() const
+Utils::FileName BaseQtVersion::mkspecPath() const
{
updateMkspec();
return m_mkspecFullPath;
}
-bool BaseQtVersion::hasMkspec(const QString &spec) const
+bool BaseQtVersion::hasMkspec(const Utils::FileName &spec) const
{
updateVersionInfo();
QFileInfo fi;
- fi.setFile(QDir::fromNativeSeparators(m_versionInfo.value("QMAKE_MKSPECS")) + '/' + spec);
+ fi.setFile(QDir::fromNativeSeparators(m_versionInfo.value("QMAKE_MKSPECS")) + '/' + spec.toString());
if (fi.isDir())
return true;
- fi.setFile(sourcePath() + QLatin1String("/mkspecs/") + spec);
+ fi.setFile(sourcePath().toString() + QLatin1String("/mkspecs/") + spec.toString());
return fi.isDir();
}
@@ -721,11 +712,11 @@ QString BaseQtVersion::qtVersionString() const
return m_qtVersionString;
m_qtVersionString.clear();
if (m_qmakeIsExecutable) {
- const QString qmake = QFileInfo(qmakeCommand()).absoluteFilePath();
+ const QString qmake = qmakeCommand().toString();
m_qtVersionString =
ProjectExplorer::DebuggingHelperLibrary::qtVersionForQMake(qmake, &m_qmakeIsExecutable);
} else {
- qWarning("Cannot determine the Qt version: %s cannot be run.", qPrintable(qmakeCommand()));
+ qWarning("Cannot determine the Qt version: %s cannot be run.", qPrintable(qmakeCommand().toString()));
}
return m_qtVersionString;
}
@@ -741,7 +732,7 @@ void BaseQtVersion::updateVersionInfo() const
return;
if (!m_qmakeIsExecutable) {
qWarning("Cannot update Qt version information: %s cannot be run.",
- qPrintable(qmakeCommand()));
+ qPrintable(qmakeCommand().toString()));
return;
}
@@ -860,7 +851,7 @@ QString BaseQtVersion::examplesPath() const
QList<ProjectExplorer::HeaderPath> BaseQtVersion::systemHeaderPathes() const
{
QList<ProjectExplorer::HeaderPath> result;
- result.append(ProjectExplorer::HeaderPath(mkspecPath(), ProjectExplorer::HeaderPath::GlobalHeaderPath));
+ result.append(ProjectExplorer::HeaderPath(mkspecPath().toString(), ProjectExplorer::HeaderPath::GlobalHeaderPath));
return result;
}
@@ -992,12 +983,12 @@ QList<ProjectExplorer::Task> BaseQtVersion::reportIssuesImpl(const QString &proF
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
}
- QFileInfo qmakeInfo(qmakeCommand());
+ QFileInfo qmakeInfo = qmakeCommand().toFileInfo();
if (!qmakeInfo.exists() ||
!qmakeInfo.isExecutable()) {
//: %1: Path to qmake executable
const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion",
- "The qmake command \"%1\" was not found or is not executable.").arg(qmakeCommand());
+ "The qmake command \"%1\" was not found or is not executable.").arg(qmakeCommand().toUserOutput());
results.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, msg, QString(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
}
@@ -1039,17 +1030,17 @@ QtConfigWidget *BaseQtVersion::createConfigurationWidget() const
return 0;
}
-bool BaseQtVersion::queryQMakeVariables(const QString &binary, QHash<QString, QString> *versionInfo)
+bool BaseQtVersion::queryQMakeVariables(const Utils::FileName &binary, QHash<QString, QString> *versionInfo)
{
bool qmakeIsExecutable;
return BaseQtVersion::queryQMakeVariables(binary, versionInfo, &qmakeIsExecutable);
}
-bool BaseQtVersion::queryQMakeVariables(const QString &binary, QHash<QString, QString> *versionInfo,
+bool BaseQtVersion::queryQMakeVariables(const Utils::FileName &binary, QHash<QString, QString> *versionInfo,
bool *qmakeIsExecutable)
{
const int timeOutMS = 30000; // Might be slow on some machines.
- const QFileInfo qmake(binary);
+ const QFileInfo qmake = binary.toFileInfo();
*qmakeIsExecutable = qmake.exists() && qmake.isExecutable() && !qmake.isDir();
if (!*qmakeIsExecutable)
return false;
@@ -1077,17 +1068,17 @@ bool BaseQtVersion::queryQMakeVariables(const QString &binary, QHash<QString, QS
process.start(qmake.absoluteFilePath(), args, QIODevice::ReadOnly);
if (!process.waitForStarted()) {
*qmakeIsExecutable = false;
- qWarning("Cannot start '%s': %s", qPrintable(binary), qPrintable(process.errorString()));
+ qWarning("Cannot start '%s': %s", qPrintable(binary.toUserOutput()), qPrintable(process.errorString()));
return false;
}
if (!process.waitForFinished(timeOutMS)) {
Utils::SynchronousProcess::stopProcess(process);
- qWarning("Timeout running '%s' (%dms).", qPrintable(binary), timeOutMS);
+ qWarning("Timeout running '%s' (%dms).", qPrintable(binary.toUserOutput()), timeOutMS);
return false;
}
if (process.exitStatus() != QProcess::NormalExit) {
*qmakeIsExecutable = false;
- qWarning("'%s' crashed.", qPrintable(binary));
+ qWarning("'%s' crashed.", qPrintable(binary.toUserOutput()));
return false;
}
QByteArray output = process.readAllStandardOutput();
@@ -1104,24 +1095,20 @@ bool BaseQtVersion::queryQMakeVariables(const QString &binary, QHash<QString, QS
return true;
}
-QString BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo)
+Utils::FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo)
{
- QString baseMkspecDir = versionInfo.value("QMAKE_MKSPECS");
+ Utils::FileName baseMkspecDir = Utils::FileName::fromUserInput(versionInfo.value("QMAKE_MKSPECS"));
if (baseMkspecDir.isEmpty())
- baseMkspecDir = versionInfo.value("QT_INSTALL_DATA") + "/mkspecs";
+ baseMkspecDir = Utils::FileName::fromUserInput(versionInfo.value("QT_INSTALL_DATA") + "/mkspecs");
if (baseMkspecDir.isEmpty())
- return QString();
-
-#ifdef Q_OS_WIN
- baseMkspecDir = baseMkspecDir.toLower();
-#endif
+ return Utils::FileName();
- QString mkspecFullPath = baseMkspecDir + "/default";
+ Utils::FileName mkspecFullPath = Utils::FileName::fromString(baseMkspecDir.toString() + "/default");
// qDebug() << "default mkspec is located at" << mkspecFullPath;
#ifdef Q_OS_WIN
- QFile f2(mkspecFullPath + "/qmake.conf");
+ QFile f2(mkspecFullPath.toString() + "/qmake.conf");
if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
while (!f2.atEnd()) {
QByteArray line = f2.readLine();
@@ -1132,7 +1119,7 @@ QString BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &vers
// We sometimes get a mix of different slash styles here...
possibleFullPath = possibleFullPath.replace('\\', '/');
if (QFileInfo(possibleFullPath).exists()) // Only if the path exists
- mkspecFullPath = possibleFullPath;
+ mkspecFullPath = Utils::FileName::fromUserInput(possibleFullPath);
}
break;
}
@@ -1140,7 +1127,7 @@ QString BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &vers
f2.close();
}
#elif defined(Q_OS_MAC)
- QFile f2(mkspecFullPath + "/qmake.conf");
+ QFile f2(mkspecFullPath.toString() + "/qmake.conf");
if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
while (!f2.atEnd()) {
QByteArray line = f2.readLine();
@@ -1151,10 +1138,10 @@ QString BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &vers
if (value.contains("XCODE")) {
// we don't want to generate xcode projects...
// qDebug() << "default mkspec is xcode, falling back to g++";
- mkspecFullPath = baseMkspecDir + "/macx-g++";
+ mkspecFullPath = baseMkspecDir.appendPath("macx-g++");
}
//resolve mkspec link
- mkspecFullPath = QFileInfo(mkspecFullPath).canonicalFilePath();
+ mkspecFullPath = Utils::FileName::fromString(mkspecFullPath.toFileInfo().canonicalFilePath());
}
break;
}
@@ -1162,12 +1149,9 @@ QString BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &vers
f2.close();
}
#else
- mkspecFullPath = QFileInfo(mkspecFullPath).canonicalFilePath();
+ mkspecFullPath = Utils::FileName::fromString(mkspecFullPath.toFileInfo().canonicalFilePath());
#endif
-#ifdef Q_OS_WIN
- mkspecFullPath = mkspecFullPath.toLower();
-#endif
return mkspecFullPath;
}
diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h
index 7f2f95647f..d665811524 100644
--- a/src/plugins/qtsupport/baseqtversion.h
+++ b/src/plugins/qtsupport/baseqtversion.h
@@ -35,6 +35,8 @@
#include "qtsupport_global.h"
+#include <utils/fileutils.h>
+
#include <projectexplorer/abi.h>
#include <projectexplorer/headerpath.h>
#include <projectexplorer/task.h>
@@ -132,7 +134,7 @@ public:
virtual QHash<QString,QString> versionInfo() const;
virtual void addToEnvironment(Utils::Environment &env) const;
- virtual QString sourcePath() const;
+ virtual Utils::FileName sourcePath() const;
// used by QtUiCodeModelSupport
virtual QString uicCommand() const;
virtual QString designerCommand() const;
@@ -155,16 +157,16 @@ public:
virtual QString frameworkInstallPath() const;
// former local functions
- QString qmakeCommand() const;
+ Utils::FileName qmakeCommand() const;
virtual QString systemRoot() const;
/// @returns the name of the mkspec
- QString mkspec() const;
+ Utils::FileName mkspec() const;
/// @returns the full path to the default directory
/// specifally not the directory the symlink/ORIGINAL_QMAKESPEC points to
- QString mkspecPath() const;
+ Utils::FileName mkspecPath() const;
- bool hasMkspec(const QString &) const;
+ bool hasMkspec(const Utils::FileName &spec) const;
enum QmakeBuildConfig
{
@@ -186,9 +188,9 @@ public:
virtual ProjectExplorer::IOutputParser *createOutputParser() const;
- static bool queryQMakeVariables(const QString &binary, QHash<QString, QString> *versionInfo);
- static bool queryQMakeVariables(const QString &binary, QHash<QString, QString> *versionInfo, bool *qmakeIsExecutable);
- static QString mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo);
+ static bool queryQMakeVariables(const Utils::FileName &binary, QHash<QString, QString> *versionInfo);
+ static bool queryQMakeVariables(const Utils::FileName &binary, QHash<QString, QString> *versionInfo, bool *qmakeIsExecutable);
+ static Utils::FileName mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo);
virtual bool supportsBinaryDebuggingHelper() const;
@@ -208,12 +210,12 @@ public:
virtual QtConfigWidget *createConfigurationWidget() const;
static QString defaultDisplayName(const QString &versionString,
- const QString &qmakePath,
+ const Utils::FileName &qmakePath,
bool fromPath = false);
protected:
BaseQtVersion();
- BaseQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
+ BaseQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
virtual QList<ProjectExplorer::Task> reportIssuesImpl(const QString &proFile, const QString &buildDir);
@@ -226,7 +228,7 @@ protected:
private:
void setAutoDetectionSource(const QString &autodetectionSource);
static int getUniqueId();
- void ctor(const QString &qmakePath);
+ void ctor(const Utils::FileName &qmakePath);
void updateSourcePath() const;
void updateVersionInfo() const;
enum Binaries { QmlViewer, Designer, Linguist, Uic };
@@ -239,15 +241,15 @@ private:
bool m_isAutodetected;
QString m_autodetectionSource;
- mutable QString m_sourcePath;
+ mutable Utils::FileName m_sourcePath;
mutable bool m_hasDebuggingHelper; // controlled by m_versionInfoUpToDate
mutable bool m_hasQmlDump; // controlled by m_versionInfoUpToDate
mutable bool m_hasQmlDebuggingLibrary; // controlled by m_versionInfoUpdate
mutable bool m_hasQmlObserver; // controlled by m_versionInfoUpToDate
mutable bool m_mkspecUpToDate;
- mutable QString m_mkspec;
- mutable QString m_mkspecFullPath;
+ mutable Utils::FileName m_mkspec;
+ mutable Utils::FileName m_mkspecFullPath;
mutable bool m_mkspecReadUpToDate;
mutable bool m_defaultConfigIsDebug;
@@ -261,7 +263,7 @@ private:
mutable bool m_hasDemos;
mutable bool m_hasDocumentation;
- mutable QString m_qmakeCommand;
+ mutable Utils::FileName m_qmakeCommand;
mutable QString m_qtVersionString;
mutable QString m_uicCommand;
mutable QString m_designerCommand;
diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.cpp b/src/plugins/qtsupport/debugginghelperbuildtask.cpp
index ba016468aa..4353f84db2 100644
--- a/src/plugins/qtsupport/debugginghelperbuildtask.cpp
+++ b/src/plugins/qtsupport/debugginghelperbuildtask.cpp
@@ -111,8 +111,8 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
m_mkspec = version->mkspec();
// Make sure QtVersion cache is invalidated
- connect(this, SIGNAL(updateQtVersions(QString)),
- QtVersionManager::instance(), SLOT(updateDumpFor(QString)),
+ connect(this, SIGNAL(updateQtVersions(Utils::FileName)),
+ QtVersionManager::instance(), SLOT(updateDumpFor(Utils::FileName)),
Qt::QueuedConnection);
}
diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.h b/src/plugins/qtsupport/debugginghelperbuildtask.h
index ee24a659c9..a37838194b 100644
--- a/src/plugins/qtsupport/debugginghelperbuildtask.h
+++ b/src/plugins/qtsupport/debugginghelperbuildtask.h
@@ -35,6 +35,7 @@
#include "qtsupport_global.h"
#include <utils/environment.h>
+#include <utils/fileutils.h>
#include <projectexplorer/toolchain.h>
#include <QtCore/QObject>
@@ -77,7 +78,7 @@ signals:
// used internally
void logOutput(const QString &output, bool bringToForeground);
- void updateQtVersions(const QString &qmakeCommand);
+ void updateQtVersions(const Utils::FileName &qmakeCommand);
private:
bool buildDebuggingHelper(QFutureInterface<void> &future);
@@ -88,10 +89,10 @@ private:
int m_qtId;
QString m_qtInstallData;
QString m_target;
- QString m_qmakeCommand;
+ Utils::FileName m_qmakeCommand;
QString m_makeCommand;
QStringList m_makeArguments;
- QString m_mkspec;
+ Utils::FileName m_mkspec;
Utils::Environment m_environment;
QString m_log;
bool m_invalidQt;
diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp
index c6c42e165e..410ce93edf 100644
--- a/src/plugins/qtsupport/qtoptionspage.cpp
+++ b/src/plugins/qtsupport/qtoptionspage.cpp
@@ -174,7 +174,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *>
BaseQtVersion *version = m_versions.at(i);
QTreeWidgetItem *item = new QTreeWidgetItem(version->isAutodetected()? autoItem : manualItem);
item->setText(0, version->displayName());
- item->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
+ item->setText(1, version->qmakeCommand().toUserOutput());
item->setData(0, VersionIdRole, version->uniqueId());
item->setData(0, ToolChainIdRole, defaultToolChainId(version));
const ValidityInfo info = validInformation(version);
@@ -216,8 +216,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<BaseQtVersion *>
userChangedCurrentVersion();
updateCleanUpButton();
- connect(QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(QString)),
- this, SLOT(qtVersionsDumpUpdated(QString)));
+ connect(QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(Utils::FileName)),
+ this, SLOT(qtVersionsDumpUpdated(Utils::FileName)));
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainsChanged()),
this, SLOT(toolChainsUpdated()));
@@ -359,7 +359,7 @@ void QtOptionsPageWidget::selectedToolChainChanged(int comboIndex)
item->setData(0, ToolChainIdRole, toolChainId);
}
-void QtOptionsPageWidget::qtVersionsDumpUpdated(const QString &qmakeCommand)
+void QtOptionsPageWidget::qtVersionsDumpUpdated(const Utils::FileName &qmakeCommand)
{
foreach (BaseQtVersion *version, m_versions) {
if (version->qmakeCommand() == qmakeCommand)
@@ -592,9 +592,11 @@ static QString filterForQmakeFileDialog()
void QtOptionsPageWidget::addQtDir()
{
- QString qtVersion = QFileDialog::getOpenFileName(this,
- tr("Select a qmake executable"),
- QString(), filterForQmakeFileDialog());
+ Utils::FileName qtVersion = Utils::FileName::fromString(
+ QFileDialog::getOpenFileName(this,
+ tr("Select a qmake executable"),
+ QString(),
+ filterForQmakeFileDialog()));
if (qtVersion.isNull())
return;
if (QtVersionManager::instance()->qtVersionForQMakeBinary(qtVersion)) {
@@ -607,7 +609,7 @@ void QtOptionsPageWidget::addQtDir()
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->qtdirList->topLevelItem(1));
item->setText(0, version->displayName());
- item->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
+ item->setText(1, version->qmakeCommand().toUserOutput());
item->setData(0, VersionIdRole, version->uniqueId());
item->setData(0, ToolChainIdRole, defaultToolChainId(version));
item->setIcon(0, version->isValid()? m_validVersionIcon : m_invalidVersionIcon);
@@ -636,10 +638,11 @@ void QtOptionsPageWidget::removeQtDir()
void QtOptionsPageWidget::editPath()
{
BaseQtVersion *current = currentVersion();
- QString dir = QFileInfo(currentVersion()->qmakeCommand()).absolutePath();
- QString qtVersion = QFileDialog::getOpenFileName(this,
- tr("Select a qmake executable"),
- dir, filterForQmakeFileDialog());
+ QString dir = currentVersion()->qmakeCommand().toFileInfo().absolutePath();
+ Utils::FileName qtVersion = Utils::FileName::fromString(
+ QFileDialog::getOpenFileName(this,
+ tr("Select a qmake executable"),
+ dir, filterForQmakeFileDialog()));
if (qtVersion.isNull())
return;
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qtVersion);
@@ -665,7 +668,7 @@ void QtOptionsPageWidget::editPath()
userChangedCurrentVersion();
QTreeWidgetItem *item = m_ui->qtdirList->currentItem();
item->setText(0, version->displayName());
- item->setText(1, QDir::toNativeSeparators(version->qmakeCommand()));
+ item->setText(1, version->qmakeCommand().toUserOutput());
item->setData(0, VersionIdRole, version->uniqueId());
item->setData(0, ToolChainIdRole, defaultToolChainId(version));
item->setIcon(0, version->isValid()? m_validVersionIcon : m_invalidVersionIcon);
@@ -934,7 +937,7 @@ void QtOptionsPageWidget::updateWidgets()
BaseQtVersion *version = currentVersion();
if (version) {
m_versionUi->nameEdit->setText(version->displayName());
- m_versionUi->qmakePath->setText(QDir::toNativeSeparators(version->qmakeCommand()));
+ m_versionUi->qmakePath->setText(version->qmakeCommand().toUserOutput());
m_configurationWidget = version->createConfigurationWidget();
if (m_configurationWidget) {
m_versionUi->formLayout->addRow(m_configurationWidget);
diff --git a/src/plugins/qtsupport/qtoptionspage.h b/src/plugins/qtsupport/qtoptionspage.h
index 79d0eb9b22..6949859644 100644
--- a/src/plugins/qtsupport/qtoptionspage.h
+++ b/src/plugins/qtsupport/qtoptionspage.h
@@ -117,7 +117,7 @@ private slots:
void toolChainsUpdated();
void selectedToolChainChanged(int index);
- void qtVersionsDumpUpdated(const QString &qmakeCommand);
+ void qtVersionsDumpUpdated(const Utils::FileName &qmakeCommand);
void handleDebuggingHelperExpanded(bool expanded);
private:
diff --git a/src/plugins/qtsupport/qtversionfactory.cpp b/src/plugins/qtsupport/qtversionfactory.cpp
index 9f60e3d9e4..3713792b0b 100644
--- a/src/plugins/qtsupport/qtversionfactory.cpp
+++ b/src/plugins/qtsupport/qtversionfactory.cpp
@@ -57,7 +57,7 @@ bool sortByPriority(QtVersionFactory *a, QtVersionFactory *b)
return a->priority() > b->priority();
}
-BaseQtVersion *QtVersionFactory::createQtVersionFromLegacySettings(const QString &qmakePath, int id, QSettings *s)
+BaseQtVersion *QtVersionFactory::createQtVersionFromLegacySettings(const Utils::FileName &qmakePath, int id, QSettings *s)
{
BaseQtVersion *v = createQtVersionFromQMakePath(qmakePath);
if (!v)
@@ -68,13 +68,13 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromLegacySettings(const QString
return v;
}
-BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const QString &qmakePath, bool isAutoDetected, const QString &autoDetectionSource)
+BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileName &qmakePath, bool isAutoDetected, const QString &autoDetectionSource)
{
QHash<QString, QString> versionInfo;
bool success = BaseQtVersion::queryQMakeVariables(qmakePath, &versionInfo);
if (!success)
return 0;
- QString mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
+ Utils::FileName mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
ProFileOption option;
option.properties = versionInfo;
@@ -82,7 +82,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const QString &qma
ProFileCacheManager::instance()->incRefCount();
ProFileParser parser(ProFileCacheManager::instance()->cache(), &msgHandler);
ProFileEvaluator evaluator(&option, &parser, &msgHandler);
- if (ProFile *pro = parser.parsedProFile(mkspec + "/qmake.conf")) {
+ if (ProFile *pro = parser.parsedProFile(mkspec.toString() + "/qmake.conf")) {
evaluator.setCumulative(false);
evaluator.accept(pro, ProFileEvaluator::LoadProOnly);
pro->deref();
diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h
index fc9ab94f67..7f1da58306 100644
--- a/src/plugins/qtsupport/qtversionfactory.h
+++ b/src/plugins/qtsupport/qtversionfactory.h
@@ -35,6 +35,7 @@
#include "qtsupport_global.h"
+#include <utils/fileutils.h>
#include <QtCore/QObject>
#include <QtCore/QVariantMap>
@@ -59,10 +60,10 @@ public:
/// a qtversion, the priority of the desktop factory is 0 and
/// the desktop factory claims to handle all paths
virtual int priority() const = 0;
- virtual BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()) = 0;
+ virtual BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()) = 0;
- static BaseQtVersion *createQtVersionFromQMakePath(const QString &qmakePath, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
- static BaseQtVersion *createQtVersionFromLegacySettings(const QString &qmakePath, int id, QSettings *s);
+ static BaseQtVersion *createQtVersionFromQMakePath(const Utils::FileName &qmakePath, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
+ static BaseQtVersion *createQtVersionFromLegacySettings(const Utils::FileName &qmakePath, int id, QSettings *s);
};
}
diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp
index 6b6bb525b0..a578718e68 100644
--- a/src/plugins/qtsupport/qtversionmanager.cpp
+++ b/src/plugins/qtsupport/qtversionmanager.cpp
@@ -118,6 +118,8 @@ QtVersionManager::QtVersionManager()
{
m_self = this;
m_idcount = 1;
+
+ qRegisterMetaType<Utils::FileName>();
}
void QtVersionManager::extensionsInitialized()
@@ -213,7 +215,7 @@ void QtVersionManager::updateFromInstaller()
if (debug) {
qDebug()<< "======= Existing Qt versions =======";
foreach (BaseQtVersion *version, m_versions) {
- qDebug() << version->qmakeCommand() << "id:"<<version->uniqueId();
+ qDebug() << version->qmakeCommand().toString() << "id:"<<version->uniqueId();
qDebug() << " autodetection source:"<< version->autodetectionSource();
qDebug() << "";
}
@@ -225,10 +227,7 @@ void QtVersionManager::updateFromInstaller()
if (!data.contains(key))
break;
QVariantMap map = data.value(key).toMap();
- QString path = map.value(OLDQTVERSION_PATH).toString();
-#ifdef Q_OS_WIN
- path = path.toLower();
-#endif
+ Utils::FileName path = Utils::FileName::fromString(map.value(OLDQTVERSION_PATH).toString());
QString autodetectionSource = map.value(OLDQTVERSION_SDKSOURCE).toString();
foreach (BaseQtVersion *v, m_versions) {
if (v->qmakeCommand() == path) {
@@ -236,7 +235,7 @@ void QtVersionManager::updateFromInstaller()
v->setAutoDetectionSource(autodetectionSource);
} else {
if (debug)
- qDebug() << "## Conflicting autodetictonSource for"<<path<<"\n"
+ qDebug() << "## Conflicting autodetictonSource for"<<path.toString()<<"\n"
<<" version retains"<<v->autodetectionSource();
}
// No break, we want to mark all qt versions matching that path
@@ -251,7 +250,7 @@ void QtVersionManager::updateFromInstaller()
if (debug) {
qDebug()<< "======= After using OLD QtVersion data to mark versions =======";
foreach (BaseQtVersion *version, m_versions) {
- qDebug() << version->qmakeCommand() << "id:"<<version->uniqueId();
+ qDebug() << version->qmakeCommand().toString() << "id:"<<version->uniqueId();
qDebug() << " autodetection source:"<< version->autodetectionSource();
qDebug() << "";
}
@@ -317,7 +316,7 @@ void QtVersionManager::updateFromInstaller()
if (debug) {
qDebug() << "======= Before removing outdated sdk versions =======";
foreach (BaseQtVersion *version, m_versions) {
- qDebug() << version->qmakeCommand() << "id:"<<version->uniqueId();
+ qDebug() << version->qmakeCommand().toString() << "id:"<<version->uniqueId();
qDebug() << " autodetection source:"<< version->autodetectionSource();
qDebug() << "";
}
@@ -335,7 +334,7 @@ void QtVersionManager::updateFromInstaller()
if (debug) {
qDebug()<< "======= End result =======";
foreach (BaseQtVersion *version, m_versions) {
- qDebug() << version->qmakeCommand() << "id:"<<version->uniqueId();
+ qDebug() << version->qmakeCommand().toString() << "id:"<<version->uniqueId();
qDebug() << " autodetection source:"<< version->autodetectionSource();
qDebug() << "";
}
@@ -363,7 +362,7 @@ void QtVersionManager::saveQtVersions()
void QtVersionManager::findSystemQt()
{
- QString systemQMakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment());
+ Utils::FileName systemQMakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment());
if (systemQMakePath.isNull())
return;
@@ -390,7 +389,7 @@ bool QtVersionManager::legacyRestore()
else if (m_idcount < id)
m_idcount = id + 1;
- QString qmakePath = s->value("QMakePath").toString();
+ Utils::FileName qmakePath = Utils::FileName::fromString(s->value("QMakePath").toString());
if (qmakePath.isEmpty())
continue; //skip this version
@@ -501,7 +500,7 @@ void QtVersionManager::updateDocumentation()
helpManager->registerDocumentation(files);
}
-void QtVersionManager::updateDumpFor(const QString &qmakeCommand)
+void QtVersionManager::updateDumpFor(const Utils::FileName &qmakeCommand)
{
foreach (BaseQtVersion *v, versions()) {
if (v->qmakeCommand() == qmakeCommand)
@@ -525,17 +524,15 @@ void QtVersionManager::updateSettings()
// in SDKs, we want to prefer the Qt version shipping with the SDK
QSettings *settings = Core::ICore::instance()->settings();
- QString preferred = settings->value(QLatin1String("PreferredQMakePath")).toString();
- preferred = QDir::fromNativeSeparators(preferred);
+ Utils::FileName preferred = Utils::FileName::fromUserInput(settings->value(QLatin1String("PreferredQMakePath")).toString());
if (!preferred.isEmpty()) {
#ifdef Q_OS_WIN
- preferred = preferred.toLower();
- if (!preferred.endsWith(QLatin1String(".exe")))
- preferred.append(QLatin1String(".exe"));
+ if (!preferred.endsWith(".exe"))
+ preferred.append(".exe");
#endif
foreach (version, candidates) {
if (version->qmakeCommand() == preferred) {
- emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath());
+ emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath().toString());
return;
}
}
@@ -544,14 +541,14 @@ void QtVersionManager::updateSettings()
// prefer versions with declarative examples
foreach (version, candidates) {
if (QDir(version->examplesPath()+"/declarative").exists()) {
- emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath());
+ emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath().toString());
return;
}
}
if (!candidates.isEmpty()) {
version = candidates.first();
- emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath());
+ emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath().toString());
return;
}
return;
@@ -690,7 +687,7 @@ void QtVersionManager::setNewQtVersions(QList<BaseQtVersion *> newVersions)
// That is returns the directory
// To find out whether we already have a qtversion for that directory call
// QtVersion *QtVersionManager::qtVersionForDirectory(const QString directory);
-QString QtVersionManager::findQMakeBinaryFromMakefile(const QString &makefile)
+Utils::FileName QtVersionManager::findQMakeBinaryFromMakefile(const QString &makefile)
{
bool debugAdding = false;
QFile fi(makefile);
@@ -711,19 +708,15 @@ QString QtVersionManager::findQMakeBinaryFromMakefile(const QString &makefile)
// Is qmake still installed?
QFileInfo fi(qmakePath);
if (fi.exists()) {
- qmakePath = fi.absoluteFilePath();
-#ifdef Q_OS_WIN
- qmakePath = qmakePath.toLower();
-#endif
- return qmakePath;
+ return Utils::FileName(fi);
}
}
}
}
- return QString();
+ return Utils::FileName();
}
-BaseQtVersion *QtVersionManager::qtVersionForQMakeBinary(const QString &qmakePath)
+BaseQtVersion *QtVersionManager::qtVersionForQMakeBinary(const Utils::FileName &qmakePath)
{
foreach (BaseQtVersion *version, versions()) {
if (version->qmakeCommand() == qmakePath) {
diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h
index 27f5d72b37..fb46fcf31c 100644
--- a/src/plugins/qtsupport/qtversionmanager.h
+++ b/src/plugins/qtsupport/qtversionmanager.h
@@ -84,7 +84,7 @@ public:
// need to get a new pointer by calling this method again!
BaseQtVersion *version(int id) const;
- BaseQtVersion *qtVersionForQMakeBinary(const QString &qmakePath);
+ BaseQtVersion *qtVersionForQMakeBinary(const Utils::FileName &qmakePath);
// Used by the projectloadwizard
void addVersion(BaseQtVersion *version);
@@ -105,7 +105,7 @@ public:
static MakefileCompatible makefileIsFor(const QString &makefile, const QString &proFile);
static QPair<BaseQtVersion::QmakeBuildConfigs, QString> scanMakeFile(const QString &makefile,
BaseQtVersion::QmakeBuildConfigs defaultBuildConfig);
- static QString findQMakeBinaryFromMakefile(const QString &directory);
+ static Utils::FileName findQMakeBinaryFromMakefile(const QString &directory);
bool isValidId(int id) const;
// Compatibility with pre-2.2:
@@ -113,12 +113,12 @@ public:
QString popPendingGcceUpdate();
signals:
// content of BaseQtVersion objects with qmake path might have changed
- void dumpUpdatedFor(const QString &qmakeCommand);
+ void dumpUpdatedFor(const Utils::FileName &qmakeCommand);
void qtVersionsChanged(const QList<int> &uniqueIds);
void updateExamples(QString, QString, QString);
public slots:
- void updateDumpFor(const QString &qmakeCommand);
+ void updateDumpFor(const Utils::FileName &qmakeCommand);
private slots:
void updateSettings();
diff --git a/src/plugins/remotelinux/embeddedlinuxqtversion.cpp b/src/plugins/remotelinux/embeddedlinuxqtversion.cpp
index 75d0ca516f..ed0751eb45 100644
--- a/src/plugins/remotelinux/embeddedlinuxqtversion.cpp
+++ b/src/plugins/remotelinux/embeddedlinuxqtversion.cpp
@@ -43,7 +43,7 @@ EmbeddedLinuxQtVersion::EmbeddedLinuxQtVersion()
: BaseQtVersion()
{ }
-EmbeddedLinuxQtVersion::EmbeddedLinuxQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
+EmbeddedLinuxQtVersion::EmbeddedLinuxQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
: BaseQtVersion(path, isAutodetected, autodetectionSource)
{ }
diff --git a/src/plugins/remotelinux/embeddedlinuxqtversion.h b/src/plugins/remotelinux/embeddedlinuxqtversion.h
index 7bc84c8b85..a31b053099 100644
--- a/src/plugins/remotelinux/embeddedlinuxqtversion.h
+++ b/src/plugins/remotelinux/embeddedlinuxqtversion.h
@@ -42,7 +42,7 @@ class EmbeddedLinuxQtVersion : public QtSupport::BaseQtVersion
{
public:
EmbeddedLinuxQtVersion();
- EmbeddedLinuxQtVersion(const QString &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
+ EmbeddedLinuxQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
~EmbeddedLinuxQtVersion();
EmbeddedLinuxQtVersion *clone() const;
diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp
index fb4f52169c..59c1d97108 100644
--- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp
+++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp
@@ -65,14 +65,14 @@ int EmbeddedLinuxQtVersionFactory::priority() const
return 10;
}
-QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::create(const QString &qmakePath,
+QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::create(const Utils::FileName &qmakePath,
ProFileEvaluator *evaluator,
bool isAutoDetected,
const QString &autoDetectionSource)
{
Q_UNUSED(evaluator);
- QFileInfo fi(qmakePath);
+ QFileInfo fi = qmakePath.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0;
diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h
index bb422780f8..01672ccd22 100644
--- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h
+++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h
@@ -48,7 +48,7 @@ public:
QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
int priority() const;
- QtSupport::BaseQtVersion *create(const QString &qmakePath, ProFileEvaluator *evaluator,
+ QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
bool isAutoDetected = false,
const QString &autoDetectionSource = QString());
};
diff --git a/src/plugins/remotelinux/embeddedlinuxtarget.cpp b/src/plugins/remotelinux/embeddedlinuxtarget.cpp
index eae7b66c1b..9d9d2c203f 100644
--- a/src/plugins/remotelinux/embeddedlinuxtarget.cpp
+++ b/src/plugins/remotelinux/embeddedlinuxtarget.cpp
@@ -73,11 +73,11 @@ QList<ProjectExplorer::RunConfiguration *> EmbeddedLinuxTarget::runConfiguration
return result;
}
-QString EmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const
+Utils::FileName EmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const
{
QtSupport::BaseQtVersion *version = bc->qtVersion();
if (!version)
- return QString();
+ return Utils::FileName();
return version->mkspec();
}
diff --git a/src/plugins/remotelinux/embeddedlinuxtarget.h b/src/plugins/remotelinux/embeddedlinuxtarget.h
index 5c4970e96e..30ba63f312 100644
--- a/src/plugins/remotelinux/embeddedlinuxtarget.h
+++ b/src/plugins/remotelinux/embeddedlinuxtarget.h
@@ -55,7 +55,7 @@ public:
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
- QString mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const;
+ Utils::FileName mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const;
private:
Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory;