diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-01-28 21:50:25 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-31 14:47:26 +0100 |
commit | 1704e0801258d0ae78b18be32488e083458010f1 (patch) | |
tree | 74644609b9b8431330b5c9f1c4177cd4071a9348 /desktop-widgets/notificationwidget.cpp | |
parent | 5a9faf2fead68df70c9e660c1ebb9b6fad90ba33 (diff) | |
download | subsurface-1704e0801258d0ae78b18be32488e083458010f1.tar.gz |
Make future_watcher a subobject of NotificationWidget
This was a raw pointer. No point in doing error-prone manual
memory management.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/notificationwidget.cpp')
-rw-r--r-- | desktop-widgets/notificationwidget.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/desktop-widgets/notificationwidget.cpp b/desktop-widgets/notificationwidget.cpp index 952adef4f..e0227010c 100644 --- a/desktop-widgets/notificationwidget.cpp +++ b/desktop-widgets/notificationwidget.cpp @@ -3,8 +3,7 @@ NotificationWidget::NotificationWidget(QWidget *parent) : KMessageWidget(parent) { - future_watcher = new QFutureWatcher<void>(); - connect(future_watcher, SIGNAL(finished()), this, SLOT(finish())); + connect(&future_watcher, SIGNAL(finished()), this, SLOT(finish())); } void NotificationWidget::showNotification(QString message, KMessageWidget::MessageType type) @@ -29,15 +28,10 @@ QString NotificationWidget::getNotificationText() void NotificationWidget::setFuture(const QFuture<void> &future) { - future_watcher->setFuture(future); + future_watcher.setFuture(future); } void NotificationWidget::finish() { hideNotification(); } - -NotificationWidget::~NotificationWidget() -{ - delete future_watcher; -} |