Fix cancel button functionality in Settings->Repositories->Test

When pressing cancel button when testing repositories, the dialog
pops up again and again. Cancel the TestRepository job if cancel
button is pressed.

Change-Id: I48da41a8b791bf04571acd8af4a421b11e0fccc7
Task-number: QTIFW-832
Reviewed-by: Niels Weber <niels.weber@qt.io>
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
This commit is contained in:
Katja Marttila 2016-02-29 12:22:10 +02:00 committed by Katja Marttila
parent 86c218e7fa
commit e28bd0a98d

View File

@ -140,8 +140,10 @@ void TestRepository::downloadCompleted()
if (dlg.exec() == QDialog::Accepted) {
m_repository.setUsername(dlg.user());
m_repository.setPassword(dlg.password());
QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection);
} else {
QMetaObject::invokeMethod(this, "doCancel", Qt::QueuedConnection);
}
QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection);
return;
} else if (e.type() == AuthenticationRequiredException::Type::Proxy) {
const QNetworkProxy proxy = e.proxy();