forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.6'
Conflicts: src/libs/qmldebug/qmldebugclient.cpp src/libs/qmldebug/qmldebugclient.h src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp Change-Id: I9594b4e9befc78f8138deb121f0bfc4212f7edbf
This commit is contained in:
@@ -270,9 +270,22 @@ void QmlProfilerClientManager::tryToConnect()
|
||||
if (d->connection && d->connection->isConnected()) {
|
||||
d->connectionTimer.stop();
|
||||
d->connectionAttempts = 0;
|
||||
} else if (d->connection &&
|
||||
d->connection->socketState() != QAbstractSocket::ConnectedState) {
|
||||
// Replace the connection after trying for some time. On some operating systems (OSX) the
|
||||
// very first connection to a TCP server takes a very long time to get established.
|
||||
|
||||
// delete directly here, so that any pending events aren't delivered. We don't want the
|
||||
// connection first to be established and then torn down again.
|
||||
delete d->connection;
|
||||
d->connection = 0;
|
||||
connectClient(d->tcpPort);
|
||||
connectToClient();
|
||||
} else if (d->connectionAttempts == 50) {
|
||||
d->connectionTimer.stop();
|
||||
d->connectionAttempts = 0;
|
||||
delete d->connection; // delete directly.
|
||||
d->connection = 0;
|
||||
|
||||
QMessageBox *infoBox = QmlProfilerTool::requestMessageBox();
|
||||
infoBox->setIcon(QMessageBox::Critical);
|
||||
@@ -333,14 +346,11 @@ void QmlProfilerClientManager::logState(const QString &msg)
|
||||
|
||||
void QmlProfilerClientManager::retryMessageBoxFinished(int result)
|
||||
{
|
||||
if (d->connection) {
|
||||
QTC_ASSERT(!d->connection->isConnected(), return);
|
||||
if (d->connection->isConnecting())
|
||||
d->connection->disconnect();
|
||||
}
|
||||
QTC_ASSERT(!d->connection, disconnectClient());
|
||||
|
||||
switch (result) {
|
||||
case QMessageBox::Retry: {
|
||||
connectClient(d->tcpPort);
|
||||
d->connectionAttempts = 0;
|
||||
d->connectionTimer.start();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user