Move URL utilities from ProjectExplorer to Utils

This way we can access them from the qmldebug library.

Change-Id: I90ba80228f44a9d5ea825ad59f4bd1572969980e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2017-09-29 12:41:53 +02:00
parent 2f9d82791e
commit fb370f460d
12 changed files with 144 additions and 72 deletions

View File

@@ -48,6 +48,7 @@
#include <utils/qtcassert.h>
#include <utils/qtcfallthrough.h>
#include <utils/url.h>
#include <QMessageBox>
@@ -247,12 +248,12 @@ static QUrl localServerUrl(RunControl *runControl)
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
if (version) {
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0))
serverUrl = urlFromLocalSocket();
serverUrl = Utils::urlFromLocalSocket();
else
serverUrl = urlFromLocalHostAndFreePort();
serverUrl = Utils::urlFromLocalHostAndFreePort();
} else {
qWarning("Running QML profiler on Kit without Qt version?");
serverUrl = urlFromLocalHostAndFreePort();
serverUrl = Utils::urlFromLocalHostAndFreePort();
}
return serverUrl;
}
@@ -278,9 +279,9 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
StandardRunnable debuggee = runnable().as<StandardRunnable>();
QString code;
if (serverUrl.scheme() == urlSocketScheme())
if (serverUrl.scheme() == Utils::urlSocketScheme())
code = QString("file:%1").arg(serverUrl.path());
else if (serverUrl.scheme() == urlTcpScheme())
else if (serverUrl.scheme() == Utils::urlTcpScheme())
code = QString("port:%1").arg(serverUrl.port());
else
QTC_CHECK(false);