Commit f82bb1ec authored by hjk's avatar hjk

ProjectExplorer: Remove Connection as concept

It turns out that one "Connection" per RunControl doesn't map
well to the uses we have. Instead, RunWorkers need to know
individually how to connect to the place where they can work,
but they are already specific enough to be able to use a
standard class (like QUrl) as their way to specify the needed
entry point.

In theory one could see a RunControl's connection as an
aggregation of its workers connection bits, but that does
not really seem to be needed in code.

As consequence, replace UrlConnection by a plain QUrl, and also
the HostName connection by a QUrl with hostName set.

Change-Id: I40c97e37779314ac0a77041e864a18eadb78f987
Reviewed-by: Vikas Pachdha's avatarVikas Pachdha <vikas.pachdha@qt.io>
parent 72775ab8
...@@ -104,9 +104,11 @@ IDevice::Ptr AndroidDevice::clone() const ...@@ -104,9 +104,11 @@ IDevice::Ptr AndroidDevice::clone() const
return IDevice::Ptr(new AndroidDevice(*this)); return IDevice::Ptr(new AndroidDevice(*this));
} }
Connection AndroidDevice::toolControlChannel(const ControlChannelHint &) const QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const
{ {
return HostName("localhost"); QUrl url;
url.setHost("localhost");
return url;
} }
} // namespace Internal } // namespace Internal
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
Utils::OsType osType() const override; Utils::OsType osType() const override;
ProjectExplorer::IDevice::Ptr clone() const override; ProjectExplorer::IDevice::Ptr clone() const override;
ProjectExplorer::Connection toolControlChannel(const ControlChannelHint &) const override; QUrl toolControlChannel(const ControlChannelHint &) const override;
protected: protected:
friend class AndroidDeviceFactory; friend class AndroidDeviceFactory;
......
...@@ -2179,9 +2179,8 @@ void DebuggerPluginPrivate::attachToQmlPort() ...@@ -2179,9 +2179,8 @@ void DebuggerPluginPrivate::attachToQmlPort()
if (device) { if (device) {
QSsh::SshConnectionParameters sshParameters = device->sshParameters(); QSsh::SshConnectionParameters sshParameters = device->sshParameters();
rp.remoteChannel = QString("%1:%2").arg(sshParameters.host).arg(sshParameters.port); rp.remoteChannel = QString("%1:%2").arg(sshParameters.host).arg(sshParameters.port);
Connection toolControl = device->toolControlChannel(IDevice::QmlControlChannel); QUrl toolControl = device->toolControlChannel(IDevice::QmlControlChannel);
QTC_ASSERT(toolControl.is<HostName>(), return); rp.qmlServer.host = toolControl.host();
rp.qmlServer.host = toolControl.as<HostName>().host();
} }
rp.qmlServer.port = Utils::Port(dlg.port()); rp.qmlServer.port = Utils::Port(dlg.port());
rp.startMode = AttachToRemoteProcess; rp.startMode = AttachToRemoteProcess;
......
...@@ -382,7 +382,7 @@ IosQmlProfilerSupport::IosQmlProfilerSupport(RunControl *runControl) ...@@ -382,7 +382,7 @@ IosQmlProfilerSupport::IosQmlProfilerSupport(RunControl *runControl)
void IosQmlProfilerSupport::start() void IosQmlProfilerSupport::start()
{ {
UrlConnection serverUrl; QUrl serverUrl;
QTcpServer server; QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost) QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6), return); || server.listen(QHostAddress::LocalHostIPv6), return);
......
...@@ -137,9 +137,11 @@ DeviceEnvironmentFetcher::Ptr DesktopDevice::environmentFetcher() const ...@@ -137,9 +137,11 @@ DeviceEnvironmentFetcher::Ptr DesktopDevice::environmentFetcher() const
return DeviceEnvironmentFetcher::Ptr(new DesktopDeviceEnvironmentFetcher()); return DeviceEnvironmentFetcher::Ptr(new DesktopDeviceEnvironmentFetcher());
} }
Connection DesktopDevice::toolControlChannel(const ControlChannelHint &) const QUrl DesktopDevice::toolControlChannel(const ControlChannelHint &) const
{ {
return HostName("localhost"); QUrl url;
url.setHost("localhost");
return url;
} }
Utils::OsType DesktopDevice::osType() const Utils::OsType DesktopDevice::osType() const
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
DeviceProcess *createProcess(QObject *parent) const override; DeviceProcess *createProcess(QObject *parent) const override;
DeviceProcessSignalOperation::Ptr signalOperation() const override; DeviceProcessSignalOperation::Ptr signalOperation() const override;
DeviceEnvironmentFetcher::Ptr environmentFetcher() const override; DeviceEnvironmentFetcher::Ptr environmentFetcher() const override;
Connection toolControlChannel(const ControlChannelHint &) const override; QUrl toolControlChannel(const ControlChannelHint &) const override;
Utils::OsType osType() const override; Utils::OsType osType() const override;
IDevice::Ptr clone() const override; IDevice::Ptr clone() const override;
......
...@@ -411,9 +411,11 @@ void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameter ...@@ -411,9 +411,11 @@ void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameter
d->sshParameters.hostKeyDatabase = DeviceManager::instance()->hostKeyDatabase(); d->sshParameters.hostKeyDatabase = DeviceManager::instance()->hostKeyDatabase();
} }
Connection IDevice::toolControlChannel(const ControlChannelHint &) const QUrl IDevice::toolControlChannel(const ControlChannelHint &) const
{ {
return HostName(d->sshParameters.host); QUrl url;
url.setHost(d->sshParameters.host);
return url;
} }
void IDevice::setFreePorts(const Utils::PortList &freePorts) void IDevice::setFreePorts(const Utils::PortList &freePorts)
...@@ -470,8 +472,4 @@ DeviceEnvironmentFetcher::DeviceEnvironmentFetcher() ...@@ -470,8 +472,4 @@ DeviceEnvironmentFetcher::DeviceEnvironmentFetcher()
{ {
} }
void *HostName::staticTypeId = &HostName::staticTypeId;
void *UrlConnection::staticTypeId = &UrlConnection::staticTypeId;
} // namespace ProjectExplorer } // namespace ProjectExplorer
...@@ -189,7 +189,7 @@ public: ...@@ -189,7 +189,7 @@ public:
void setSshParameters(const QSsh::SshConnectionParameters &sshParameters); void setSshParameters(const QSsh::SshConnectionParameters &sshParameters);
enum ControlChannelHint { QmlControlChannel }; enum ControlChannelHint { QmlControlChannel };
virtual Connection toolControlChannel(const ControlChannelHint &) const; virtual QUrl toolControlChannel(const ControlChannelHint &) const;
Utils::PortList freePorts() const; Utils::PortList freePorts() const;
void setFreePorts(const Utils::PortList &freePorts); void setFreePorts(const Utils::PortList &freePorts);
......
...@@ -688,7 +688,6 @@ public: ...@@ -688,7 +688,6 @@ public:
QString displayName; QString displayName;
Runnable runnable; Runnable runnable;
IDevice::ConstPtr device; IDevice::ConstPtr device;
Connection connection;
Core::Id runMode; Core::Id runMode;
Utils::Icon icon; Utils::Icon icon;
const QPointer<RunConfiguration> runConfiguration; // Not owned. const QPointer<RunConfiguration> runConfiguration; // Not owned.
...@@ -985,16 +984,6 @@ void RunControl::setRunnable(const Runnable &runnable) ...@@ -985,16 +984,6 @@ void RunControl::setRunnable(const Runnable &runnable)
d->runnable = runnable; d->runnable = runnable;
} }
const Connection &RunControl::connection() const
{
return d->connection;
}
void RunControl::setConnection(const Connection &connection)
{
d->connection = connection;
}
QString RunControl::displayName() const QString RunControl::displayName() const
{ {
return d->displayName; return d->displayName;
...@@ -1492,11 +1481,6 @@ const Runnable &RunWorker::runnable() const ...@@ -1492,11 +1481,6 @@ const Runnable &RunWorker::runnable() const
return d->runControl->runnable(); return d->runControl->runnable();
} }
const Connection &RunWorker::connection() const
{
return d->runControl->connection();
}
Core::Id RunWorker::runMode() const Core::Id RunWorker::runMode() const
{ {
return d->runControl->runMode(); return d->runControl->runMode();
......
...@@ -198,44 +198,6 @@ private: ...@@ -198,44 +198,6 @@ private:
std::unique_ptr<Concept> d; std::unique_ptr<Concept> d;
}; };
class PROJECTEXPLORER_EXPORT Connection
{
struct Concept
{
virtual ~Concept() {}
virtual Concept *clone() const = 0;
virtual void *typeId() const = 0;
};
template <class T>
struct Model : public Concept
{
Model(const T &data) : m_data(data) { }
Concept *clone() const override { return new Model(*this); }
void *typeId() const override { return T::staticTypeId; }
T m_data;
};
public:
Connection() = default;
Connection(const Connection &other) : d(other.d ? other.d->clone() : nullptr) { }
Connection(Connection &&other) /* MSVC 2013 doesn't want = default */ : d(std::move(other.d)) {}
template <class T> Connection(const T &data) : d(new Model<T>(data)) {}
void operator=(Connection other) { d = std::move(other.d); }
template <class T> bool is() const {
return d.get() && (d.get()->typeId() == T::staticTypeId);
}
template <class T> const T &as() const {
return static_cast<Model<T> *>(d.get())->m_data;
}
private:
std::unique_ptr<Concept> d;
};
// Documentation inside. // Documentation inside.
class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
{ {
...@@ -387,7 +349,6 @@ public: ...@@ -387,7 +349,6 @@ public:
void appendMessage(const QString &msg, Utils::OutputFormat format); void appendMessage(const QString &msg, Utils::OutputFormat format);
IDevice::ConstPtr device() const; IDevice::ConstPtr device() const;
const Runnable &runnable() const; const Runnable &runnable() const;
const Connection &connection() const;
Core::Id runMode() const; Core::Id runMode() const;
// States // States
...@@ -466,9 +427,6 @@ public: ...@@ -466,9 +427,6 @@ public:
const Runnable &runnable() const; const Runnable &runnable() const;
void setRunnable(const Runnable &runnable); void setRunnable(const Runnable &runnable);
const Connection &connection() const;
void setConnection(const Connection &connection);
virtual void appendMessage(const QString &msg, Utils::OutputFormat format); virtual void appendMessage(const QString &msg, Utils::OutputFormat format);
virtual void bringApplicationToForeground(); virtual void bringApplicationToForeground();
......
...@@ -41,22 +41,8 @@ bool operator==(const StandardRunnable &r1, const StandardRunnable &r2) ...@@ -41,22 +41,8 @@ bool operator==(const StandardRunnable &r1, const StandardRunnable &r2)
void *StandardRunnable::staticTypeId = &StandardRunnable::staticTypeId; void *StandardRunnable::staticTypeId = &StandardRunnable::staticTypeId;
UrlConnection UrlConnection::fromHost(const QString &host)
{
UrlConnection connection;
connection.setHost(host);
return connection;
}
UrlConnection UrlConnection::localHostWithoutPort()
{
QUrl serverUrl;
QTcpServer server;
serverUrl.setHost(server.serverAddress().toString());
return UrlConnection(serverUrl);
}
UrlConnection UrlConnection::localHostAndFreePort() QUrl urlFromLocalHostAndFreePort()
{ {
QUrl serverUrl; QUrl serverUrl;
QTcpServer server; QTcpServer server;
...@@ -64,17 +50,22 @@ UrlConnection UrlConnection::localHostAndFreePort() ...@@ -64,17 +50,22 @@ UrlConnection UrlConnection::localHostAndFreePort()
serverUrl.setHost(server.serverAddress().toString()); serverUrl.setHost(server.serverAddress().toString());
serverUrl.setPort(server.serverPort()); serverUrl.setPort(server.serverPort());
} }
return UrlConnection(serverUrl); return serverUrl;
} }
UrlConnection UrlConnection::localSocket() QUrl urlFromLocalSocket()
{ {
QUrl serverUrl; QUrl serverUrl;
serverUrl.setScheme(socketScheme()); serverUrl.setScheme(urlSocketScheme());
Utils::TemporaryFile file("qmlprofiler-freesocket"); Utils::TemporaryFile file("qmlprofiler-freesocket");
if (file.open()) if (file.open())
serverUrl.setPath(file.fileName()); serverUrl.setPath(file.fileName());
return UrlConnection(serverUrl); return serverUrl;
}
QString urlSocketScheme()
{
return QString("socket");
} }
} // namespace ProjectExplorer } // namespace ProjectExplorer
...@@ -53,32 +53,8 @@ public: ...@@ -53,32 +53,8 @@ public:
PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2); PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2);
class PROJECTEXPLORER_EXPORT HostName PROJECTEXPLORER_EXPORT QUrl urlFromLocalHostAndFreePort();
{ PROJECTEXPLORER_EXPORT QUrl urlFromLocalSocket();
public: PROJECTEXPLORER_EXPORT QString urlSocketScheme();
explicit HostName(const QString &host) : m_host(host) {}
QString host() const { return m_host; }
static void *staticTypeId;
private:
QString m_host;
};
class PROJECTEXPLORER_EXPORT UrlConnection : public QUrl
{
public:
UrlConnection() {}
explicit UrlConnection(const QUrl &url) : QUrl(url) {}
static UrlConnection fromHost(const QString &host);
static UrlConnection localHostAndFreePort();
static UrlConnection localHostWithoutPort();
static UrlConnection localSocket();
static QString socketScheme() { return QLatin1String("socket"); }
static void *staticTypeId;
};
} // namespace ProjectExplorer } // namespace ProjectExplorer
...@@ -271,10 +271,7 @@ void QmlProfilerRunner::setServerUrl(const QUrl &serverUrl) ...@@ -271,10 +271,7 @@ void QmlProfilerRunner::setServerUrl(const QUrl &serverUrl)
QUrl QmlProfilerRunner::serverUrl() const QUrl QmlProfilerRunner::serverUrl() const
{ {
QVariant recordedServer = recordedData(QmlServerUrl); QVariant recordedServer = recordedData(QmlServerUrl);
if (recordedServer.isValid()) return recordedServer.toUrl();
return recordedServer.toUrl();
QTC_ASSERT(connection().is<UrlConnection>(), return QUrl());
return connection().as<UrlConnection>();
} }
// //
...@@ -289,12 +286,12 @@ static QUrl localServerUrl(RunControl *runControl) ...@@ -289,12 +286,12 @@ static QUrl localServerUrl(RunControl *runControl)
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit); const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
if (version) { if (version) {
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0)) if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0))
serverUrl = UrlConnection::localSocket(); serverUrl = urlFromLocalSocket();
else else
serverUrl = UrlConnection::localHostAndFreePort(); serverUrl = urlFromLocalHostAndFreePort();
} else { } else {
qWarning("Running QML profiler on Kit without Qt version?"); qWarning("Running QML profiler on Kit without Qt version?");
serverUrl = UrlConnection::localHostAndFreePort(); serverUrl = urlFromLocalHostAndFreePort();
} }
return serverUrl; return serverUrl;
} }
......
...@@ -580,9 +580,8 @@ void QmlProfilerTool::attachToWaitingApplication() ...@@ -580,9 +580,8 @@ void QmlProfilerTool::attachToWaitingApplication()
IDevice::ConstPtr device = DeviceKitInformation::device(kit); IDevice::ConstPtr device = DeviceKitInformation::device(kit);
QTC_ASSERT(device, return); QTC_ASSERT(device, return);
Connection toolControl = device->toolControlChannel(IDevice::QmlControlChannel); QUrl toolControl = device->toolControlChannel(IDevice::QmlControlChannel);
QTC_ASSERT(toolControl.is<HostName>(), return); serverUrl.setHost(toolControl.host());
serverUrl.setHost(toolControl.as<HostName>().host());
serverUrl.setPort(port); serverUrl.setPort(port);
Debugger::selectPerspective(Constants::QmlProfilerPerspectiveId); Debugger::selectPerspective(Constants::QmlProfilerPerspectiveId);
......
...@@ -80,7 +80,7 @@ void LocalQmlProfilerRunnerTest::testRunner1() ...@@ -80,7 +80,7 @@ void LocalQmlProfilerRunnerTest::testRunner1()
QTRY_COMPARE_WITH_TIMEOUT(runCount, 1, 10000); QTRY_COMPARE_WITH_TIMEOUT(runCount, 1, 10000);
QTRY_VERIFY_WITH_TIMEOUT(!running, 10000); QTRY_VERIFY_WITH_TIMEOUT(!running, 10000);
serverUrl = UrlConnection::localSocket(); serverUrl = urlFromLocalSocket();
debuggee.executable = QCoreApplication::applicationFilePath(); debuggee.executable = QCoreApplication::applicationFilePath();
// comma is used to specify a test function. In this case, an invalid one. // comma is used to specify a test function. In this case, an invalid one.
...@@ -97,7 +97,7 @@ void LocalQmlProfilerRunnerTest::testRunner2() ...@@ -97,7 +97,7 @@ void LocalQmlProfilerRunnerTest::testRunner2()
QTRY_VERIFY_WITH_TIMEOUT(!running, 10000); QTRY_VERIFY_WITH_TIMEOUT(!running, 10000);
debuggee.commandLineArguments.clear(); debuggee.commandLineArguments.clear();
serverUrl = UrlConnection::localHostAndFreePort(); serverUrl = urlFromLocalHostAndFreePort();
start(); start();
...@@ -119,7 +119,7 @@ void LocalQmlProfilerRunnerTest::testRunner4() ...@@ -119,7 +119,7 @@ void LocalQmlProfilerRunnerTest::testRunner4()
void LocalQmlProfilerRunnerTest::testFindFreePort() void LocalQmlProfilerRunnerTest::testFindFreePort()
{ {
QUrl serverUrl = UrlConnection::localHostAndFreePort(); QUrl serverUrl = urlFromLocalHostAndFreePort();
QVERIFY(serverUrl.port() != -1); QVERIFY(serverUrl.port() != -1);
QVERIFY(!serverUrl.host().isEmpty()); QVERIFY(!serverUrl.host().isEmpty());
QTcpServer server; QTcpServer server;
...@@ -128,7 +128,7 @@ void LocalQmlProfilerRunnerTest::testFindFreePort() ...@@ -128,7 +128,7 @@ void LocalQmlProfilerRunnerTest::testFindFreePort()
void LocalQmlProfilerRunnerTest::testFindFreeSocket() void LocalQmlProfilerRunnerTest::testFindFreeSocket()
{ {
QUrl serverUrl = UrlConnection::localSocket(); QUrl serverUrl = urlFromLocalSocket();
QString socket = serverUrl.path(); QString socket = serverUrl.path();
QVERIFY(!socket.isEmpty()); QVERIFY(!socket.isEmpty());
QVERIFY(!QFile::exists(socket)); QVERIFY(!QFile::exists(socket));
......
...@@ -55,7 +55,7 @@ private: ...@@ -55,7 +55,7 @@ private:
int runCount = 0; int runCount = 0;
ProjectExplorer::RunControl *runControl = nullptr; ProjectExplorer::RunControl *runControl = nullptr;
ProjectExplorer::StandardRunnable debuggee; ProjectExplorer::StandardRunnable debuggee;
ProjectExplorer::UrlConnection serverUrl; QUrl serverUrl;
}; };
} // namespace Internal } // namespace Internal
......
...@@ -70,12 +70,12 @@ void QmlProfilerClientManagerTest::testConnectionFailure_data() ...@@ -70,12 +70,12 @@ void QmlProfilerClientManagerTest::testConnectionFailure_data()
QTest::addColumn<QmlProfilerStateManager *>("stateManager"); QTest::addColumn<QmlProfilerStateManager *>("stateManager");
QVarLengthArray<QmlProfilerStateManager *> stateManagers({nullptr, &stateManager}); QVarLengthArray<QmlProfilerStateManager *> stateManagers({nullptr, &stateManager});
QUrl localUrl = UrlConnection::localHostAndFreePort(); QUrl localUrl = urlFromLocalHostAndFreePort();
QTest::addColumn<QUrl>("serverUrl"); QTest::addColumn<QUrl>("serverUrl");
QVarLengthArray<QString> hosts({"", "/-/|\\-\\|/-", localUrl.host()}); QVarLengthArray<QString> hosts({"", "/-/|\\-\\|/-", localUrl.host()});
QVarLengthArray<int> ports({-1, 5, localUrl.port()}); QVarLengthArray<int> ports({-1, 5, localUrl.port()});
QVarLengthArray<QString> sockets({"", "/-/|\\-\\|/-", UrlConnection::localSocket().path()}); QVarLengthArray<QString> sockets({"", "/-/|\\-\\|/-", urlFromLocalSocket().path()});
foreach (QmlProfilerModelManager *modelManager, modelManagers) { foreach (QmlProfilerModelManager *modelManager, modelManagers) {
foreach (QmlProfilerStateManager *stateManager, stateManagers) { foreach (QmlProfilerStateManager *stateManager, stateManagers) {
...@@ -101,7 +101,7 @@ void QmlProfilerClientManagerTest::testConnectionFailure_data() ...@@ -101,7 +101,7 @@ void QmlProfilerClientManagerTest::testConnectionFailure_data()
.arg(0) .arg(0)
.arg(socket); .arg(socket);
QUrl url; QUrl url;
url.setScheme(ProjectExplorer::UrlConnection::socketScheme()); url.setScheme(urlSocketScheme());
url.setPath(socket); url.setPath(socket);
QTest::newRow(tag.toLatin1().constData()) << modelManager << stateManager << url; QTest::newRow(tag.toLatin1().constData()) << modelManager << stateManager << url;
} }
...@@ -175,7 +175,7 @@ void QmlProfilerClientManagerTest::testUnresponsiveTcp() ...@@ -175,7 +175,7 @@ void QmlProfilerClientManagerTest::testUnresponsiveTcp()
clientManager.setProfilerStateManager(&stateManager); clientManager.setProfilerStateManager(&stateManager);
clientManager.setModelManager(&modelManager); clientManager.setModelManager(&modelManager);
QUrl serverUrl = UrlConnection::localHostAndFreePort(); QUrl serverUrl = urlFromLocalHostAndFreePort();
QTcpServer server; QTcpServer server;
server.listen(QHostAddress(serverUrl.host()), serverUrl.port()); server.listen(QHostAddress(serverUrl.host()), serverUrl.port());
...@@ -204,7 +204,7 @@ void QmlProfilerClientManagerTest::testUnresponsiveLocal() ...@@ -204,7 +204,7 @@ void QmlProfilerClientManagerTest::testUnresponsiveLocal()
clientManager.setProfilerStateManager(&stateManager); clientManager.setProfilerStateManager(&stateManager);
clientManager.setModelManager(&modelManager); clientManager.setModelManager(&modelManager);
QUrl socketUrl = UrlConnection::localSocket(); QUrl socketUrl = urlFromLocalSocket();
QLocalSocket socket; QLocalSocket socket;
QSignalSpy connectionSpy(&socket, SIGNAL(connected())); QSignalSpy connectionSpy(&socket, SIGNAL(connected()));
...@@ -256,7 +256,7 @@ void QmlProfilerClientManagerTest::testResponsiveTcp() ...@@ -256,7 +256,7 @@ void QmlProfilerClientManagerTest::testResponsiveTcp()
{ {
QFETCH(quint32, flushInterval); QFETCH(quint32, flushInterval);
QUrl serverUrl = UrlConnection::localHostAndFreePort(); QUrl serverUrl = urlFromLocalHostAndFreePort();
QSignalSpy openedSpy(&clientManager, SIGNAL(connectionOpened())); QSignalSpy openedSpy(&clientManager, SIGNAL(connectionOpened()));
QSignalSpy closedSpy(&clientManager, SIGNAL(connectionClosed())); QSignalSpy closedSpy(&clientManager, SIGNAL(connectionClosed()));
...@@ -315,7 +315,7 @@ void QmlProfilerClientManagerTest::testResponsiveLocal() ...@@ -315,7 +315,7 @@ void QmlProfilerClientManagerTest::testResponsiveLocal()
{ {
QFETCH(quint32, flushInterval); QFETCH(quint32, flushInterval);
QUrl socketUrl = UrlConnection::localSocket(); QUrl socketUrl = urlFromLocalSocket();
QSignalSpy openedSpy(&clientManager, SIGNAL(connectionOpened())); QSignalSpy openedSpy(&clientManager, SIGNAL(connectionOpened()));
QSignalSpy closedSpy(&clientManager, SIGNAL(connectionClosed())); QSignalSpy closedSpy(&clientManager, SIGNAL(connectionClosed()));
...@@ -380,7 +380,7 @@ void QmlProfilerClientManagerTest::testInvalidData() ...@@ -380,7 +380,7 @@ void QmlProfilerClientManagerTest::testInvalidData()
clientManager.setProfilerStateManager(&stateManager); clientManager.setProfilerStateManager(&stateManager);
clientManager.setModelManager(&modelManager); clientManager.setModelManager(&modelManager);
QUrl serverUrl = UrlConnection::localHostAndFreePort(); QUrl serverUrl = urlFromLocalHostAndFreePort();
bool dataSent = false; bool dataSent = false;
QTcpServer server; QTcpServer server;
...@@ -411,7 +411,7 @@ void QmlProfilerClientManagerTest::testInvalidData() ...@@ -411,7 +411,7 @@ void QmlProfilerClientManagerTest::testInvalidData()