diff options
author | David Schulz <david.schulz@qt.io> | 2017-12-08 13:54:19 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2018-01-15 13:52:47 +0000 |
commit | 09f43ade822ae73a74fb4c7997e022dafbf283d1 (patch) | |
tree | 3d59a5b95ad412a5f745ab631f052ee5c68b7b36 | |
parent | 4eabcda3a1ccce6cd503a29c86f65ce1c024a5d3 (diff) | |
download | qt-creator-09f43ade822ae73a74fb4c7997e022dafbf283d1.tar.gz |
ProjectExplorer: add source location path to the qt version
Change-Id: I1826c0cbd8f50be91625b81aee04db4cd1310385
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/plugins/qtsupport/baseqtversion.cpp | 9 | ||||
-rw-r--r-- | src/plugins/qtsupport/baseqtversion.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 3b022db233..d8806023fb 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -71,6 +71,7 @@ using namespace Utils; static const char QTVERSIONAUTODETECTED[] = "isAutodetected"; static const char QTVERSIONAUTODETECTIONSOURCE []= "autodetectionSource"; static const char QTVERSIONQMAKEPATH[] = "QMakePath"; +static const char QTVERSIONSOURCEPATH[] = "SourcePath"; static const char MKSPEC_VALUE_LIBINFIX[] = "QT_LIBINFIX"; static const char MKSPEC_VALUE_NAMESPACE[] = "QT_NAMESPACE"; @@ -665,6 +666,9 @@ void BaseQtVersion::fromMap(const QVariantMap &map) if (string.startsWith(QLatin1Char('~'))) string.remove(0, 1).prepend(QDir::homePath()); + m_qtSources = Utils::FileName::fromUserInput( + map.value(QTVERSIONSOURCEPATH).toString()); + QFileInfo fi(string); if (BuildableHelperLibrary::isQtChooser(fi)) { // we don't want to treat qtchooser as a normal qmake @@ -899,6 +903,11 @@ FileName BaseQtVersion::sourcePath() const return m_sourcePath; } +FileName BaseQtVersion::qtPackageSourcePath() const +{ + return m_qtSources; +} + QString BaseQtVersion::designerCommand() const { if (!isValid()) diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index eeaa45b01d..8b23d827f3 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -133,7 +133,10 @@ public: virtual void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const; virtual Utils::Environment qmakeRunEnvironment() const; + // source path defined by qmake property QT_INSTALL_PREFIX/src or by qmake.stash QT_SOURCE_TREE virtual Utils::FileName sourcePath() const; + // returns source path for installed qt packages and empty string for self build qt + Utils::FileName qtPackageSourcePath() const; bool isInSourceDirectory(const Utils::FileName &filePath); bool isSubProject(const Utils::FileName &filePath) const; @@ -292,6 +295,7 @@ private: QString m_unexpandedDisplayName; QString m_autodetectionSource; mutable Utils::FileName m_sourcePath; + mutable Utils::FileName m_qtSources; mutable Utils::FileName m_mkspec; mutable Utils::FileName m_mkspecFullPath; |