Commit f5d42871 authored by Daniel Teske's avatar Daniel Teske

Use Utils::FileName for various bits in QtVersion

Change-Id: I3afc3a4f2e0dd2671279c2d071779f1d7b277849
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent c6936d9e
......@@ -48,7 +48,7 @@
namespace Utils {
QString BuildableHelperLibrary::findSystemQt(const Utils::Environment &env)
Utils::FileName BuildableHelperLibrary::findSystemQt(const Utils::Environment &env)
{
QStringList paths = env.path();
foreach (const QString &path, paths) {
......@@ -59,18 +59,18 @@ QString BuildableHelperLibrary::findSystemQt(const Utils::Environment &env)
const QFileInfo qmake(prefix + possibleCommand);
if (qmake.exists()) {
if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) {
return qmake.absoluteFilePath();
return Utils::FileName(qmake);
}
}
}
}
return QString();
return Utils::FileName();
}
QString BuildableHelperLibrary::qtInstallDataDir(const QString &qmakePath)
QString BuildableHelperLibrary::qtInstallDataDir(const Utils::FileName &qmakePath)
{
QProcess proc;
proc.start(qmakePath, QStringList() << QLatin1String("-query") << QLatin1String("QT_INSTALL_DATA"));
proc.start(qmakePath.toString(), QStringList() << QLatin1String("-query") << QLatin1String("QT_INSTALL_DATA"));
if (proc.waitForFinished())
return QString(proc.readAll().trimmed());
return QString();
......@@ -269,16 +269,16 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
if (!arguments.targetMode.isEmpty())
qmakeArgs << arguments.targetMode;
if (!arguments.mkspec.isEmpty())
qmakeArgs << QLatin1String("-spec") << arguments.mkspec;
qmakeArgs << QLatin1String("-spec") << arguments.mkspec.toUserOutput();
qmakeArgs << arguments.proFilename;
qmakeArgs << arguments.qmakeArguments;
log->append(newline);
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Running %1 %2 ...\n").arg(arguments.qmakeCommand,
"Running %1 %2 ...\n").arg(arguments.qmakeCommand.toUserOutput(),
qmakeArgs.join(" ")));
if (!runBuildProcess(proc, arguments.qmakeCommand, qmakeArgs, 30000, false, log, errorMessage))
if (!runBuildProcess(proc, arguments.qmakeCommand.toString(), qmakeArgs, 30000, false, log, errorMessage))
return false;
log->append(newline);
if (makeFullPath.isEmpty()) {
......
......@@ -35,6 +35,7 @@
#include "utils_global.h"
#include <utils/environment.h>
#include <utils/fileutils.h>
#include <QtCore/QString>
......@@ -49,7 +50,7 @@ class QTCREATOR_UTILS_EXPORT BuildableHelperLibrary
public:
// returns the full path to the first qmake, qmake-qt4, qmake4 that has
// at least version 2.0.0 and thus is a qt4 qmake
static QString findSystemQt(const Utils::Environment &env);
static FileName findSystemQt(const Utils::Environment &env);
// return true if the qmake at qmakePath is qt4 (used by QtVersion)
static QString qtVersionForQMake(const QString &qmakePath);
static QString qtVersionForQMake(const QString &qmakePath, bool *qmakeIsExecutable);
......@@ -57,7 +58,7 @@ public:
static QStringList possibleQMakeCommands();
static QString qtInstallHeadersDir(const QString &qmakePath);
static QString qtInstallDataDir(const QString &qmakePath);
static QString qtInstallDataDir(const FileName &qmakePath);
static QString byInstallDataHelper(const QString &sourcePath,
const QStringList &sourceFileNames,
......@@ -73,9 +74,9 @@ public:
QString directory;
Utils::Environment environment;
QString qmakeCommand;
Utils::FileName qmakeCommand;
QString targetMode;
QString mkspec;
Utils::FileName mkspec;
QString proFilename;
QStringList qmakeArguments;
......
......@@ -530,11 +530,24 @@ FileName FileName::relativeChildPath(const FileName &parent) const
}
/// Appends \a s, ensuring a / between the parts
void FileName::appendPath(const QString &s)
FileName &FileName::appendPath(const QString &s)
{
if (QString::endsWith(QLatin1Char('/')))
append(QLatin1Char('/'));
append(s);
return *this;
}
FileName &FileName::append(const QString &str)
{
QString::append(str);
return *this;
}
FileName &FileName::append(QChar str)
{
QString::append(str);
return *this;
}
} // namespace Utils
......
......@@ -163,7 +163,9 @@ public:
bool endsWith(const QString &s) const;
Utils::FileName relativeChildPath(const FileName &parent) const;
void appendPath(const QString &s);
Utils::FileName &appendPath(const QString &s);
Utils::FileName &append(const QString &str);
Utils::FileName &append(QChar str);
using QString::size;
using QString::count;
......@@ -171,7 +173,6 @@ public:
using QString::isEmpty;
using QString::isNull;
using QString::clear;
using QString::append;
private:
static Qt::CaseSensitivity cs;
FileName(const QString &string);
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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)
......
......@@ -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);
......
......@@ -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();
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
......@@ -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()) {
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
......@@ -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");
}
......
......@@ -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);
}
......
......@@ -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()));