Commit f5d42871 authored by Daniel Teske's avatar Daniel Teske
Browse files

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 @@ ...@@ -48,7 +48,7 @@
namespace Utils { namespace Utils {
QString BuildableHelperLibrary::findSystemQt(const Utils::Environment &env) Utils::FileName BuildableHelperLibrary::findSystemQt(const Utils::Environment &env)
{ {
QStringList paths = env.path(); QStringList paths = env.path();
foreach (const QString &path, paths) { foreach (const QString &path, paths) {
...@@ -59,18 +59,18 @@ QString BuildableHelperLibrary::findSystemQt(const Utils::Environment &env) ...@@ -59,18 +59,18 @@ QString BuildableHelperLibrary::findSystemQt(const Utils::Environment &env)
const QFileInfo qmake(prefix + possibleCommand); const QFileInfo qmake(prefix + possibleCommand);
if (qmake.exists()) { if (qmake.exists()) {
if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) { 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; 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()) if (proc.waitForFinished())
return QString(proc.readAll().trimmed()); return QString(proc.readAll().trimmed());
return QString(); return QString();
...@@ -269,16 +269,16 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments, ...@@ -269,16 +269,16 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
if (!arguments.targetMode.isEmpty()) if (!arguments.targetMode.isEmpty())
qmakeArgs << arguments.targetMode; qmakeArgs << arguments.targetMode;
if (!arguments.mkspec.isEmpty()) if (!arguments.mkspec.isEmpty())
qmakeArgs << QLatin1String("-spec") << arguments.mkspec; qmakeArgs << QLatin1String("-spec") << arguments.mkspec.toUserOutput();
qmakeArgs << arguments.proFilename; qmakeArgs << arguments.proFilename;
qmakeArgs << arguments.qmakeArguments; qmakeArgs << arguments.qmakeArguments;
log->append(newline); log->append(newline);
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary", log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Running %1 %2 ...\n").arg(arguments.qmakeCommand, "Running %1 %2 ...\n").arg(arguments.qmakeCommand.toUserOutput(),
qmakeArgs.join(" "))); 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; return false;
log->append(newline); log->append(newline);
if (makeFullPath.isEmpty()) { if (makeFullPath.isEmpty()) {
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "utils_global.h" #include "utils_global.h"
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/fileutils.h>
#include <QtCore/QString> #include <QtCore/QString>
...@@ -49,7 +50,7 @@ class QTCREATOR_UTILS_EXPORT BuildableHelperLibrary ...@@ -49,7 +50,7 @@ class QTCREATOR_UTILS_EXPORT BuildableHelperLibrary
public: public:
// returns the full path to the first qmake, qmake-qt4, qmake4 that has // 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 // 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) // return true if the qmake at qmakePath is qt4 (used by QtVersion)
static QString qtVersionForQMake(const QString &qmakePath); static QString qtVersionForQMake(const QString &qmakePath);
static QString qtVersionForQMake(const QString &qmakePath, bool *qmakeIsExecutable); static QString qtVersionForQMake(const QString &qmakePath, bool *qmakeIsExecutable);
...@@ -57,7 +58,7 @@ public: ...@@ -57,7 +58,7 @@ public:
static QStringList possibleQMakeCommands(); static QStringList possibleQMakeCommands();
static QString qtInstallHeadersDir(const QString &qmakePath); static QString qtInstallHeadersDir(const QString &qmakePath);
static QString qtInstallDataDir(const QString &qmakePath); static QString qtInstallDataDir(const FileName &qmakePath);
static QString byInstallDataHelper(const QString &sourcePath, static QString byInstallDataHelper(const QString &sourcePath,
const QStringList &sourceFileNames, const QStringList &sourceFileNames,
...@@ -73,9 +74,9 @@ public: ...@@ -73,9 +74,9 @@ public:
QString directory; QString directory;
Utils::Environment environment; Utils::Environment environment;
QString qmakeCommand; Utils::FileName qmakeCommand;
QString targetMode; QString targetMode;
QString mkspec; Utils::FileName mkspec;
QString proFilename; QString proFilename;
QStringList qmakeArguments; QStringList qmakeArguments;
......
...@@ -530,11 +530,24 @@ FileName FileName::relativeChildPath(const FileName &parent) const ...@@ -530,11 +530,24 @@ FileName FileName::relativeChildPath(const FileName &parent) const
} }
/// Appends \a s, ensuring a / between the parts /// Appends \a s, ensuring a / between the parts
void FileName::appendPath(const QString &s) FileName &FileName::appendPath(const QString &s)
{ {
if (QString::endsWith(QLatin1Char('/'))) if (QString::endsWith(QLatin1Char('/')))
append(QLatin1Char('/')); append(QLatin1Char('/'));
append(s); 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 } // namespace Utils
......
...@@ -163,7 +163,9 @@ public: ...@@ -163,7 +163,9 @@ public:
bool endsWith(const QString &s) const; bool endsWith(const QString &s) const;
Utils::FileName relativeChildPath(const FileName &parent) 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::size;
using QString::count; using QString::count;
...@@ -171,7 +173,6 @@ public: ...@@ -171,7 +173,6 @@ public:
using QString::isEmpty; using QString::isEmpty;
using QString::isNull; using QString::isNull;
using QString::clear; using QString::clear;
using QString::append;
private: private:
static Qt::CaseSensitivity cs; static Qt::CaseSensitivity cs;
FileName(const QString &string); FileName(const QString &string);
......
...@@ -241,7 +241,7 @@ void CMakeRunConfiguration::setCommandLineArguments(const QString &newText) ...@@ -241,7 +241,7 @@ void CMakeRunConfiguration::setCommandLineArguments(const QString &newText)
QString CMakeRunConfiguration::dumperLibrary() const QString CMakeRunConfiguration::dumperLibrary() const
{ {
QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath);
QString dhl = ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); QString dhl = ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData);
return dhl; return dhl;
...@@ -249,7 +249,7 @@ QString CMakeRunConfiguration::dumperLibrary() const ...@@ -249,7 +249,7 @@ QString CMakeRunConfiguration::dumperLibrary() const
QStringList CMakeRunConfiguration::dumperLibraryLocations() const QStringList CMakeRunConfiguration::dumperLibraryLocations() const
{ {
QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment()); Utils::FileName qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt(environment());
QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath); QString qtInstallData = ProjectExplorer::DebuggingHelperLibrary::qtInstallDataDir(qmakePath);
return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData); return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryDirectories(qtInstallData);
} }
......
...@@ -678,26 +678,26 @@ QString DebuggerRunControlFactory::displayName() const ...@@ -678,26 +678,26 @@ QString DebuggerRunControlFactory::displayName() const
} }
// Find Qt installation by running qmake // Find Qt installation by running qmake
static inline QString findQtInstallPath(const QString &qmakePath) static inline QString findQtInstallPath(const Utils::FileName &qmakePath)
{ {
QProcess proc; QProcess proc;
QStringList args; QStringList args;
args.append(_("-query")); args.append(_("-query"));
args.append(_("QT_INSTALL_HEADERS")); args.append(_("QT_INSTALL_HEADERS"));
proc.start(qmakePath, args); proc.start(qmakePath.toString(), args);
if (!proc.waitForStarted()) { 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())); qPrintable(proc.errorString()));
return QString(); return QString();
} }
proc.closeWriteChannel(); proc.closeWriteChannel();
if (!proc.waitForFinished()) { if (!proc.waitForFinished()) {
Utils::SynchronousProcess::stopProcess(proc); 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(); return QString();
} }
if (proc.exitStatus() != QProcess::NormalExit) { 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(); return QString();
} }
const QByteArray ba = proc.readAllStandardOutput().trimmed(); const QByteArray ba = proc.readAllStandardOutput().trimmed();
...@@ -738,7 +738,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu ...@@ -738,7 +738,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
if (const ProjectExplorer::Target *target = runConfiguration->target()) { if (const ProjectExplorer::Target *target = runConfiguration->target()) {
if (QByteArray(target->metaObject()->className()).contains("Qt4")) { 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()) if (!qmake.isEmpty())
sp.qtInstallPath = findQtInstallPath(qmake); sp.qtInstallPath = findQtInstallPath(qmake);
} }
......
...@@ -176,7 +176,12 @@ QString MaemoGlobal::maddeRoot(const QString &qmakePath) ...@@ -176,7 +176,12 @@ QString MaemoGlobal::maddeRoot(const QString &qmakePath)
QString MaemoGlobal::targetRoot(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) QString MaemoGlobal::targetName(const QString &qmakePath)
......
...@@ -179,7 +179,7 @@ bool AbstractMaemoInstallPackageToSysrootStep::init() ...@@ -179,7 +179,7 @@ bool AbstractMaemoInstallPackageToSysrootStep::init()
return false; return false;
} }
m_qmakeCommand = bc->qtVersion()->qmakeCommand(); m_qmakeCommand = bc->qtVersion()->qmakeCommand().toString();
m_packageFilePath = pStep->packageFilePath(); m_packageFilePath = pStep->packageFilePath();
return true; return true;
} }
...@@ -403,12 +403,12 @@ bool MaemoMakeInstallToSysrootStep::init() ...@@ -403,12 +403,12 @@ bool MaemoMakeInstallToSysrootStep::init()
} }
Utils::Environment env = bc->environment(); Utils::Environment env = bc->environment();
MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand()); MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand().toString());
QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand()); QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand().toString());
QStringList args = QStringList() << QLatin1String("-t") 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()); << QLatin1String("install") << (QLatin1String("INSTALL_ROOT=") + qtVersion->systemRoot());
MaemoGlobal::transformMaddeCall(command, args, qtVersion->qmakeCommand()); MaemoGlobal::transformMaddeCall(command, args, qtVersion->qmakeCommand().toString());
processParameters()->setCommand(command); processParameters()->setCommand(command);
processParameters()->setArguments(args.join(QLatin1String(" "))); processParameters()->setArguments(args.join(QLatin1String(" ")));
processParameters()->setEnvironment(env); processParameters()->setEnvironment(env);
......
...@@ -101,7 +101,7 @@ bool AbstractMaemoPackageCreationStep::init() ...@@ -101,7 +101,7 @@ bool AbstractMaemoPackageCreationStep::init()
return false; return false;
} }
m_qmakeCommand = qt4BuildConfiguration()->qtVersion()->qmakeCommand(); m_qmakeCommand = qt4BuildConfiguration()->qtVersion()->qmakeCommand().toString();
return true; return true;
} }
...@@ -292,7 +292,7 @@ bool MaemoDebianPackageCreationStep::init() ...@@ -292,7 +292,7 @@ bool MaemoDebianPackageCreationStep::init()
{ {
if (!AbstractMaemoPackageCreationStep::init()) if (!AbstractMaemoPackageCreationStep::init())
return false; return false;
m_maddeRoot = MaemoGlobal::maddeRoot(qt4BuildConfiguration()->qtVersion()->qmakeCommand()); m_maddeRoot = MaemoGlobal::maddeRoot(qt4BuildConfiguration()->qtVersion()->qmakeCommand().toString());
m_projectDirectory = project()->projectDirectory(); m_projectDirectory = project()->projectDirectory();
m_pkgFileName = maemoTarget()->packageFileName(); m_pkgFileName = maemoTarget()->packageFileName();
m_packageName = maemoTarget()->packageName(); m_packageName = maemoTarget()->packageName();
......
...@@ -378,7 +378,7 @@ void MaemoPublisherFremantleFree::runDpkgBuildPackage() ...@@ -378,7 +378,7 @@ void MaemoPublisherFremantleFree::runDpkgBuildPackage()
emit progressReport(tr("Building source package...")); emit progressReport(tr("Building source package..."));
const QStringList args = QStringList() << QLatin1String("dpkg-buildpackage") const QStringList args = QStringList() << QLatin1String("dpkg-buildpackage")
<< QLatin1String("-S") << QLatin1String("-us") << QLatin1String("-uc"); << 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 // We have to implement the SCP protocol, because the maemo.org
......
...@@ -86,7 +86,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c ...@@ -86,7 +86,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
QtSupport::BaseQtVersion *lqt = qt4Bc->qtVersion(); QtSupport::BaseQtVersion *lqt = qt4Bc->qtVersion();
if (!lqt) if (!lqt)
continue; continue;
if (MaemoGlobal::osType(lqt->qmakeCommand()) == QLatin1String(Maemo5OsType)) if (MaemoGlobal::osType(lqt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
m_buildConfigs << qt4Bc; m_buildConfigs << qt4Bc;
} }
break; break;
......
...@@ -84,7 +84,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p ...@@ -84,7 +84,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
QtSupport::BaseQtVersion *qt = qt4Bc->qtVersion(); QtSupport::BaseQtVersion *qt = qt4Bc->qtVersion();
if (!qt) if (!qt)
continue; continue;
if (MaemoGlobal::osType(qt->qmakeCommand()) == QLatin1String(Maemo5OsType)) if (MaemoGlobal::osType(qt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
return true; return true;
} }
break; break;
......
...@@ -93,14 +93,14 @@ MaemoQemuRuntimeParser::MaemoQemuRuntimeParser(const QString &madInfoOutput, ...@@ -93,14 +93,14 @@ MaemoQemuRuntimeParser::MaemoQemuRuntimeParser(const QString &madInfoOutput,
MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtSupport::BaseQtVersion *qtVersion) MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtSupport::BaseQtVersion *qtVersion)
{ {
MaemoQemuRuntime runtime; MaemoQemuRuntime runtime;
const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion->qmakeCommand()); const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion->qmakeCommand().toString());
QProcess madProc; 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; return runtime;
if (!madProc.waitForStarted() || !madProc.waitForFinished()) if (!madProc.waitForStarted() || !madProc.waitForFinished())
return runtime; return runtime;
const QByteArray &madInfoOutput = madProc.readAllStandardOutput(); 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) runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath)
.parseRuntime(); .parseRuntime();
if (!runtime.m_name.isEmpty()) { if (!runtime.m_name.isEmpty()) {
......
...@@ -52,10 +52,10 @@ MaemoQtVersion::MaemoQtVersion() : QtSupport::BaseQtVersion() ...@@ -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), : QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource),
m_osType(MaemoGlobal::osType(path)), m_osType(MaemoGlobal::osType(path.toString())),
m_isvalidVersion(MaemoGlobal::isValidMaemoQtVersion(path, m_osType)) m_isvalidVersion(MaemoGlobal::isValidMaemoQtVersion(path.toString(), m_osType))
{ {
} }
...@@ -68,7 +68,7 @@ MaemoQtVersion::~MaemoQtVersion() ...@@ -68,7 +68,7 @@ MaemoQtVersion::~MaemoQtVersion()
void MaemoQtVersion::fromMap(const QVariantMap &map) void MaemoQtVersion::fromMap(const QVariantMap &map)
{ {
QtSupport::BaseQtVersion::fromMap(map); QtSupport::BaseQtVersion::fromMap(map);
QString path = qmakeCommand(); QString path = qmakeCommand().toString();
m_osType = MaemoGlobal::osType(path); m_osType = MaemoGlobal::osType(path);
m_isvalidVersion = MaemoGlobal::isValidMaemoQtVersion(path, m_osType); m_isvalidVersion = MaemoGlobal::isValidMaemoQtVersion(path, m_osType);
} }
...@@ -91,7 +91,7 @@ MaemoQtVersion *MaemoQtVersion::clone() const ...@@ -91,7 +91,7 @@ MaemoQtVersion *MaemoQtVersion::clone() const
QString MaemoQtVersion::systemRoot() const QString MaemoQtVersion::systemRoot() const
{ {
if (m_systemRoot.isNull()) { if (m_systemRoot.isNull()) {
QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(qmakeCommand())) QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(qmakeCommand().toString()))
+ QLatin1String("/information")); + QLatin1String("/information"));
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream stream(&file); QTextStream stream(&file);
...@@ -101,7 +101,7 @@ QString MaemoQtVersion::systemRoot() const ...@@ -101,7 +101,7 @@ QString MaemoQtVersion::systemRoot() const
if (list.count() <= 1) if (list.count() <= 1)
continue; continue;
if (list.at(0) == QLatin1String("sysroot")) { if (list.at(0) == QLatin1String("sysroot")) {
m_systemRoot = MaemoGlobal::maddeRoot(qmakeCommand()) m_systemRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString())
+ QLatin1String("/sysroots/") + list.at(1); + QLatin1String("/sysroots/") + list.at(1);
} }
} }
...@@ -178,7 +178,7 @@ QString MaemoQtVersion::osType() const ...@@ -178,7 +178,7 @@ QString MaemoQtVersion::osType() const
void MaemoQtVersion::addToEnvironment(Utils::Environment &env) 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. // Needed to make pkg-config stuff work.
env.prependOrSet(QLatin1String("SYSROOT_DIR"), QDir::toNativeSeparators(systemRoot())); env.prependOrSet(QLatin1String("SYSROOT_DIR"), QDir::toNativeSeparators(systemRoot()));
...@@ -191,7 +191,7 @@ void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const ...@@ -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(maddeRoot)));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin") env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
.arg(MaemoGlobal::targetRoot(qmakeCommand())))); .arg(MaemoGlobal::targetRoot(qmakeCommand().toString()))));
} }
} // namespace Internal } // namespace Internal
......
...@@ -41,7 +41,7 @@ class MaemoQtVersion : public QtSupport::BaseQtVersion ...@@ -41,7 +41,7 @@ class MaemoQtVersion : public QtSupport::BaseQtVersion
{ {
public: public:
MaemoQtVersion(); 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(); ~MaemoQtVersion();
void fromMap(const QVariantMap &map); void fromMap(const QVariantMap &map);
......
...@@ -72,18 +72,19 @@ int MaemoQtVersionFactory::priority() const ...@@ -72,18 +72,19 @@ int MaemoQtVersionFactory::priority() const
return 50; 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); Q_UNUSED(evaluator);
// we are the fallback :) so we don't care what kinf of qt it is // 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()) if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0; return 0;
QString qmakePath = qmakeCommand.toString();
if (MaemoGlobal::isValidMaemo5QtVersion(qmakePath) if (MaemoGlobal::isValidMaemo5QtVersion(qmakePath)
|| MaemoGlobal::isValidHarmattanQtVersion(qmakePath) || MaemoGlobal::isValidHarmattanQtVersion(qmakePath)
|| MaemoGlobal::isValidMeegoQtVersion(qmakePath)) || MaemoGlobal::isValidMeegoQtVersion(qmakePath))
return new MaemoQtVersion(qmakePath, isAutoDetected, autoDetectionSource); return new MaemoQtVersion(qmakeCommand, isAutoDetected, autoDetectionSource);
return 0; return 0;
} }