Changeset View
Changeset View
Standalone View
Standalone View
src/notifybysnore.cpp
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | |||||
135 | 135 | | |||
136 | NotifyBySnore::~NotifyBySnore() | 136 | NotifyBySnore::~NotifyBySnore() | ||
137 | { | 137 | { | ||
138 | m_server.close(); | 138 | m_server.close(); | ||
139 | } | 139 | } | ||
140 | 140 | | |||
141 | void NotifyBySnore::notify(KNotification *notification, KNotifyConfig *config) | 141 | void NotifyBySnore::notify(KNotification *notification, KNotifyConfig *config) | ||
142 | { | 142 | { | ||
143 | // we receive repeat notifications with ID = -1 and | ||||
144 | // sometimes we receive notifications for previous IDs again. | ||||
145 | if( m_notifications.contains(notification->id()) || notification->id() == -1){ | ||||
146 | return; | ||||
147 | } | ||||
143 | QProcess *proc = new QProcess(); | 148 | QProcess *proc = new QProcess(); | ||
144 | QStringList arguments; | 149 | QStringList arguments; | ||
145 | 150 | | |||
146 | arguments << QStringLiteral("-t"); | 151 | arguments << QStringLiteral("-t"); | ||
147 | if (!notification->title().isEmpty()) { | 152 | if (!notification->title().isEmpty()) { | ||
148 | arguments << notification->title(); | 153 | arguments << notification->title(); | ||
149 | } else { | 154 | } else { | ||
150 | arguments << qApp->applicationDisplayName(); | 155 | arguments << qApp->applicationDisplayName(); | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |