Skip to content
Snippets Groups Projects
Commit 408a8273 authored by Alessandro Portale's avatar Alessandro Portale
Browse files

No hardcoded QMLINSPECTOR_PATH in the qml app .pro file.

Instead of hardcoding a Qt Creator path into the standalone Qml
app .pro file by assigning a value to QMLINSPECTOR_PATH, we let
Qt Creator set that value as command line argument when calling
qmake.

QMakeStep::allArguments() is the place where it is added right
dt will will certainly suggest a better place place for it.
parent 254aff39
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,4 @@ symbian:TARGET.UID3 = 0xE1111234
# QMLINSPECTOR #
#DEFINES += QMLINSPECTOR
# Path to the Qml Inspector sources, which are shipped with Qt Creator
# QMLINSPECTOR_PATH #
QMLINSPECTOR_PATH = $$PWD/../../qmljsdebugger
include($$PWD/qmlapplication.pri)
......@@ -9,7 +9,12 @@ INCLUDEPATH += cpp
contains(DEFINES, QMLINSPECTOR) {
CONFIG(debug, debug|release) {
include($$QMLINSPECTOR_PATH/qmljsdebugger-lib.pri)
isEmpty(QMLINSPECTOR_PATH) {
warning(QMLINSPECTOR_PATH was not set. QMLINSPECTOR not activated.)
DEFINES -= QMLINSPECTOR
} else {
include($$QMLINSPECTOR_PATH/qmljsdebugger-lib.pri)
}
} else {
DEFINES -= QMLINSPECTOR
}
......
......@@ -290,8 +290,6 @@ QByteArray QmlStandaloneApp::generateProFile(const QString *errorMessage) const
uncommentNextLine = true;
} else if (line.contains(QLatin1String("# NETWORKACCESS")) && !m_networkEnabled) {
uncommentNextLine = true;
} else if (line.contains(QLatin1String("# QMLINSPECTOR_PATH"))) {
valueOnNextLine = qmlInspectorSourcesRoot();
} else if (line.contains(QLatin1String("# QMLINSPECTOR"))) {
// ### disabled for now; figure out the private headers problem first.
//uncommentNextLine = true;
......@@ -326,11 +324,6 @@ QString QmlStandaloneApp::templatesRoot()
return Core::ICore::instance()->resourcePath() + QLatin1String("/templates/qmlapp/");
}
QString QmlStandaloneApp::qmlInspectorSourcesRoot()
{
return Core::ICore::instance()->resourcePath() + QLatin1String("/qmljsdebugger");
}
static Core::GeneratedFile generateFileCopy(const QString &source,
const QString &target,
bool openEditor = false)
......
......@@ -99,7 +99,6 @@ private:
QByteArray generateMainCpp(const QString *errorMessage) const;
QByteArray generateProFile(const QString *errorMessage) const;
static QString templatesRoot();
static QString qmlInspectorSourcesRoot();
QString m_projectName;
QFileInfo m_projectPath;
......
......@@ -140,6 +140,9 @@ QStringList QMakeStep::allArguments()
if (!additonalArguments.isEmpty())
arguments << additonalArguments;
arguments << QLatin1String(Constants::QMAKEVAR_QMLINSPECTOR_PATH) + QLatin1Char('=') +
Core::ICore::instance()->resourcePath() + QLatin1String("/qmljsdebugger");
return arguments;
}
......
......@@ -109,6 +109,9 @@ const char * const QT_SIMULATOR_TARGET_ID("Qt4ProjectManager.Target.QtSimulatorT
const char * const ICON_QT_PROJECT = ":/qt4projectmanager/images/qt_project.png";
const char * const ICON_WINDOW = ":/qt4projectmanager/images/window.png";
// Env variables
const char * const QMAKEVAR_QMLINSPECTOR_PATH = "QMLINSPECTOR_PATH";
} // namespace Constants
} // namespace Qt4ProjectManager
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment