QmlProject: Disable debug action if qmlobserver cannot be built

QmlObserver right now requires 4.7.1 minimum. There's no gain in
telling the user that he needs qmlobserver to debug, if it can't be
build with 4.7.0 anyway.

Reviewed-by: Christiaan Janssen
This commit is contained in:
Kai Koehne
2010-10-05 10:54:05 +02:00
parent 1e19803e6e
commit 6267671858
3 changed files with 41 additions and 21 deletions

View File

@@ -43,6 +43,8 @@
#include <debugger/debuggeruiswitcher.h>
#include <debugger/debuggerengine.h>
#include <qmljsinspector/qmljsinspectorconstants.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qt4projectmanager/qmlobservertool.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <QApplication>
@@ -148,9 +150,18 @@ bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration,
} else {
bool qmlDebugSupportInstalled = Debugger::DebuggerUISwitcher::instance()->supportedLanguages()
& Debugger::QmlLanguage;
// don't check for qmlobserver already here because we can't update the run buttons
// if it has been built in the meantime
return (config != 0) && qmlDebugSupportInstalled;
if (config && qmlDebugSupportInstalled) {
if (!config->observerPath().isEmpty()) {
return true;
}
if (config->qtVersion() && Qt4ProjectManager::QmlObserverTool::canBuild(config->qtVersion())) {
return true;
} else {
return false;
}
}
}
return false;