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 <vikas.pachdha@qt.io>
This commit is contained in:
hjk
2017-06-29 18:32:01 +02:00
parent 72775ab8c4
commit f82bb1ec3a
17 changed files with 51 additions and 145 deletions

View File

@@ -70,12 +70,12 @@ void QmlProfilerClientManagerTest::testConnectionFailure_data()
QTest::addColumn<QmlProfilerStateManager *>("stateManager");
QVarLengthArray<QmlProfilerStateManager *> stateManagers({nullptr, &stateManager});
QUrl localUrl = UrlConnection::localHostAndFreePort();
QUrl localUrl = urlFromLocalHostAndFreePort();
QTest::addColumn<QUrl>("serverUrl");
QVarLengthArray<QString> hosts({"", "/-/|\\-\\|/-", localUrl.host()});
QVarLengthArray<int> ports({-1, 5, localUrl.port()});
QVarLengthArray<QString> sockets({"", "/-/|\\-\\|/-", UrlConnection::localSocket().path()});
QVarLengthArray<QString> sockets({"", "/-/|\\-\\|/-", urlFromLocalSocket().path()});
foreach (QmlProfilerModelManager *modelManager, modelManagers) {
foreach (QmlProfilerStateManager *stateManager, stateManagers) {
@@ -101,7 +101,7 @@ void QmlProfilerClientManagerTest::testConnectionFailure_data()
.arg(0)
.arg(socket);
QUrl url;
url.setScheme(ProjectExplorer::UrlConnection::socketScheme());
url.setScheme(urlSocketScheme());
url.setPath(socket);
QTest::newRow(tag.toLatin1().constData()) << modelManager << stateManager << url;
}
@@ -175,7 +175,7 @@ void QmlProfilerClientManagerTest::testUnresponsiveTcp()
clientManager.setProfilerStateManager(&stateManager);
clientManager.setModelManager(&modelManager);
QUrl serverUrl = UrlConnection::localHostAndFreePort();
QUrl serverUrl = urlFromLocalHostAndFreePort();
QTcpServer server;
server.listen(QHostAddress(serverUrl.host()), serverUrl.port());
@@ -204,7 +204,7 @@ void QmlProfilerClientManagerTest::testUnresponsiveLocal()
clientManager.setProfilerStateManager(&stateManager);
clientManager.setModelManager(&modelManager);
QUrl socketUrl = UrlConnection::localSocket();
QUrl socketUrl = urlFromLocalSocket();
QLocalSocket socket;
QSignalSpy connectionSpy(&socket, SIGNAL(connected()));
@@ -256,7 +256,7 @@ void QmlProfilerClientManagerTest::testResponsiveTcp()
{
QFETCH(quint32, flushInterval);
QUrl serverUrl = UrlConnection::localHostAndFreePort();
QUrl serverUrl = urlFromLocalHostAndFreePort();
QSignalSpy openedSpy(&clientManager, SIGNAL(connectionOpened()));
QSignalSpy closedSpy(&clientManager, SIGNAL(connectionClosed()));
@@ -315,7 +315,7 @@ void QmlProfilerClientManagerTest::testResponsiveLocal()
{
QFETCH(quint32, flushInterval);
QUrl socketUrl = UrlConnection::localSocket();
QUrl socketUrl = urlFromLocalSocket();
QSignalSpy openedSpy(&clientManager, SIGNAL(connectionOpened()));
QSignalSpy closedSpy(&clientManager, SIGNAL(connectionClosed()));
@@ -380,7 +380,7 @@ void QmlProfilerClientManagerTest::testInvalidData()
clientManager.setProfilerStateManager(&stateManager);
clientManager.setModelManager(&modelManager);
QUrl serverUrl = UrlConnection::localHostAndFreePort();
QUrl serverUrl = urlFromLocalHostAndFreePort();
bool dataSent = false;
QTcpServer server;
@@ -411,7 +411,7 @@ void QmlProfilerClientManagerTest::testInvalidData()
void QmlProfilerClientManagerTest::testStopRecording()
{
QUrl socketUrl = UrlConnection::localSocket();
QUrl socketUrl = urlFromLocalSocket();
{
QmlProfilerClientManager clientManager;