Merge lp:~agateau/kde-runtime/fdo-notifications into lp:~kubuntu-packagers/kubuntu-packaging/kde-runtime
- fdo-notifications
- Merge into kde-runtime
Proposed by
Aurélien Gâteau
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~agateau/kde-runtime/fdo-notifications |
Merge into: | lp:~kubuntu-packagers/kubuntu-packaging/kde-runtime |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~agateau/kde-runtime/fdo-notifications |
Related bugs: |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2009-07-11 02:56:04 +0000 | |||
3 | +++ debian/changelog 2009-07-17 13:41:39 +0000 | |||
4 | @@ -1,3 +1,11 @@ | |||
5 | 1 | kdebase-runtime (4:4.2.96-0ubuntu2) karmic; urgency=low | ||
6 | 2 | |||
7 | 3 | * Backport support for freedesktop.org notifications. Makes it possible for | ||
8 | 4 | GNOME and KDE applications to display notifications using the native | ||
9 | 5 | desktop notification system. | ||
10 | 6 | |||
11 | 7 | -- Aurélien Gâteau <aurelien.gateau@canonical.com> Fri, 17 Jul 2009 14:13:55 +0200 | ||
12 | 8 | |||
13 | 1 | kdebase-runtime (4:4.2.96-0ubuntu1) karmic; urgency=low | 9 | kdebase-runtime (4:4.2.96-0ubuntu1) karmic; urgency=low |
14 | 2 | 10 | ||
15 | 3 | [ Christian Mangold ] | 11 | [ Christian Mangold ] |
16 | 4 | 12 | ||
17 | === added file 'debian/patches/kubuntu_86_fdo_notifications.diff' | |||
18 | --- debian/patches/kubuntu_86_fdo_notifications.diff 1970-01-01 00:00:00 +0000 | |||
19 | +++ debian/patches/kubuntu_86_fdo_notifications.diff 2009-07-17 13:41:39 +0000 | |||
20 | @@ -0,0 +1,16 @@ | |||
21 | 1 | From 8861cfc7b4a8a3278773db766b836bbdce33e718 Mon Sep 17 00:00:00 2001 | ||
22 | 2 | From: =?utf-8?q?Aur=C3=A9lien=20G=C3=A2teau?= <agateau@kde.org> | ||
23 | 3 | Date: Wed, 17 Jun 2009 15:26:14 +0200 | ||
24 | 4 | Subject: [PATCH] Removed event-id | ||
25 | 5 | |||
26 | 6 | --- | ||
27 | 7 | --- a/knotify/notifybypopup.cpp | ||
28 | 8 | +++ b/knotify/notifybypopup.cpp | ||
29 | 9 | @@ -357,7 +357,6 @@ bool NotifyByPopup::sendNotificationDBus(int id, int replacesId, KNotifyConfig* | ||
30 | 10 | |||
31 | 11 | args.append( appCaption ); // app_name | ||
32 | 12 | args.append( dbus_replaces_id ); // replaces_id | ||
33 | 13 | - args.append( config->eventid ); // event_id | ||
34 | 14 | args.append( iconName ); // app_icon | ||
35 | 15 | args.append( config->title ); // summary | ||
36 | 16 | args.append( config->text ); // body | ||
37 | 0 | 17 | ||
38 | === added file 'debian/patches/kubuntu_87_fdo_notifications.diff' | |||
39 | --- debian/patches/kubuntu_87_fdo_notifications.diff 1970-01-01 00:00:00 +0000 | |||
40 | +++ debian/patches/kubuntu_87_fdo_notifications.diff 2009-07-17 13:41:39 +0000 | |||
41 | @@ -0,0 +1,40 @@ | |||
42 | 1 | From 86dd34fb4efba8163272c171912484ea077b0ed0 Mon Sep 17 00:00:00 2001 | ||
43 | 2 | From: =?utf-8?q?Aur=C3=A9lien=20G=C3=A2teau?= <agateau@kde.org> | ||
44 | 3 | Date: Thu, 18 Jun 2009 17:45:23 +0200 | ||
45 | 4 | Subject: [PATCH] Switch to org.freedesktop.Notifications | ||
46 | 5 | |||
47 | 6 | --- | ||
48 | 7 | --- a/knotify/notifybypopup.cpp | ||
49 | 8 | +++ b/knotify/notifybypopup.cpp | ||
50 | 9 | @@ -38,9 +38,9 @@ | ||
51 | 10 | #include <QDBusConnectionInterface> | ||
52 | 11 | #include <kconfiggroup.h> | ||
53 | 12 | |||
54 | 13 | -static const char dbusServiceName[] = "org.kde.VisualNotifications"; | ||
55 | 14 | -static const char dbusInterfaceName[] = "org.kde.VisualNotifications"; | ||
56 | 15 | -static const char dbusPath[] = "/VisualNotifications"; | ||
57 | 16 | +static const char dbusServiceName[] = "org.freedesktop.Notifications"; | ||
58 | 17 | +static const char dbusInterfaceName[] = "org.freedesktop.Notifications"; | ||
59 | 18 | +static const char dbusPath[] = "/org/freedesktop/Notifications"; | ||
60 | 19 | |||
61 | 20 | NotifyByPopup::NotifyByPopup(QObject *parent) | ||
62 | 21 | : KNotifyPlugin(parent) , m_animationTimer(0), m_dbusServiceExists(false) | ||
63 | 22 | @@ -348,7 +348,8 @@ bool NotifyByPopup::sendNotificationDBus(int id, int replacesId, KNotifyConfig* | ||
64 | 23 | // NOTE readEntry here is not KConfigGroup::readEntry - this is a custom class | ||
65 | 24 | // It returns QString. | ||
66 | 25 | QString timeoutStr = config->readEntry( "Timeout" ); | ||
67 | 26 | - int timeout = !timeoutStr.isEmpty() ? timeoutStr.toInt() : 0; | ||
68 | 27 | + // -1 means: notification server decides | ||
69 | 28 | + int timeout = !timeoutStr.isEmpty() ? timeoutStr.toInt() : -1; | ||
70 | 29 | |||
71 | 30 | QList<QVariant> args; | ||
72 | 31 | |||
73 | 32 | @@ -358,7 +359,7 @@ bool NotifyByPopup::sendNotificationDBus(int id, int replacesId, KNotifyConfig* | ||
74 | 33 | args.append( appCaption ); // app_name | ||
75 | 34 | args.append( dbus_replaces_id ); // replaces_id | ||
76 | 35 | args.append( iconName ); // app_icon | ||
77 | 36 | - args.append( config->title ); // summary | ||
78 | 37 | + args.append( config->title.isEmpty() ? appCaption : config->title ); // summary | ||
79 | 38 | args.append( config->text ); // body | ||
80 | 39 | // galago spec defines action list to be list like | ||
81 | 40 | // (act_id1, action1, act_id2, action2, ...) | ||
82 | 0 | 41 | ||
83 | === added file 'debian/patches/kubuntu_88_fdo_notifications.diff' | |||
84 | --- debian/patches/kubuntu_88_fdo_notifications.diff 1970-01-01 00:00:00 +0000 | |||
85 | +++ debian/patches/kubuntu_88_fdo_notifications.diff 2009-07-17 13:41:39 +0000 | |||
86 | @@ -0,0 +1,182 @@ | |||
87 | 1 | From da943498b3affdfa6f61befd16e01c6311b01721 Mon Sep 17 00:00:00 2001 | ||
88 | 2 | From: =?utf-8?q?Aur=C3=A9lien=20G=C3=A2teau?= <agateau@kde.org> | ||
89 | 3 | Date: Tue, 30 Jun 2009 11:58:22 +0200 | ||
90 | 4 | Subject: [PATCH] Use the correct format for image_data hint | ||
91 | 5 | |||
92 | 6 | --- | ||
93 | 7 | --- a/knotify/CMakeLists.txt | ||
94 | 8 | +++ b/knotify/CMakeLists.txt | ||
95 | 9 | @@ -12,6 +12,7 @@ notifybylogfile.cpp | ||
96 | 10 | notifybytaskbar.cpp | ||
97 | 11 | notifybyexecute.cpp | ||
98 | 12 | notifybyktts.cpp | ||
99 | 13 | +imageconverter.cpp | ||
100 | 14 | ) | ||
101 | 15 | |||
102 | 16 | qt4_add_dbus_interfaces(knotify_SRCS ${KDE4_DBUS_INTERFACES_DIR}/org.kde.KSpeech.xml) | ||
103 | 17 | --- /dev/null | ||
104 | 18 | +++ b/knotify/imageconverter.cpp | ||
105 | 19 | @@ -0,0 +1,101 @@ | ||
106 | 20 | +/* | ||
107 | 21 | + Copyright (C) 2009 by Aurélien Gâteau <agateau@kde.org> | ||
108 | 22 | + | ||
109 | 23 | + This program is free software; you can redistribute it and/or modify | ||
110 | 24 | + it under the terms of the GNU General Public License as published by | ||
111 | 25 | + the Free Software Foundation; either version 2, or (at your option) | ||
112 | 26 | + any later version. | ||
113 | 27 | + | ||
114 | 28 | + This program is distributed in the hope that it will be useful, | ||
115 | 29 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
116 | 30 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
117 | 31 | + GNU General Public License for more details. | ||
118 | 32 | + | ||
119 | 33 | + You should have received a copy of the GNU General Public License | ||
120 | 34 | + along with this program; if not, write to the Free Software | ||
121 | 35 | + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
122 | 36 | + | ||
123 | 37 | + */ | ||
124 | 38 | +#include "imageconverter.h" | ||
125 | 39 | + | ||
126 | 40 | +#include <QDBusArgument> | ||
127 | 41 | +#include <QDBusMetaType> | ||
128 | 42 | +#include <QImage> | ||
129 | 43 | + | ||
130 | 44 | +namespace ImageConverter | ||
131 | 45 | +{ | ||
132 | 46 | + | ||
133 | 47 | +/** | ||
134 | 48 | + * A structure representing an image which can be marshalled to fit the | ||
135 | 49 | + * notification spec. | ||
136 | 50 | + */ | ||
137 | 51 | +struct SpecImage | ||
138 | 52 | +{ | ||
139 | 53 | + int width, height, rowStride; | ||
140 | 54 | + bool hasAlpha; | ||
141 | 55 | + int bitsPerSample, channels; | ||
142 | 56 | + QByteArray data; | ||
143 | 57 | +}; | ||
144 | 58 | + | ||
145 | 59 | +QDBusArgument &operator<<(QDBusArgument &argument, const SpecImage &image) | ||
146 | 60 | +{ | ||
147 | 61 | + argument.beginStructure(); | ||
148 | 62 | + argument << image.width << image.height << image.rowStride << image.hasAlpha; | ||
149 | 63 | + argument << image.bitsPerSample << image.channels << image.data; | ||
150 | 64 | + argument.endStructure(); | ||
151 | 65 | + return argument; | ||
152 | 66 | +} | ||
153 | 67 | + | ||
154 | 68 | +const QDBusArgument &operator>>(const QDBusArgument &argument, SpecImage &image) | ||
155 | 69 | +{ | ||
156 | 70 | + argument.beginStructure(); | ||
157 | 71 | + argument >> image.width >> image.height >> image.rowStride >> image.hasAlpha; | ||
158 | 72 | + argument >> image.bitsPerSample >> image.channels >> image.data; | ||
159 | 73 | + argument.endStructure(); | ||
160 | 74 | + return argument; | ||
161 | 75 | +} | ||
162 | 76 | + | ||
163 | 77 | +QVariant variantForImage(const QImage &_image) | ||
164 | 78 | +{ | ||
165 | 79 | + qDBusRegisterMetaType<SpecImage>(); | ||
166 | 80 | + | ||
167 | 81 | + QImage image = _image.convertToFormat(QImage::Format_ARGB32); | ||
168 | 82 | + | ||
169 | 83 | + int rowStride = image.width() * 4; | ||
170 | 84 | + | ||
171 | 85 | + // Notification spec stores pixels in R,G,B,A order, regardless of | ||
172 | 86 | + // endianess | ||
173 | 87 | + // Qt represents pixels as 32 bit unsigned int. So the order depend on | ||
174 | 88 | + // endianess: | ||
175 | 89 | + // - In big endian the order is A,R,G,B | ||
176 | 90 | + // - In little endian the order is B,G,R,A | ||
177 | 91 | + QByteArray data; | ||
178 | 92 | + data.resize(rowStride * image.height()); | ||
179 | 93 | + char* dst = data.data(); | ||
180 | 94 | + for (int y=0; y<image.height(); ++y) { | ||
181 | 95 | + QRgb* src = (QRgb*)image.scanLine(y); | ||
182 | 96 | + QRgb* end = src + image.width(); | ||
183 | 97 | + for (;src != end; ++src) { | ||
184 | 98 | + // Probably slow, but free of endianess issues | ||
185 | 99 | + *dst++ = qRed(*src); | ||
186 | 100 | + *dst++ = qGreen(*src); | ||
187 | 101 | + *dst++ = qBlue(*src); | ||
188 | 102 | + *dst++ = qAlpha(*src); | ||
189 | 103 | + } | ||
190 | 104 | + } | ||
191 | 105 | + | ||
192 | 106 | + SpecImage specImage; | ||
193 | 107 | + specImage.width = image.width(); | ||
194 | 108 | + specImage.height = image.height(); | ||
195 | 109 | + specImage.rowStride = rowStride; | ||
196 | 110 | + specImage.hasAlpha = true; | ||
197 | 111 | + specImage.bitsPerSample = 8; | ||
198 | 112 | + specImage.channels = 4; | ||
199 | 113 | + specImage.data = data; | ||
200 | 114 | + | ||
201 | 115 | + return QVariant::fromValue(specImage); | ||
202 | 116 | +} | ||
203 | 117 | + | ||
204 | 118 | +} // namespace | ||
205 | 119 | + | ||
206 | 120 | +Q_DECLARE_METATYPE(ImageConverter::SpecImage) | ||
207 | 121 | --- /dev/null | ||
208 | 122 | +++ b/knotify/imageconverter.h | ||
209 | 123 | @@ -0,0 +1,36 @@ | ||
210 | 124 | +/* | ||
211 | 125 | + Copyright (C) 2009 by Aurélien Gâteau <agateau@kde.org> | ||
212 | 126 | + | ||
213 | 127 | + This program is free software; you can redistribute it and/or modify | ||
214 | 128 | + it under the terms of the GNU General Public License as published by | ||
215 | 129 | + the Free Software Foundation; either version 2, or (at your option) | ||
216 | 130 | + any later version. | ||
217 | 131 | + | ||
218 | 132 | + This program is distributed in the hope that it will be useful, | ||
219 | 133 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
220 | 134 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
221 | 135 | + GNU General Public License for more details. | ||
222 | 136 | + | ||
223 | 137 | + You should have received a copy of the GNU General Public License | ||
224 | 138 | + along with this program; if not, write to the Free Software | ||
225 | 139 | + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
226 | 140 | + | ||
227 | 141 | + */ | ||
228 | 142 | +#ifndef IMAGECONVERTER_H | ||
229 | 143 | +#define IMAGECONVERTER_H | ||
230 | 144 | + | ||
231 | 145 | +class QVariant; | ||
232 | 146 | +class QImage; | ||
233 | 147 | + | ||
234 | 148 | +namespace ImageConverter | ||
235 | 149 | +{ | ||
236 | 150 | + | ||
237 | 151 | +/** | ||
238 | 152 | + * Returns a variant representing an image using the format describe in the | ||
239 | 153 | + * galago spec | ||
240 | 154 | + */ | ||
241 | 155 | +QVariant variantForImage(const QImage &image); | ||
242 | 156 | + | ||
243 | 157 | +} // namespace | ||
244 | 158 | + | ||
245 | 159 | +#endif /* IMAGECONVERTER_H */ | ||
246 | 160 | --- a/knotify/notifybypopup.cpp | ||
247 | 161 | +++ b/knotify/notifybypopup.cpp | ||
248 | 162 | @@ -20,6 +20,7 @@ | ||
249 | 163 | |||
250 | 164 | #include "notifybypopup.h" | ||
251 | 165 | #include "knotifyconfig.h" | ||
252 | 166 | +#include "imageconverter.h" | ||
253 | 167 | |||
254 | 168 | #include <kdebug.h> | ||
255 | 169 | #include <kpassivepopup.h> | ||
256 | 170 | @@ -378,8 +379,10 @@ bool NotifyByPopup::sendNotificationDBus(int id, int replacesId, KNotifyConfig* | ||
257 | 171 | |||
258 | 172 | QVariantMap map; | ||
259 | 173 | // let's see if we've got an image, and store the image in the hints map | ||
260 | 174 | - if (!config->image.isNull()) | ||
261 | 175 | - map["image_data"] = config->image.data(); | ||
262 | 176 | + if (!config->image.isNull()) { | ||
263 | 177 | + QImage image = config->image.toImage(); | ||
264 | 178 | + map["image_data"] = ImageConverter::variantForImage(image); | ||
265 | 179 | + } | ||
266 | 180 | |||
267 | 181 | args.append( map ); // hints | ||
268 | 182 | args.append( timeout ); // expire timout | ||
269 | 0 | 183 | ||
270 | === added file 'debian/patches/kubuntu_89_fdo_notifications.diff' | |||
271 | --- debian/patches/kubuntu_89_fdo_notifications.diff 1970-01-01 00:00:00 +0000 | |||
272 | +++ debian/patches/kubuntu_89_fdo_notifications.diff 2009-07-17 13:41:39 +0000 | |||
273 | @@ -0,0 +1,127 @@ | |||
274 | 1 | From 3b884757032294e77c4094fb5e10cab20e6b987d Mon Sep 17 00:00:00 2001 | ||
275 | 2 | From: =?utf-8?q?Aur=C3=A9lien=20G=C3=A2teau?= <agateau@kde.org> | ||
276 | 3 | Date: Tue, 30 Jun 2009 15:20:33 +0200 | ||
277 | 4 | Subject: [PATCH] Move notification timeout handling to knotify. | ||
278 | 5 | |||
279 | 6 | --- | ||
280 | 7 | --- a/knotify/knotify.cpp | ||
281 | 8 | +++ b/knotify/knotify.cpp | ||
282 | 9 | @@ -110,7 +110,7 @@ void KNotify::closeNotification(int id) | ||
283 | 10 | delete e; | ||
284 | 11 | } | ||
285 | 12 | |||
286 | 13 | -int KNotify::event( const QString & event, const QString & appname, const ContextList & contexts, const QString & title, const QString & text, const KNotifyImage & image, const QStringList & actions, WId winId ) | ||
287 | 14 | +int KNotify::event( const QString & event, const QString & appname, const ContextList & contexts, const QString & title, const QString & text, const KNotifyImage & image, const QStringList & actions, int timeout, WId winId ) | ||
288 | 15 | { | ||
289 | 16 | m_counter++; | ||
290 | 17 | Event *e=new Event(appname , contexts , event ); | ||
291 | 18 | @@ -121,6 +121,7 @@ int KNotify::event( const QString & event, const QString & appname, const Contex | ||
292 | 19 | e->config.text=text; | ||
293 | 20 | e->config.actions=actions; | ||
294 | 21 | e->config.image=image; | ||
295 | 22 | + e->config.timeout=timeout; | ||
296 | 23 | e->config.winId=(WId)winId; | ||
297 | 24 | |||
298 | 25 | m_notifications.insert(m_counter,e); | ||
299 | 26 | @@ -207,7 +208,8 @@ void KNotifyAdaptor::closeNotification(int id) | ||
300 | 27 | } | ||
301 | 28 | |||
302 | 29 | int KNotifyAdaptor::event(const QString &event, const QString &fromApp, const QVariantList& contexts, | ||
303 | 30 | - const QString &title, const QString &text, const QByteArray& image, const QStringList& actions , qlonglong winId) | ||
304 | 31 | + const QString &title, const QString &text, const QByteArray& image, const QStringList& actions, | ||
305 | 32 | + int timeout, qlonglong winId) | ||
306 | 33 | // const QDBusMessage & , int _return ) | ||
307 | 34 | |||
308 | 35 | { | ||
309 | 36 | @@ -231,7 +233,7 @@ int KNotifyAdaptor::event(const QString &event, const QString &fromApp, const QV | ||
310 | 37 | contextlist << qMakePair(context_key , s); | ||
311 | 38 | } | ||
312 | 39 | |||
313 | 40 | - return static_cast<KNotify *>(parent())->event(event, fromApp, contextlist, title, text, image, actions, WId(winId)); | ||
314 | 41 | + return static_cast<KNotify *>(parent())->event(event, fromApp, contextlist, title, text, image, actions, timeout, WId(winId)); | ||
315 | 42 | } | ||
316 | 43 | |||
317 | 44 | void KNotifyAdaptor::reemit(int id, const QVariantList& contexts) | ||
318 | 45 | --- a/knotify/knotify.h | ||
319 | 46 | +++ b/knotify/knotify.h | ||
320 | 47 | @@ -52,7 +52,8 @@ class KNotify : public QObject | ||
321 | 48 | void closeNotification( int id); | ||
322 | 49 | |||
323 | 50 | int event(const QString &event, const QString &fromApp, const ContextList& contexts , | ||
324 | 51 | - const QString &title, const QString &text, const KNotifyImage& image, const QStringList& actions , WId winId = 0); | ||
325 | 52 | + const QString &title, const QString &text, const KNotifyImage& image, const QStringList& actions, | ||
326 | 53 | + int timeout, WId winId = 0); | ||
327 | 54 | |||
328 | 55 | void update(int id, const QString &title, const QString &text, const KNotifyImage& image, const QStringList& actions); | ||
329 | 56 | void reemit(int id, const ContextList& contexts); | ||
330 | 57 | @@ -108,6 +109,7 @@ class KNotifyAdaptor : public QDBusAbstractAdaptor | ||
331 | 58 | "<arg name=\"text\" type=\"s\" direction=\"in\"/>" | ||
332 | 59 | "<arg name=\"pixmap\" type=\"ay\" direction=\"in\"/>" | ||
333 | 60 | "<arg name=\"actions\" type=\"as\" direction=\"in\"/>" | ||
334 | 61 | + "<arg name=\"timeout\" type=\"i\" direction=\"in\"/>" | ||
335 | 62 | "<arg name=\"winId\" type=\"x\" direction=\"in\"/>" | ||
336 | 63 | "</method>" | ||
337 | 64 | "<method name=\"update\">" | ||
338 | 65 | @@ -134,7 +136,8 @@ class KNotifyAdaptor : public QDBusAbstractAdaptor | ||
339 | 66 | void closeNotification( int id); | ||
340 | 67 | |||
341 | 68 | int event(const QString &event, const QString &fromApp, const QVariantList& contexts , | ||
342 | 69 | - const QString &title, const QString &text, const QByteArray& pixmap, const QStringList& actions , qlonglong winId ); | ||
343 | 70 | + const QString &title, const QString &text, const QByteArray& pixmap, const QStringList& actions , int timeout, | ||
344 | 71 | + qlonglong winId ); | ||
345 | 72 | |||
346 | 73 | void reemit(int id, const QVariantList& contexts); | ||
347 | 74 | void update(int id, const QString &title, const QString &text, const QByteArray& pixmap, const QStringList& actions ); | ||
348 | 75 | --- a/knotify/knotifyconfig.h | ||
349 | 76 | +++ b/knotify/knotifyconfig.h | ||
350 | 77 | @@ -84,6 +84,12 @@ class KNotifyConfig | ||
351 | 78 | */ | ||
352 | 79 | KNotifyImage image; | ||
353 | 80 | /** | ||
354 | 81 | + * How long the notification should be presented (in seconds). | ||
355 | 82 | + * -1 means server decides, | ||
356 | 83 | + * 0 means infinite. | ||
357 | 84 | + */ | ||
358 | 85 | + int timeout; | ||
359 | 86 | + /** | ||
360 | 87 | * The windowsID of the window that initiated the notification | ||
361 | 88 | * (it is a window in the client) | ||
362 | 89 | */ | ||
363 | 90 | --- a/knotify/notifybypopup.cpp | ||
364 | 91 | +++ b/knotify/notifybypopup.cpp | ||
365 | 92 | @@ -95,10 +95,9 @@ void NotifyByPopup::notify( int id, KNotifyConfig * config ) | ||
366 | 93 | pop->setAutoDelete( true ); | ||
367 | 94 | connect(pop, SIGNAL(destroyed()) , this, SLOT(slotPopupDestroyed()) ); | ||
368 | 95 | |||
369 | 96 | - // NOTE readEntry here is not KConfigGroup::readEntry - this is a custom class | ||
370 | 97 | - // It returns QString. | ||
371 | 98 | - QString timeoutStr = config->readEntry( "Timeout" ); | ||
372 | 99 | - pop->setTimeout( !timeoutStr.isEmpty() ? timeoutStr.toInt() : 0 ); | ||
373 | 100 | + // Default to 6 seconds if no timeout has been defined | ||
374 | 101 | + int timeout = config->timeout == -1 ? 6 : config->timeout; | ||
375 | 102 | + pop->setTimeout(timeout); | ||
376 | 103 | |||
377 | 104 | pop->adjustSize(); | ||
378 | 105 | pop->show(QPoint(screen.left() + screen.width()/2 - pop->width()/2 , m_nextPosition)); | ||
379 | 106 | @@ -346,12 +345,6 @@ bool NotifyByPopup::sendNotificationDBus(int id, int replacesId, KNotifyConfig* | ||
380 | 107 | |||
381 | 108 | QDBusMessage m = QDBusMessage::createMethodCall( dbusServiceName, dbusPath, dbusInterfaceName, "Notify" ); | ||
382 | 109 | |||
383 | 110 | - // NOTE readEntry here is not KConfigGroup::readEntry - this is a custom class | ||
384 | 111 | - // It returns QString. | ||
385 | 112 | - QString timeoutStr = config->readEntry( "Timeout" ); | ||
386 | 113 | - // -1 means: notification server decides | ||
387 | 114 | - int timeout = !timeoutStr.isEmpty() ? timeoutStr.toInt() : -1; | ||
388 | 115 | - | ||
389 | 116 | QList<QVariant> args; | ||
390 | 117 | |||
391 | 118 | QString appCaption, iconName; | ||
392 | 119 | @@ -385,7 +378,7 @@ bool NotifyByPopup::sendNotificationDBus(int id, int replacesId, KNotifyConfig* | ||
393 | 120 | } | ||
394 | 121 | |||
395 | 122 | args.append( map ); // hints | ||
396 | 123 | - args.append( timeout ); // expire timout | ||
397 | 124 | + args.append( config->timeout ); // expire timout | ||
398 | 125 | |||
399 | 126 | m.setArguments( args ); | ||
400 | 127 | QDBusMessage replyMsg = QDBusConnection::sessionBus().call(m); | ||
401 | 0 | 128 | ||
402 | === modified file 'debian/patches/series' | |||
403 | --- debian/patches/series 2009-05-13 17:38:23 +0000 | |||
404 | +++ debian/patches/series 2009-07-17 13:41:39 +0000 | |||
405 | @@ -6,3 +6,7 @@ | |||
406 | 6 | kubuntu_07_oxygenify_knetattach_icon.diff | 6 | kubuntu_07_oxygenify_knetattach_icon.diff |
407 | 7 | kubuntu_08_suggest_soprano_backend_sesame.diff | 7 | kubuntu_08_suggest_soprano_backend_sesame.diff |
408 | 8 | kubuntu_85_language_selector.diff | 8 | kubuntu_85_language_selector.diff |
409 | 9 | kubuntu_86_fdo_notifications.diff | ||
410 | 10 | kubuntu_87_fdo_notifications.diff | ||
411 | 11 | kubuntu_88_fdo_notifications.diff | ||
412 | 12 | kubuntu_89_fdo_notifications.diff |