summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <[email protected]>2015-07-30 15:56:30 +0200
committerVolker Krause <[email protected]>2015-07-30 15:56:30 +0200
commitaea4c1f1f21ae8b59c419f400311fd0226e61cba (patch)
tree3ad12ac9d0a509ac06db1757c4fcd66b265e824f
parent09624b6ca9847994b7386001ebd18d71c303b6d1 (diff)
Simplify busy cursor handling here.
-rw-r--r--src/smtpconfigwidget.cpp29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/smtpconfigwidget.cpp b/src/smtpconfigwidget.cpp
index 7ad635d..5c05c7c 100644
--- a/src/smtpconfigwidget.cpp
+++ b/src/smtpconfigwidget.cpp
@@ -40,30 +40,6 @@
#include "mailtransport_debug.h"
#include <KMessageBox>
-namespace
-{
-
-// TODO: is this really necessary?
-class BusyCursorHelper : public QObject
-{
-public:
- inline BusyCursorHelper(QObject *parent) : QObject(parent)
- {
-#ifndef QT_NO_CURSOR
- qApp->setOverrideCursor(Qt::BusyCursor);
-#endif
- }
-
- inline ~BusyCursorHelper()
- {
-#ifndef QT_NO_CURSOR
- qApp->restoreOverrideCursor();
-#endif
- }
-};
-
-}
-
using namespace MailTransport;
class MailTransport::SMTPConfigWidgetPrivate : public TransportConfigWidgetPrivate
@@ -229,11 +205,10 @@ void SMTPConfigWidget::checkSmtpCapabilities()
}
d->serverTest->setProgressBar(d->ui.checkCapabilitiesProgress);
d->ui.checkCapabilitiesStack->setCurrentIndex(1);
- BusyCursorHelper *busyCursorHelper = new BusyCursorHelper(d->serverTest);
+ qApp->setOverrideCursor(Qt::BusyCursor);
connect(d->serverTest, &ServerTest::finished, this, &SMTPConfigWidget::slotFinished);
- connect(d->serverTest, SIGNAL(finished(QList<int>)),
- busyCursorHelper, SLOT(deleteLater()));
+ connect(d->serverTest, &ServerTest::finished, qApp, [](){ qApp->restoreOverrideCursor(); });
d->ui.checkCapabilities->setEnabled(false);
d->serverTest->start();
d->serverTestFailed = false;