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
......@@ -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()));
}
ToolChain *LinuxIccToolChain::clone() const
......
......@@ -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;
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -61,7 +61,7 @@ public:
QString typeName() const;
QString mkspec() const;
Utils::FileName mkspec() const;
QString ceVer() const;
......
......@@ -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());
}
......
......@@ -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();
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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");
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment