1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
commit 92f71adb8bb6e46d4a3187ab8824c859312e9136
Author: Aaron Seigo <aseigo@kde.org>
Date: Tue Feb 1 12:54:44 2011 -0800
try to avoid doing any work when we are deleting
diff --git a/plasma/generic/applets/notifications/ui/notificationgroup.cpp b/plasma/generic/applets/notifications/ui/notificationgroup.cpp
index 1f7c0b8..6bbf43c 100644
--- a/plasma/generic/applets/notifications/ui/notificationgroup.cpp
+++ b/plasma/generic/applets/notifications/ui/notificationgroup.cpp
@@ -66,6 +66,8 @@ NotificationGroup::NotificationGroup(Extender *parent, uint groupId)
NotificationGroup::~NotificationGroup()
{
+ m_extenderItemsForNotification.clear();
+ m_notificationForExtenderItems.clear();
qDeleteAll(m_notifications);
}
@@ -137,6 +139,11 @@ void NotificationGroup::addNotification(Notification *notification)
void NotificationGroup::extenderItemDestroyed(Plasma::ExtenderItem *object)
{
+ if (m_extenderItemsForNotification.isEmpty()) {
+ // either we aren't tracking this notification or else we're being deleted
+ return;
+ }
+
Notification *n = m_notificationForExtenderItems.value(object);
if (n) {
@@ -148,10 +155,16 @@ void NotificationGroup::extenderItemDestroyed(Plasma::ExtenderItem *object)
void NotificationGroup::removeNotification(Notification *notification)
{
+ if (m_extenderItemsForNotification.isEmpty()) {
+ // either we aren't tracking this notification or else we're being deleted
+ return;
+ }
+
Plasma::ExtenderItem *item = m_extenderItemsForNotification.value(notification);
if (item) {
m_notificationForExtenderItems.remove(item);
}
+
m_extenderItemsForNotification.remove(notification);
m_notifications.removeAll(notification);
QString applicationName = m_appForNotification.value(notification);
diff --git a/plasma/generic/applets/notifications/ui/notifications.cpp b/plasma/generic/applets/notifications/ui/notifications.cpp
index 9b1a7c0..c7aa6dd 100644
--- a/plasma/generic/applets/notifications/ui/notifications.cpp
+++ b/plasma/generic/applets/notifications/ui/notifications.cpp
@@ -106,6 +106,9 @@ Notifications::~Notifications()
{
// stop listening to the manager
disconnect(m_manager, 0, this, 0);
+ if (m_notificationStackDialog) {
+ disconnect(m_notificationStackDialog, 0, this, 0);
+ }
foreach (Notification *notification, m_manager->notifications()) {
// we don't want a destroyed managed after the destruction of manager
@@ -342,10 +345,10 @@ void Notifications::initExtenderItem(Plasma::ExtenderItem *extenderItem)
return;
}
- if (extenderItem->config().readEntry("type", "") == "job") {
+ if (extenderItem->config().readEntry("type", QString()) == "job") {
extenderItem->setWidget(new JobWidget(0, extenderItem));
- //unknown type, this should never happen
} else {
+ //unknown type, this should never happen
extenderItem->destroy();
}
commit 1fc6c46a49695ec6ad6cd80a8459c5c083de8e06
Author: Aaron Seigo <aseigo@kde.org>
Date: Tue Feb 1 12:54:25 2011 -0800
make them all uniqueconnections
diff --git a/plasma/generic/applets/notifications/ui/notificationstack.cpp b/plasma/generic/applets/notifications/ui/notificationstack.cpp
index 2f68961..3b53559 100644
--- a/plasma/generic/applets/notifications/ui/notificationstack.cpp
+++ b/plasma/generic/applets/notifications/ui/notificationstack.cpp
@@ -54,11 +54,9 @@ NotificationStack::~NotificationStack()
void NotificationStack::addNotification(Notification *notification)
{
m_canDismissTimer->start(1000);
- connect(notification, SIGNAL(notificationDestroyed(Notification *)), this, SLOT(removeNotification(Notification *)));
- connect(notification, SIGNAL(expired(Notification *)), this, SLOT(delayedRemoveNotification(Notification *)));
-
- disconnect(notification, SIGNAL(changed(Notification *)), this, SLOT(notificationChanged(Notification *)));
- connect(notification, SIGNAL(changed(Notification *)), this, SLOT(notificationChanged(Notification *)));
+ connect(notification, SIGNAL(notificationDestroyed(Notification *)), this, SLOT(removeNotification(Notification *)), Qt::UniqueConnection);
+ connect(notification, SIGNAL(expired(Notification *)), this, SLOT(delayedRemoveNotification(Notification *)), Qt::UniqueConnection);
+ connect(notification, SIGNAL(changed(Notification *)), this, SLOT(notificationChanged(Notification *)), Qt::UniqueConnection);
NotificationWidget *notificationWidget = new NotificationWidget(notification, this);
notificationWidget->installEventFilter(this);
commit f0f66f023e6f2896bcc2ea67d7922fc0745ff7b5
Author: Aaron Seigo <aseigo@kde.org>
Date: Tue Feb 1 12:54:10 2011 -0800
simplification
diff --git a/plasma/generic/applets/notifications/ui/notificationwidget.cpp b/plasma/generic/applets/notifications/ui/notificationwidget.cpp
index 7764ede..3f87cfe 100644
--- a/plasma/generic/applets/notifications/ui/notificationwidget.cpp
+++ b/plasma/generic/applets/notifications/ui/notificationwidget.cpp
@@ -43,7 +43,6 @@
#include <Plasma/Animation>
#include <Plasma/Animator>
-#include <Plasma/Extender>
#include <Plasma/Frame>
#include <Plasma/IconWidget>
#include <Plasma/Label>
@@ -170,7 +169,7 @@ NotificationWidget::NotificationWidget(Notification *notification, QGraphicsWidg
d->notification = notification;
connect(d->signalMapper, SIGNAL(mapped(const QString &)),
- d->notification.data(), SLOT(triggerAction(const QString &)));
+ notification, SLOT(triggerAction(const QString &)));
connect(notification, SIGNAL(changed()),
this, SLOT(updateNotification()));
connect(notification, SIGNAL(destroyed()),
|