QmlProfiler: user defined host:port

Reviewed-by: Kai Koehne
This commit is contained in:
Christiaan Janssen
2011-04-14 15:44:43 +02:00
parent fa2b294264
commit 19190384b6
5 changed files with 14 additions and 14 deletions

View File

@@ -61,6 +61,8 @@ AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *
sp.debuggee = rc->executable(); sp.debuggee = rc->executable();
sp.debuggeeArgs = rc->commandLineArguments(); sp.debuggeeArgs = rc->commandLineArguments();
sp.displayName = rc->displayName(); sp.displayName = rc->displayName();
sp.connParams.host = QLatin1String("localhost");
sp.connParams.port = rc->qmlDebugServerPort();
return sp; return sp;
} }

View File

@@ -147,7 +147,7 @@ bool QmlProfilerEngine::QmlProfilerEnginePrivate::launchperfmonitor()
m_process = new QProcess(); 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(" ")); arguments.append(m_params.debuggeeArgs.split(" "));
if (QmlProfilerPlugin::debugOutput) if (QmlProfilerPlugin::debugOutput)
@@ -174,7 +174,7 @@ bool QmlProfilerEngine::QmlProfilerEnginePrivate::launchperfmonitor()
} }
if (QmlProfilerPlugin::debugOutput) 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; return true;
} }

View File

@@ -76,10 +76,6 @@
using namespace Analyzer; using namespace Analyzer;
using namespace QmlProfiler::Internal; using namespace QmlProfiler::Internal;
QString QmlProfilerTool::host = QLatin1String("localhost");
quint16 QmlProfilerTool::port = 33456;
// Adapter for output pane. // Adapter for output pane.
class QmlProfilerOutputPaneAdapter : public Analyzer::IAnalyzerOutputPaneAdapter class QmlProfilerOutputPaneAdapter : public Analyzer::IAnalyzerOutputPaneAdapter
{ {
@@ -124,6 +120,8 @@ public:
QAction *m_attachAction; QAction *m_attachAction;
QToolButton *m_recordButton; QToolButton *m_recordButton;
bool m_recordingEnabled; bool m_recordingEnabled;
QString m_host;
quint64 m_port;
}; };
QmlProfilerTool::QmlProfilerTool(QObject *parent) QmlProfilerTool::QmlProfilerTool(QObject *parent)
@@ -170,6 +168,9 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp
{ {
QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration); QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration);
d->m_host = sp.connParams.host;
d->m_port = sp.connParams.port;
d->m_runConfiguration = runConfiguration; d->m_runConfiguration = runConfiguration;
d->m_project = runConfiguration->target()->project(); d->m_project = runConfiguration->target()->project();
if (d->m_project) { if (d->m_project) {
@@ -291,7 +292,7 @@ void QmlProfilerTool::connectClient()
delete d->m_client; delete d->m_client;
d->m_client = newClient; d->m_client = newClient;
d->m_client->connectToHost(host, port); d->m_client->connectToHost(d->m_host, d->m_port);
d->m_client->waitForConnected(); d->m_client->waitForConnected();
if (d->m_client->isConnected()) { if (d->m_client->isConnected()) {
@@ -392,8 +393,8 @@ void QmlProfilerTool::attach()
if (result == QDialog::Rejected) if (result == QDialog::Rejected)
return; return;
port = dialog.port(); d->m_port = dialog.port();
host = dialog.address(); d->m_host = dialog.address();
connectClient(); connectClient();
AnalyzerManager::instance()->showMode(); AnalyzerManager::instance()->showMode();

View File

@@ -81,11 +81,6 @@ signals:
void fetchingData(bool); void fetchingData(bool);
void connectionFailed(); void connectionFailed();
public:
// Todo: configurable parameters
static QString host;
static quint16 port;
private slots: private slots:
void updateProjectFileList(); void updateProjectFileList();
void attach(); void attach();

View File

@@ -57,6 +57,8 @@ AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *
sp.debuggee = rc->observerPath(); sp.debuggee = rc->observerPath();
sp.debuggeeArgs = rc->viewerArguments(); sp.debuggeeArgs = rc->viewerArguments();
sp.displayName = rc->displayName(); sp.displayName = rc->displayName();
sp.connParams.host = QLatin1String("localhost");
sp.connParams.port = rc->qmlDebugServerPort();
return sp; return sp;
} }