summaryrefslogtreecommitdiff
path: root/src/plugins/qt4projectmanager
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2010-09-29 16:40:13 +0200
committerKai Koehne <kai.koehne@nokia.com>2010-09-30 12:02:26 +0200
commit88a36fe34c49ebcaddb701ae890014276ac4bb8f (patch)
tree6c1b85c63d36dd012a5739015ef782da7c9d0baa /src/plugins/qt4projectmanager
parenta9514a388278524e2a261c32f15cad3503e33522 (diff)
downloadqt-creator-88a36fe34c49ebcaddb701ae890014276ac4bb8f.tar.gz
DebuggingHelpers: Check for Qt version instead checking private files
The location private includes might still change with 4.7.1 . Better check the qt version string. Reviewed-by: Lasse Holmstedt
Diffstat (limited to 'src/plugins/qt4projectmanager')
-rw-r--r--src/plugins/qt4projectmanager/qmldumptool.cpp5
-rw-r--r--src/plugins/qt4projectmanager/qmldumptool.h3
-rw-r--r--src/plugins/qt4projectmanager/qmlobservertool.cpp6
-rw-r--r--src/plugins/qt4projectmanager/qmlobservertool.h4
-rw-r--r--src/plugins/qt4projectmanager/qtversionmanager.cpp4
5 files changed, 12 insertions, 10 deletions
diff --git a/src/plugins/qt4projectmanager/qmldumptool.cpp b/src/plugins/qt4projectmanager/qmldumptool.cpp
index 210c0182fd..5d11f0dec9 100644
--- a/src/plugins/qt4projectmanager/qmldumptool.cpp
+++ b/src/plugins/qt4projectmanager/qmldumptool.cpp
@@ -50,10 +50,9 @@ static inline QStringList validBinaryFilenames()
<< QLatin1String("qmldump.app/Contents/MacOS/qmldump");
}
-bool QmlDumpTool::canBuild(const QString &installHeadersDir)
+bool QmlDumpTool::canBuild(QtVersion *qtVersion)
{
- QString qDeclHeader = installHeadersDir + QLatin1String("/QtDeclarative/private/qdeclarativemetatype_p.h");
- return QFile::exists(qDeclHeader);
+ return checkMinimumQtVersion(qtVersion->qtVersionString(), 4, 7, 0);
}
QString QmlDumpTool::toolForProject(ProjectExplorer::Project *project)
diff --git a/src/plugins/qt4projectmanager/qmldumptool.h b/src/plugins/qt4projectmanager/qmldumptool.h
index 4c54838b6f..dc99147807 100644
--- a/src/plugins/qt4projectmanager/qmldumptool.h
+++ b/src/plugins/qt4projectmanager/qmldumptool.h
@@ -42,11 +42,12 @@ namespace ProjectExplorer {
}
namespace Qt4ProjectManager {
+class QtVersion;
class QT4PROJECTMANAGER_EXPORT QmlDumpTool : public Utils::BuildableHelperLibrary
{
public:
- static bool canBuild(const QString &installHeadersDir);
+ static bool canBuild(QtVersion *qtVersion);
static QString toolForProject(ProjectExplorer::Project *project);
static QString toolByInstallData(const QString &qtInstallData);
static QStringList locationsByInstallData(const QString &qtInstallData);
diff --git a/src/plugins/qt4projectmanager/qmlobservertool.cpp b/src/plugins/qt4projectmanager/qmlobservertool.cpp
index 3a64da2ed7..7b556f2a31 100644
--- a/src/plugins/qt4projectmanager/qmlobservertool.cpp
+++ b/src/plugins/qt4projectmanager/qmlobservertool.cpp
@@ -32,6 +32,7 @@
#include "qt4project.h"
#include "qt4projectmanagerconstants.h"
#include <coreplugin/icore.h>
+#include <utils/qtcassert.h>
#include <projectexplorer/project.h>
#include <QDesktopServices>
@@ -50,10 +51,9 @@ static inline QStringList validBinaryFilenames()
<< QLatin1String("QMLObserver.app/Contents/MacOS/QMLObserver");
}
-bool QmlObserverTool::canBuild(const QString &installHeadersDir)
+bool QmlObserverTool::canBuild(QtVersion *qtVersion)
{
- QString qDeclHeader = installHeadersDir + QLatin1String("/QtDeclarative/private/qdeclarativemetatype_p.h");
- return QFile::exists(qDeclHeader);
+ return checkMinimumQtVersion(qtVersion->qtVersionString(), 4, 7, 1);
}
QString QmlObserverTool::toolForProject(ProjectExplorer::Project *project)
diff --git a/src/plugins/qt4projectmanager/qmlobservertool.h b/src/plugins/qt4projectmanager/qmlobservertool.h
index 625e625c76..89cbca6746 100644
--- a/src/plugins/qt4projectmanager/qmlobservertool.h
+++ b/src/plugins/qt4projectmanager/qmlobservertool.h
@@ -43,10 +43,12 @@ namespace ProjectExplorer {
namespace Qt4ProjectManager {
+class QtVersion;
+
class QT4PROJECTMANAGER_EXPORT QmlObserverTool : public Utils::BuildableHelperLibrary
{
public:
- static bool canBuild(const QString &installHeadersDir);
+ static bool canBuild(QtVersion *qtVersion);
static QString toolForProject(ProjectExplorer::Project *project);
static QString toolByInstallData(const QString &qtInstallData);
static QStringList locationsByInstallData(const QString &qtInstallData);
diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp
index b6edfbfb14..283f52ba44 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.cpp
+++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp
@@ -1770,7 +1770,7 @@ QString QtVersion::buildDebuggingHelperLibrary(QFutureInterface<void> &future)
}
future.setProgressValue(2);
- if (QmlDumpTool::canBuild(qtInstallHeaders)) {
+ if (QmlDumpTool::canBuild(this)) {
QString toolDirectory = QmlDumpTool::copy(qtInstallData, &output);
if (!toolDirectory.isEmpty()) {
output += QmlDumpTool::build(toolDirectory, tc->makeCommand(),
@@ -1782,7 +1782,7 @@ QString QtVersion::buildDebuggingHelperLibrary(QFutureInterface<void> &future)
}
future.setProgressValue(3);
- if (QmlObserverTool::canBuild(qtInstallHeaders)) {
+ if (QmlObserverTool::canBuild(this)) {
QString toolDirectory = QmlObserverTool::copy(qtInstallData, &output);
if (!toolDirectory.isEmpty()) {
output += QmlObserverTool::build(toolDirectory, tc->makeCommand(),