forked from qt-creator/qt-creator
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 <ulf.hermann@qt.io>
This commit is contained in:
@@ -66,12 +66,9 @@ static inline QString qmlDebugCommandLineArguments(QmlDebugServicesPreset servic
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services,
|
static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services,
|
||||||
Utils::Port port = Utils::Port(),
|
Utils::Port port, bool block = true)
|
||||||
bool block = true)
|
|
||||||
{
|
{
|
||||||
return qmlDebugCommandLineArguments(services, port.isValid() ?
|
return qmlDebugCommandLineArguments(services, QString("port:%1").arg(port.number()), block);
|
||||||
QString::fromLatin1("port:%1").arg(port.number()) :
|
|
||||||
QStringLiteral("port:%qml_port%"), block);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QString qmlDebugNativeArguments(QmlDebugServicesPreset services, bool block = true)
|
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);
|
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
|
} // namespace QmlDebug
|
||||||
|
@@ -283,7 +283,13 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
|
|||||||
addStartDependency(m_profiler);
|
addStartDependency(m_profiler);
|
||||||
|
|
||||||
StandardRunnable debuggee = runnable().as<StandardRunnable>();
|
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())
|
if (!debuggee.commandLineArguments.isEmpty())
|
||||||
arguments += ' ' + debuggee.commandLineArguments;
|
arguments += ' ' + debuggee.commandLineArguments;
|
||||||
|
Reference in New Issue
Block a user