Commit 800dfe4c authored by David Schulz's avatar David Schulz Committed by hjk

On cancel analyzer setup the progress bar closes now.

During the start of the remote analyzer you can choose the network connection
to the remote analyzer. If you cancel this selection now the progressbar is set
to canceled, and will disapear after a certain amount of time.

Task-number: QTCREATORBUG-6014
Change-Id: I944f27adec11200d417266183e3d371606c89112
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent efe9bca2
......@@ -124,7 +124,6 @@ void AnalyzerRunControl::start()
d->m_isRunning = true;
emit started();
}
}
RunControl::StopResult AnalyzerRunControl::stop()
......
......@@ -70,10 +70,11 @@ CallgrindController *CallgrindRunner::controller() const
return m_controller;
}
void CallgrindRunner::start()
bool CallgrindRunner::start()
{
ValgrindRunner::start();
m_controller->setValgrindProcess(valgrindProcess());
return true;
}
void CallgrindRunner::processFinished(int ret, QProcess::ExitStatus status)
......
......@@ -55,7 +55,7 @@ public:
CallgrindController *controller() const;
bool isPaused() const;
void start();
bool start();
signals:
void statusMessage(const QString &message);
......
......@@ -96,19 +96,19 @@ void MemcheckRunner::setParser(XmlProtocol::ThreadedParser *parser)
d->parser = parser;
}
void MemcheckRunner::start()
bool MemcheckRunner::start()
{
if (startMode() == Analyzer::StartLocal) {
QTC_ASSERT(d->parser, return);
QTC_ASSERT(d->parser, return false);
bool check = d->xmlServer.listen(QHostAddress(QHostAddress::LocalHost));
QTC_ASSERT(check, return);
QTC_ASSERT(check, return false);
d->xmlServer.setMaxPendingConnections(1);
const quint16 xmlPortNumber = d->xmlServer.serverPort();
connect(&d->xmlServer, SIGNAL(newConnection()), SLOT(xmlSocketConnected()));
check = d->logServer.listen(QHostAddress(QHostAddress::LocalHost));
QTC_ASSERT(check, return);
QTC_ASSERT(check, return false);
d->logServer.setMaxPendingConnections(1);
const quint16 logPortNumber = d->logServer.serverPort();
connect(&d->logServer, SIGNAL(newConnection()), SLOT(logSocketConnected()));
......@@ -123,7 +123,7 @@ void MemcheckRunner::start()
}
if (startMode() == Analyzer::StartRemote) {
QTC_ASSERT(d->parser, return);
QTC_ASSERT(d->parser, return false);
QList<QHostAddress> possibleHostAddresses;
//NOTE: ::allAddresses does not seem to work for usb interfaces...
......@@ -144,7 +144,7 @@ void MemcheckRunner::start()
if (possibleHostAddresses.isEmpty()) {
emit processErrorReceived(tr("No network interface found for remote analysis."),
QProcess::FailedToStart);
return;
return false;
} else if (possibleHostAddresses.size() > 1) {
QDialog dlg;
dlg.setWindowTitle(tr("Select Network Interface"));
......@@ -171,27 +171,29 @@ void MemcheckRunner::start()
layout->addWidget(buttons);
dlg.setLayout(layout);
if (dlg.exec() != QDialog::Accepted)
return;
if (dlg.exec() != QDialog::Accepted) {
emit processErrorReceived(tr("No Network Interface was chosen for remote analysis"), QProcess::FailedToStart);
return false;
}
QTC_ASSERT(list->currentRow() >= 0, return);
QTC_ASSERT(list->currentRow() < possibleHostAddresses.size(), return);
QTC_ASSERT(list->currentRow() >= 0, return false);
QTC_ASSERT(list->currentRow() < possibleHostAddresses.size(), return false);
hostAddr = possibleHostAddresses.at(list->currentRow());
} else {
hostAddr = possibleHostAddresses.first();
}
QString ip = hostAddr.toString();
QTC_ASSERT(!ip.isEmpty(), return);
QTC_ASSERT(!ip.isEmpty(), return false);
bool check = d->xmlServer.listen(hostAddr);
QTC_ASSERT(check, return);
QTC_ASSERT(check, return false);
d->xmlServer.setMaxPendingConnections(1);
const quint16 xmlPortNumber = d->xmlServer.serverPort();
connect(&d->xmlServer, SIGNAL(newConnection()), SLOT(xmlSocketConnected()));
check = d->logServer.listen(hostAddr);
QTC_ASSERT(check, return);
QTC_ASSERT(check, return false);
d->logServer.setMaxPendingConnections(1);
const quint16 logPortNumber = d->logServer.serverPort();
connect(&d->logServer, SIGNAL(newConnection()), SLOT(logSocketConnected()));
......@@ -204,7 +206,7 @@ void MemcheckRunner::start()
setValgrindArguments(memcheckArguments);
}
ValgrindRunner::start();
return ValgrindRunner::start();
}
void MemcheckRunner::xmlSocketConnected()
......
......@@ -54,7 +54,7 @@ public:
~MemcheckRunner();
void setParser(XmlProtocol::ThreadedParser *parser);
void start();
bool start();
signals:
void logMessageReceived(const QByteArray &);
......
......@@ -117,8 +117,10 @@ bool ValgrindEngine::start()
connect(runner(), SIGNAL(finished()),
SLOT(runnerFinished()));
runner()->start();
if (!runner()->start()) {
m_progress->cancel();
return false;
}
return true;
}
......
......@@ -219,12 +219,13 @@ void ValgrindRunner::waitForFinished() const
loop.exec();
}
void ValgrindRunner::start()
bool ValgrindRunner::start()
{
if (d->startMode == Analyzer::StartLocal)
d->run(new LocalValgrindProcess(this));
else if (d->startMode == Analyzer::StartRemote)
d->run(new RemoteValgrindProcess(d->connParams, this));
return true;
}
void ValgrindRunner::processError(QProcess::ProcessError e)
......
......@@ -83,7 +83,7 @@ public:
QString errorString() const;
virtual void start();
virtual bool start();
virtual void stop();
ValgrindProcess *valgrindProcess() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment