summaryrefslogtreecommitdiff
path: root/src/plugins/qt4projectmanager/qt4project.cpp
diff options
context:
space:
mode:
authordt <qtc-committer@nokia.com>2011-05-04 13:14:46 +0200
committerdt <qtc-committer@nokia.com>2011-05-12 12:23:06 +0200
commit8e171e0be0239c18843fc65784cb91120b252c8f (patch)
tree06900feae14b15b3897fff193cf36dbd44bad8b3 /src/plugins/qt4projectmanager/qt4project.cpp
parent9ef4ea40f27befa4b5b553c3dfa94d979a34748c (diff)
downloadqt-creator-8e171e0be0239c18843fc65784cb91120b252c8f.tar.gz
Qt Version refactoring
Split up target specific code into subclasses. Also change Qt4BuildConfiguration to allow a null qtversion. Remove code that relied on always having a qt version. Also make it possible to remove all qt versions. Completly change the qt in path autodetection to be only a fall back if no configuration was found. Note: For now the old settings are not removed, as such 2.2 and master can coexist. Reviewed-By: hunger
Diffstat (limited to 'src/plugins/qt4projectmanager/qt4project.cpp')
-rw-r--r--src/plugins/qt4projectmanager/qt4project.cpp37
1 files changed, 13 insertions, 24 deletions
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index a2f6674867..8c4b21600a 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -43,6 +43,7 @@
#include "qt4buildconfiguration.h"
#include "findqt4profiles.h"
#include "qmldumptool.h"
+#include "baseqtversion.h"
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
@@ -433,7 +434,9 @@ void Qt4Project::updateCppCodeModel()
QStringList predefinedFrameworkPaths;
QByteArray predefinedMacros;
- QString qtFrameworkPath = activeBC->qtVersion()->frameworkInstallPath();
+ QString qtFrameworkPath;
+ if (activeBC->qtVersion())
+ qtFrameworkPath = activeBC->qtVersion()->frameworkInstallPath();
if (!qtFrameworkPath.isEmpty())
predefinedFrameworkPaths.append(qtFrameworkPath);
@@ -442,7 +445,8 @@ void Qt4Project::updateCppCodeModel()
predefinedMacros = tc->predefinedMacros();
QList<HeaderPath> headers = tc->systemHeaderPaths();
- headers.append(activeBC->qtVersion()->systemHeaderPathes());
+ if (activeBC->qtVersion())
+ headers.append(activeBC->qtVersion()->systemHeaderPathes());
foreach (const HeaderPath &headerPath, headers) {
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
predefinedFrameworkPaths.append(headerPath.path());
@@ -485,26 +489,11 @@ void Qt4Project::updateCppCodeModel()
if (!allIncludePaths.contains(includePath))
allIncludePaths.append(includePath);
}
-
-#if 0 // Experimental PKGCONFIG support
- { // Pkg Config support
- QStringList pkgConfig = pro->variableValue(PkgConfigVar);
- if (!pkgConfig.isEmpty()) {
- pkgConfig.prepend("--cflags-only-I");
- QProcess process;
- process.start("pkg-config", pkgConfig);
- process.waitForFinished();
- QString result = process.readAllStandardOutput();
- foreach(const QString &part, result.trimmed().split(' ', QString::SkipEmptyParts)) {
- info.includes.append(part.mid(2)); // Chop off "-I"
- }
- }
- }
-#endif
}
// Add mkspec directory
- allIncludePaths.append(activeBC->qtVersion()->mkspecPath());
+ if (activeBC->qtVersion())
+ allIncludePaths.append(activeBC->qtVersion()->mkspecPath());
allIncludePaths.append(predefinedIncludePaths);
@@ -565,9 +554,9 @@ void Qt4Project::updateQmlJSCodeModel()
}
bool preferDebugDump = false;
if (activeTarget() && activeTarget()->activeBuildConfiguration()) {
- preferDebugDump = activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & QtVersion::DebugBuild;
- const QtVersion *qtVersion = activeTarget()->activeBuildConfiguration()->qtVersion();
- if (qtVersion->isValid()) {
+ preferDebugDump = activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild;
+ BaseQtVersion *qtVersion = activeTarget()->activeBuildConfiguration()->qtVersion();
+ if (qtVersion && qtVersion->isValid()) {
const QString qtVersionImportPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
if (!qtVersionImportPath.isEmpty())
projectInfo.importPaths += qtVersionImportPath;
@@ -885,8 +874,8 @@ ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Q
bc = activeTarget()->activeBuildConfiguration();
if (bc) {
- QtVersion *version = bc->qtVersion();
- if (version->isValid()) {
+ BaseQtVersion *version = bc->qtVersion();
+ if (version && version->isValid()) {
m_proFileOption->properties = version->versionInfo();
if (bc->toolChain())
m_proFileOption->sysroot = bc->qtVersion()->systemRoot();