diff --git a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp b/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp index e919c82f62b..d698acddd4c 100644 --- a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp +++ b/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp @@ -61,6 +61,8 @@ AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration * sp.debuggee = rc->executable(); sp.debuggeeArgs = rc->commandLineArguments(); sp.displayName = rc->displayName(); + sp.connParams.host = QLatin1String("localhost"); + sp.connParams.port = rc->qmlDebugServerPort(); return sp; } diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 06bb1647aeb..3489ed1d1ca 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -147,7 +147,7 @@ bool QmlProfilerEngine::QmlProfilerEnginePrivate::launchperfmonitor() m_process = new QProcess(); - QStringList arguments("-qmljsdebugger=port:" + QString::number(QmlProfilerTool::port) + ",block"); + QStringList arguments("-qmljsdebugger=port:" + QString::number(m_params.connParams.port) + ",block"); arguments.append(m_params.debuggeeArgs.split(" ")); if (QmlProfilerPlugin::debugOutput) @@ -174,7 +174,7 @@ bool QmlProfilerEngine::QmlProfilerEnginePrivate::launchperfmonitor() } if (QmlProfilerPlugin::debugOutput) - qWarning("QmlProfiler: Connecting to %s:%d", qPrintable(QmlProfilerTool::host), QmlProfilerTool::port); + qWarning("QmlProfiler: Connecting to %s:%d", qPrintable(m_params.connParams.host), m_params.connParams.port); return true; } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 7f1c382321e..601a73ceaf8 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -76,10 +76,6 @@ using namespace Analyzer; using namespace QmlProfiler::Internal; -QString QmlProfilerTool::host = QLatin1String("localhost"); -quint16 QmlProfilerTool::port = 33456; - - // Adapter for output pane. class QmlProfilerOutputPaneAdapter : public Analyzer::IAnalyzerOutputPaneAdapter { @@ -124,6 +120,8 @@ public: QAction *m_attachAction; QToolButton *m_recordButton; bool m_recordingEnabled; + QString m_host; + quint64 m_port; }; QmlProfilerTool::QmlProfilerTool(QObject *parent) @@ -170,6 +168,9 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp { QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration); + d->m_host = sp.connParams.host; + d->m_port = sp.connParams.port; + d->m_runConfiguration = runConfiguration; d->m_project = runConfiguration->target()->project(); if (d->m_project) { @@ -291,7 +292,7 @@ void QmlProfilerTool::connectClient() delete d->m_client; d->m_client = newClient; - d->m_client->connectToHost(host, port); + d->m_client->connectToHost(d->m_host, d->m_port); d->m_client->waitForConnected(); if (d->m_client->isConnected()) { @@ -392,8 +393,8 @@ void QmlProfilerTool::attach() if (result == QDialog::Rejected) return; - port = dialog.port(); - host = dialog.address(); + d->m_port = dialog.port(); + d->m_host = dialog.address(); connectClient(); AnalyzerManager::instance()->showMode(); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h index 5e7ec67c00a..a59361929e0 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.h +++ b/src/plugins/qmlprofiler/qmlprofilertool.h @@ -81,11 +81,6 @@ signals: void fetchingData(bool); void connectionFailed(); -public: - // Todo: configurable parameters - static QString host; - static quint16 port; - private slots: void updateProjectFileList(); void attach(); diff --git a/src/plugins/qmlprofiler/qmlprojectanalyzerruncontrolfactory.cpp b/src/plugins/qmlprofiler/qmlprojectanalyzerruncontrolfactory.cpp index e310335ed54..14e72bd0776 100644 --- a/src/plugins/qmlprofiler/qmlprojectanalyzerruncontrolfactory.cpp +++ b/src/plugins/qmlprofiler/qmlprojectanalyzerruncontrolfactory.cpp @@ -57,6 +57,8 @@ AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration * sp.debuggee = rc->observerPath(); sp.debuggeeArgs = rc->viewerArguments(); sp.displayName = rc->displayName(); + sp.connParams.host = QLatin1String("localhost"); + sp.connParams.port = rc->qmlDebugServerPort(); return sp; }