forked from qt-creator/qt-creator
QmlProfiler: user defined host:port
Reviewed-by: Kai Koehne
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user