Commit 2edbefcb authored by hjk's avatar hjk

QmlDebug: Streamline command line parameter creation

We always have a port now in advance and can construct the
command line directly.

Change-Id: I12dba553f4ef073d7c5b00477baf9fa0e5596bdb
Reviewed-by: Ulf Hermann's avatarUlf Hermann <ulf.hermann@qt.io>
parent a31ec668
......@@ -66,12 +66,9 @@ static inline QString qmlDebugCommandLineArguments(QmlDebugServicesPreset servic
}
static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services,
Utils::Port port = Utils::Port(),
bool block = true)
Utils::Port port, bool block = true)
{
return qmlDebugCommandLineArguments(services, port.isValid() ?
QString::fromLatin1("port:%1").arg(port.number()) :
QStringLiteral("port:%qml_port%"), block);
return qmlDebugCommandLineArguments(services, QString("port:%1").arg(port.number()), block);
}
static inline QString qmlDebugNativeArguments(QmlDebugServicesPreset services, bool block = true)
......@@ -85,15 +82,4 @@ static inline QString qmlDebugLocalArguments(QmlDebugServicesPreset services, co
return qmlDebugCommandLineArguments(services, QLatin1String("file:") + socket, block);
}
static inline QString qmlDebugArguments(QmlDebugServicesPreset services, const QUrl &serverUrl,
bool block = true)
{
if (serverUrl.scheme() == "socket")
return qmlDebugCommandLineArguments(services, "file:" + serverUrl.path(), block);
else
return qmlDebugCommandLineArguments(services, serverUrl.port() != -1 ?
QString("port:%1").arg(serverUrl.port()) :
"port:%qml_port%", block);
}
} // namespace QmlDebug
......@@ -283,7 +283,13 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
addStartDependency(m_profiler);
StandardRunnable debuggee = runnable().as<StandardRunnable>();
QString arguments = QmlDebug::qmlDebugArguments(QmlDebug::QmlProfilerServices, serverUrl);
QString code = serverUrl.scheme() == "socket"
? QString("file:%1").arg(serverUrl.path())
: QString("port:%1").arg(serverUrl.port());
QString arguments = QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices,
code, true);
if (!debuggee.commandLineArguments.isEmpty())
arguments += ' ' + debuggee.commandLineArguments;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment