summaryrefslogtreecommitdiff
path: root/src/plugins/madde/maemoqtversion.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2012-04-24 15:49:09 +0200
committerTobias Hunger <tobias.hunger@nokia.com>2012-06-21 12:08:12 +0200
commit24314562165588b56a318b3b8a846bf5deda7c41 (patch)
treeb5dcf951e76d003c2623011b0e91994e06e7e061 /src/plugins/madde/maemoqtversion.cpp
parent8c77b8c9d7b25d0c89003c8c4a54e8da5bfb7edd (diff)
downloadqt-creator-24314562165588b56a318b3b8a846bf5deda7c41.tar.gz
Profile introduction
Introduce Profiles to store sets of values that describe a system/device. These profiles are held by a target, getting rid of much of the information stored in the Build-/Run-/DeployConfigurations, greatly simplifying those. This is a squash of the wip/profile branch which has been on gerrit for a while, rebased to current master. Change-Id: I25956c8dd4d1962b2134bfaa8a8076ae3909460f Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/madde/maemoqtversion.cpp')
-rw-r--r--src/plugins/madde/maemoqtversion.cpp65
1 files changed, 21 insertions, 44 deletions
diff --git a/src/plugins/madde/maemoqtversion.cpp b/src/plugins/madde/maemoqtversion.cpp
index 074dfac6fb..255bee8911 100644
--- a/src/plugins/madde/maemoqtversion.cpp
+++ b/src/plugins/madde/maemoqtversion.cpp
@@ -34,6 +34,7 @@
#include "maemoconstants.h"
#include "maemoglobal.h"
+#include <projectexplorer/profileinformation.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/qtsupportconstants.h>
@@ -97,28 +98,6 @@ MaemoQtVersion *MaemoQtVersion::clone() const
return new MaemoQtVersion(*this);
}
-QString MaemoQtVersion::systemRoot() const
-{
- if (m_systemRoot.isNull()) {
- QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(qmakeCommand().toString()))
- + QLatin1String("/information"));
- if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QTextStream stream(&file);
- while (!stream.atEnd()) {
- const QString &line = stream.readLine().trimmed();
- const QStringList &list = line.split(QLatin1Char(' '));
- if (list.count() <= 1)
- continue;
- if (list.at(0) == QLatin1String("sysroot")) {
- m_systemRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString())
- + QLatin1String("/sysroots/") + list.at(1);
- }
- }
- }
- }
- return m_systemRoot;
-}
-
QList<ProjectExplorer::Abi> MaemoQtVersion::detectQtAbis() const
{
QList<ProjectExplorer::Abi> result;
@@ -141,26 +120,6 @@ QList<ProjectExplorer::Abi> MaemoQtVersion::detectQtAbis() const
return result;
}
-bool MaemoQtVersion::supportsTargetId(const Core::Id id) const
-{
- return supportedTargetIds().contains(id);
-}
-
-QSet<Core::Id> MaemoQtVersion::supportedTargetIds() const
-{
- QSet<Core::Id> result;
- if (!isValid())
- return result;
- if (m_deviceType == Core::Id(Maemo5OsType)) {
- result.insert(Core::Id(Constants::MAEMO5_DEVICE_TARGET_ID));
- } else if (m_deviceType == Core::Id(HarmattanOsType)) {
- result.insert(Core::Id(Constants::HARMATTAN_DEVICE_TARGET_ID));
- } else if (m_deviceType == Core::Id(MeeGoOsType)) {
- result.insert(Core::Id(Constants::MEEGO_DEVICE_TARGET_ID));
- }
- return result;
-}
-
QString MaemoQtVersion::description() const
{
if (m_deviceType == Core::Id(Maemo5OsType))
@@ -200,20 +159,30 @@ Core::FeatureSet MaemoQtVersion::availableFeatures() const
QString MaemoQtVersion::platformName() const
{
+ if (m_deviceType == Maemo5OsType)
+ return QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM);
+ if (m_deviceType == MeeGoOsType)
+ return QLatin1String(QtSupport::Constants::MEEGO_PLATFORM);
return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM);
}
QString MaemoQtVersion::platformDisplayName() const
{
+ if (m_deviceType == Maemo5OsType)
+ return QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM_TR);
+ if (m_deviceType == MeeGoOsType)
+ return QLatin1String(QtSupport::Constants::MEEGO_PLATFORM_TR);
return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM_TR);
}
-void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const
+void MaemoQtVersion::addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const
{
+ Q_UNUSED(p);
const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString());
// Needed to make pkg-config stuff work.
- env.prependOrSet(QLatin1String("SYSROOT_DIR"), QDir::toNativeSeparators(systemRoot()));
+ Utils::FileName sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(p);
+ env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysRoot.toUserOutput());
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
.arg(maddeRoot)));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib")
@@ -224,6 +193,14 @@ 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().toString()))));
+
+ // Actually this is tool chain related, but since we no longer have a tool chain...
+ const QString manglePathsKey = QLatin1String("GCCWRAPPER_PATHMANGLE");
+ if (!env.hasKey(manglePathsKey)) {
+ const QStringList pathsToMangle = QStringList() << QLatin1String("/lib")
+ << QLatin1String("/opt") << QLatin1String("/usr");
+ env.set(manglePathsKey, pathsToMangle.join(QLatin1String(":")));
+ }
}
} // namespace Internal