Gentoo Archives: gentoo-commits

From: "Andreas HAttel (dilfridge)" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/kactivities/files: kactivities-4.8.1-nepomuk.patch
Date: Sun, 08 Apr 2012 14:53:02
Message-Id: 20120408145242.D2DE92004C@flycatcher.gentoo.org
1 dilfridge 12/04/08 14:52:42
2
3 Added: kactivities-4.8.1-nepomuk.patch
4 Log:
5 Manually patch kactivities-4.8.1 to kde-4.8.2 state, to prevent (most of the) crashes as in bug 411279
6
7 (Portage version: 2.1.10.56/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 kde-base/kactivities/files/kactivities-4.8.1-nepomuk.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kactivities/files/kactivities-4.8.1-nepomuk.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kactivities/files/kactivities-4.8.1-nepomuk.patch?rev=1.1&content-type=text/plain
14
15 Index: kactivities-4.8.1-nepomuk.patch
16 ===================================================================
17 diff -ruN kactivities-4.8.1/service/ActivityManager.cpp kactivities-4.8.2/service/ActivityManager.cpp
18 --- kactivities-4.8.1/service/ActivityManager.cpp 2011-12-20 18:49:44.000000000 +0100
19 +++ kactivities-4.8.2/service/ActivityManager.cpp 2012-03-29 12:58:36.000000000 +0200
20 @@ -80,7 +80,8 @@
21 windows(_windows),
22 resources(_resources),
23 #ifdef HAVE_NEPOMUK
24 - m_nepomukInitCalled(false),
25 + m_nepomukInitialized(false),
26 + m_nepomukWatcher(0),
27 #endif
28 q(parent),
29 ksmserverInterface(0)
30 @@ -90,7 +91,17 @@
31 kDebug() << "-------------------------------------------------------";
32
33 #ifdef HAVE_NEPOMUK
34 - Nepomuk::ResourceManager::instance()->init();
35 + if (QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.nepomuk.services.nepomukstorage"))) {
36 + QTimer::singleShot(500, this, SLOT(nepomukOnline()));
37 +
38 + } else {
39 + m_nepomukWatcher = new QDBusServiceWatcher(QLatin1String("org.kde.nepomuk.services.nepomukstorage"),
40 + QDBusConnection::sessionBus(),
41 + QDBusServiceWatcher::WatchForRegistration | QDBusServiceWatcher::WatchForUnregistration,
42 + this);
43 + connect(m_nepomukWatcher, SIGNAL(serviceRegistered(QString)), this, SLOT(nepomukOnline()));
44 + connect(m_nepomukWatcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(nepomukOffline()));
45 + }
46 #endif
47
48 // Initializing config
49 @@ -308,6 +319,8 @@
50 void ActivityManagerPrivate::syncActivitiesWithNepomuk()
51 {
52 #ifdef HAVE_NEPOMUK
53 + if (!nepomukInitialized()) return;
54 +
55 foreach (const QString & activityId, activities.keys()) {
56 Nepomuk::Resource activityResource(activityId, KEXT::Activity());
57
58 @@ -337,32 +350,9 @@
59 }
60
61 /* lazy init of nepomuk */
62 -bool ActivityManagerPrivate::nepomukInitialized()
63 -{
64 - if (m_nepomukInitCalled) return
65 - Nepomuk::ResourceManager::instance()->initialized();
66 -
67 - m_nepomukInitCalled = true;
68 -
69 - connect(Nepomuk::ResourceManager::instance(), SIGNAL(nepomukSystemStarted()), this, SLOT(backstoreAvailable()));
70 -
71 - return (Nepomuk::ResourceManager::instance()->init() == 0);
72 -}
73 -
74 -void ActivityManagerPrivate::backstoreAvailable()
75 -{
76 - //emit q->BackstoreAvailable();
77 - //kick the icons, so that clients don't need to know that they depend on nepomuk
78 - for (QHash<QString, ActivityManager::State>::const_iterator i = activities.constBegin();
79 - i != activities.constEnd(); ++i) {
80 - emit q->ActivityChanged(i.key());
81 - }
82 -}
83 -
84 -#else // HAVE_NEPOMUK
85 -
86 -void ActivityManagerPrivate::backstoreAvailable()
87 +bool ActivityManagerPrivate::nepomukInitialized() const
88 {
89 + return m_nepomukInitialized;
90 }
91
92 #endif // HAVE_NEPOMUK
93 @@ -651,6 +641,27 @@
94 transitioningActivity.clear();
95 }
96
97 +void ActivityManagerPrivate::nepomukOnline()
98 +{
99 +#ifdef HAVE_NEPOMUK
100 + Nepomuk::ResourceManager::instance()->init();
101 +
102 + for (QHash<QString, ActivityManager::State>::const_iterator i = activities.constBegin();
103 + i != activities.constEnd(); ++i) {
104 + emit q->ActivityChanged(i.key());
105 + }
106 +
107 + m_nepomukInitialized = true;
108 +#endif
109 +}
110 +
111 +void ActivityManagerPrivate::nepomukOffline()
112 +{
113 +#ifdef HAVE_NEPOMUK
114 + m_nepomukInitialized = false;
115 +#endif
116 +}
117 +
118 int ActivityManager::ActivityState(const QString & id) const
119 {
120 //kDebug() << id << "- is it in" << d->activities << "?";
121 @@ -789,7 +800,7 @@
122 kDebug() << "New event on the horizon" << application << windowId << event << uri;
123
124 #ifdef HAVE_NEPOMUK
125 - if (uri.startsWith("nepomuk:")) {
126 + if (NEPOMUK_RUNNING && uri.startsWith("nepomuk:")) {
127 Nepomuk::Resource resource(kuri);
128
129 if (resource.hasProperty(NIE::url())) {
130 @@ -830,36 +841,37 @@
131 d->resources[kuri].mimetype = mimetype;
132
133 #ifdef HAVE_NEPOMUK
134 - Nepomuk::Resource resource(kuri);
135 - if (!resource.hasProperty(NIE::mimeType())) {
136 - kDebug() << "Setting the mime in nepomuk for" << uri << "to be" << mimetype;
137 - resource.setProperty(NIE::mimeType(), mimetype);
138 + if (NEPOMUK_RUNNING) {
139 + Nepomuk::Resource resource(kuri);
140 + if (!resource.hasProperty(NIE::mimeType())) {
141 + kDebug() << "Setting the mime in nepomuk for" << uri << "to be" << mimetype;
142 + resource.setProperty(NIE::mimeType(), mimetype);
143
144 - if (mimetype.startsWith("image/")) {
145 - resource.addType(NFO::Image());
146 + if (mimetype.startsWith("image/")) {
147 + resource.addType(NFO::Image());
148
149 - } else if (mimetype.startsWith("video/")) {
150 - resource.addType(NFO::Video());
151 + } else if (mimetype.startsWith("video/")) {
152 + resource.addType(NFO::Video());
153
154 - } else if (mimetype.startsWith("audio/")) {
155 - resource.addType(NFO::Audio());
156 + } else if (mimetype.startsWith("audio/")) {
157 + resource.addType(NFO::Audio());
158
159 - } else if (mimetype.startsWith("image/")) {
160 - resource.addType(NFO::Image());
161 + } else if (mimetype.startsWith("image/")) {
162 + resource.addType(NFO::Image());
163
164 - } else if (mimetype.startsWith("text/")) {
165 - if (!resource.hasType(NFO::Bookmark())) {
166 - resource.addType(NFO::TextDocument());
167 + } else if (mimetype.startsWith("text/")) {
168 + if (!resource.hasType(NFO::Bookmark())) {
169 + resource.addType(NFO::TextDocument());
170
171 - if (mimetype == "text/plain") {
172 - resource.addType(NFO::PlainTextDocument());
173 + if (mimetype == "text/plain") {
174 + resource.addType(NFO::PlainTextDocument());
175
176 - } else if (mimetype == "text/html") {
177 - resource.addType(NFO::HtmlDocument());
178 + } else if (mimetype == "text/html") {
179 + resource.addType(NFO::HtmlDocument());
180 + }
181 }
182 }
183 }
184 -
185 }
186 #endif
187 }
188 @@ -876,13 +888,15 @@
189 d->resources[kuri].title = title;
190
191 #ifdef HAVE_NEPOMUK
192 - kDebug() << "Setting the title for" << uri << "to be" << title;
193 - Nepomuk::Resource resource(kuri);
194 + if (NEPOMUK_RUNNING) {
195 + kDebug() << "Setting the title for" << uri << "to be" << title;
196 + Nepomuk::Resource resource(kuri);
197
198 - kDebug() << uri << "local?" << kuri.isLocalFile()
199 - << "title" << resource.hasProperty(NIE::title());
200 - if (!kuri.isLocalFile() || !resource.hasProperty(NIE::title())) {
201 - resource.setProperty(NIE::title(), title);
202 + kDebug() << uri << "local?" << kuri.isLocalFile()
203 + << "title" << resource.hasProperty(NIE::title());
204 + if (!kuri.isLocalFile() || !resource.hasProperty(NIE::title())) {
205 + resource.setProperty(NIE::title(), title);
206 + }
207 }
208 #endif
209 }
210 @@ -890,7 +904,7 @@
211 void ActivityManager::LinkResourceToActivity(const QString & uri, const QString & activity)
212 {
213 #ifdef HAVE_NEPOMUK
214 - if (!d->nepomukInitialized()) return;
215 + if (!NEPOMUK_RUNNING) return;
216
217 kDebug() << "Linking" << uri << "to" << activity << CurrentActivity();
218
219 diff -ruN kactivities-4.8.1/service/ActivityManager_p.h kactivities-4.8.2/service/ActivityManager_p.h
220 --- kactivities-4.8.1/service/ActivityManager_p.h 2011-12-02 22:16:56.000000000 +0100
221 +++ kactivities-4.8.2/service/ActivityManager_p.h 2012-03-29 12:58:36.000000000 +0200
222 @@ -23,6 +23,7 @@
223 #include <QSet>
224 #include <QString>
225 #include <QTimer>
226 +#include <QDBusServiceWatcher>
227
228 #include <KConfig>
229 #include <KConfigGroup>
230 @@ -83,12 +84,6 @@
231 KConfigGroup mainConfig();
232 QString activityName(const QString & id);
233
234 -#ifdef HAVE_NEPOMUK
235 - Nepomuk::Resource activityResource(const QString & id);
236 - bool nepomukInitialized();
237 - mutable bool m_nepomukInitCalled;
238 -#endif // HAVE_NEPOMUK
239 -
240 public Q_SLOTS:
241 void scheduleConfigSync();
242 void configSync();
243 @@ -103,10 +98,22 @@
244 void reallyStartActivity(const QString & id);
245 void reallyStopActivity(const QString & id);
246
247 - void backstoreAvailable();
248 void syncActivitiesWithNepomuk();
249 void sessionServiceRegistered();
250
251 +public Q_SLOTS:
252 + void nepomukOnline();
253 + void nepomukOffline();
254 +
255 +#ifdef HAVE_NEPOMUK
256 +public:
257 + Nepomuk::Resource activityResource(const QString & id);
258 + bool nepomukInitialized() const;
259 +
260 + mutable bool m_nepomukInitialized : 1;
261 + QDBusServiceWatcher * m_nepomukWatcher;
262 +#endif // HAVE_NEPOMUK
263 +
264 private:
265 ActivityManager * const q;
266 QDBusInterface *ksmserverInterface; //just keeping it for the signals
267 diff -ruN kactivities-4.8.1/service/activitymanager-plugin.desktop kactivities-4.8.2/service/activitymanager-plugin.desktop
268 --- kactivities-4.8.1/service/activitymanager-plugin.desktop 2012-02-29 23:56:02.000000000 +0100
269 +++ kactivities-4.8.2/service/activitymanager-plugin.desktop 2012-03-29 12:58:36.000000000 +0200
270 @@ -7,6 +7,7 @@
271 Comment[cs]=Modul Správce aktivit
272 Comment[da]=Aktivitetshåndtering-plugin
273 Comment[de]=Modul für Aktivitätenverwaltung
274 +Comment[el]=Πρόσθετο διαχειριστή δραστηριοτήτων
275 Comment[es]=Complemento del gestor de actividades
276 Comment[et]=Tegevuste haldamise plugin
277 Comment[eu]=Jarduera kudeatzailearen plugina
278 diff -ruN kactivities-4.8.1/service/kactivitymanagerd.desktop kactivities-4.8.2/service/kactivitymanagerd.desktop
279 --- kactivities-4.8.1/service/kactivitymanagerd.desktop 2012-02-29 23:56:02.000000000 +0100
280 +++ kactivities-4.8.2/service/kactivitymanagerd.desktop 2012-03-29 12:58:36.000000000 +0200
281 @@ -11,6 +11,7 @@
282 Name[cs]=Správce aktivit
283 Name[da]=Aktivitetshåndtering
284 Name[de]=Aktivitätenverwaltung
285 +Name[el]=Διαχειριστής δραστηριοτήτων
286 Name[es]=Gestor de actividades
287 Name[et]=Tegevuste haldur
288 Name[eu]=Jarduera kudeatzailea
289 @@ -50,6 +51,7 @@
290 Comment[cs]=Podpůrná vrstva pro správu aktivit
291 Comment[da]=Motor til aktivitetshåndtering
292 Comment[de]=Backend der Aktivitätenverwaltung
293 +Comment[el]=Το σύστημα υποστήριξης διαχείρισης δραστηριοτήτων
294 Comment[es]=El motor de la gestión de actividades
295 Comment[et]=Tegevuste haldamise taustaprogramm
296 Comment[eu]=Jarduera kudeaketa 'backend'
297 diff -ruN kactivities-4.8.1/service/plugins/dummy/activitymanager-plugin-dummy.desktop kactivities-4.8.2/service/plugins/dummy/activitymanager-plugin-dummy.desktop
298 --- kactivities-4.8.1/service/plugins/dummy/activitymanager-plugin-dummy.desktop 2012-02-29 23:56:02.000000000 +0100
299 +++ kactivities-4.8.2/service/plugins/dummy/activitymanager-plugin-dummy.desktop 2012-03-29 12:58:36.000000000 +0200
300 @@ -4,6 +4,7 @@
301 Name[cs]=Prázdný modul
302 Name[da]=Attrap-plugin
303 Name[de]=Dummy-Modul
304 +Name[el]=Ψεύτικο πρόσθετο
305 Name[es]=Complemento vacío
306 Name[et]=Kohatäiteplugin
307 Name[eu]=Gezurrezko plugina
308 @@ -42,6 +43,7 @@
309 Comment[cs]=Pouze testovací
310 Comment[da]=Tester lige
311 Comment[de]=Nur zum Testen
312 +Comment[el]=Δοκιμή
313 Comment[es]=Solo para pruebas
314 Comment[et]=Lihtsalt test
315 Comment[eu]=Soilik probatarako
316 diff -ruN kactivities-4.8.1/service/plugins/nepomuk/activitymanager-plugin-nepomuk.desktop kactivities-4.8.2/service/plugins/nepomuk/activitymanager-plugin-nepomuk.desktop
317 --- kactivities-4.8.1/service/plugins/nepomuk/activitymanager-plugin-nepomuk.desktop 2012-02-29 23:56:02.000000000 +0100
318 +++ kactivities-4.8.2/service/plugins/nepomuk/activitymanager-plugin-nepomuk.desktop 2012-03-29 12:58:36.000000000 +0200
319 @@ -1,90 +1,3 @@
320 [Desktop Entry]
321 -Name=Nepomuk Feeder Plugin
322 -Name[ca]=Connector de l'alimentador del Nepomuk
323 -Name[da]=Nepomuk-feeder-plugin
324 -Name[es]=Complemento de aprovisionamiento de Nepomuk
325 -Name[et]=Nepomuki sööturi plugin
326 -Name[eu]=Nepomuk elikatzeko plugina
327 -Name[fi]=Nepomuk-syöteliitännäinen
328 -Name[ga]=Breiseán Fothaire Nepomuk
329 -Name[gl]=Engadido alimentador de Nepomuk
330 -Name[he]=תוסף רסס של Nepomuk
331 -Name[hu]=Nepomuk-feltöltő bővítmény
332 -Name[ia]=Plugin de Syndacation de Nepomuk
333 -Name[it]=Estensione di rifornimento di Nepomuk
334 -Name[kk]=Nepomuk бергіш плагині
335 -Name[km]=កម្មវិធី​ជំនួយ​របស់​​កម្មវិធី​មតិ​ព័ត៌មាន Nepomuk
336 -Name[nb]=Programtillegg for Nepomuk innmating
337 -Name[nds]=Nepomuk-Ingaavmoduul
338 -Name[nl]=Plug-in van Nepomuk-feeder
339 -Name[pa]=ਨਿਪੋਮੁਕ ਫੀਡਰ ਪਲੱਗਇਨ
340 -Name[pl]=Wtyczka podajnika Nepomuk
341 -Name[pt]='Plugin' de Fontes do Nepomuk
342 -Name[pt_BR]=Plugin de fontes de notícias do Nepomuk
343 -Name[ro]=Modul de alimentare Nepomuk
344 -Name[se]=Lassemodula Nepomuk-biebmamii
345 -Name[sk]=Plugin podávača Nepomuk
346 -Name[sr]=Прикључак Непомуковог уводника
347 -Name[sr@ijekavian]=Прикључак Непомуковог уводника
348 -Name[sr@ijekavianlatin]=Priključak Nepomukovog uvodnika
349 -Name[sr@latin]=Priključak Nepomukovog uvodnika
350 -Name[sv]=Nepomuk-inmatningsinsticksprogram
351 -Name[tr]=Nepomuk Besleme Eklentisi
352 -Name[uk]=Додаток передавання даних Nepomuk
353 -Name[x-test]=xxNepomuk Feeder Pluginxx
354 -Name[zh_CN]=Nepomuk 采集器插件
355 -Name[zh_TW]=Nepomuk Feeder 外掛程式
356 -Comment=Plugin to store and score events in Nepomuk
357 -Comment[ca]=Connector per emmagatzemar i classificar esdeveniments en el Nepomuk
358 -Comment[da]=Plugin til at gemme og bedømme begivenheder i Nepomuk
359 -Comment[de]=Modul zum Speichern und Bewerten von Ereignissen in Nepomuk
360 -Comment[es]=Complemento para almacenar y puntuar eventos en Nepomuk
361 -Comment[et]=Plugin sündmuste salvestamiseks Nepomukki ja nende hindamiseks
362 -Comment[eu]=Nepomuk-en gertaerak biltegiratu eta puntuatzeko plugina
363 -Comment[fi]=Liitännäinen tapahtumien tallentamiseen ja arvosanoittamiseen Nepomukissa
364 -Comment[ga]=Breiseán a stórálann agus scórálann imeachtaí in Nepomuk
365 -Comment[gl]=Un engadido para gardar e cualificar acontecementos en Nepomuk
366 -Comment[he]=תוסף לשמירה ורישום של אירועים ב־Nepomuk
367 -Comment[hu]=Bővítmény események tárolására és pontozására a Nepomukban
368 -Comment[ia]=Plugin pro immagazinar e dar punctos a eventos in Nepomuk
369 -Comment[it]=Estensione per memorizzare e valutare gli eventi di Nepomuk
370 -Comment[kk]=Оқиғаларды сақтап бағалайтын Nepomuk қызметі
371 -Comment[km]=កម្មវិធី​ជំនួយ​ត្រូវ​​ទុក និង​​ព្រឹត្តិការណ៍​ពិន្ទុ​នៅ​ក្នុង Nepomuk
372 -Comment[nb]=Programtillegg for å lagre og poengsette hendelser i Nepomuk
373 -Comment[nds]=Nepomuk-Moduul för't Sekern un Beweerten vun Begeefnissen
374 -Comment[nl]=Plug-in om gebeurtenissen in Nepomuk op te slaan en van een score te voorzien
375 -Comment[pa]=ਨਿਪੋਮੁਕ ਵਿੱਚ ਈਵੈਂਟ ਸਟੋਰ ਕਰਨ ਅਤੇ ਸਕਰੋ ਲਈ ਪਲੱਗਇਨ
376 -Comment[pl]=Wtyczka do przechowywania i oceny zdarzeń w Nepomuk
377 -Comment[pt]='Plugin' para guardar e classificar os eventos no Nepomuk
378 -Comment[pt_BR]=Plugin para armazenar e classificar os eventos no Nepomuk
379 -Comment[ro]=Modul pentru stocarea și notarea evenimentelor în Nepomuk
380 -Comment[se]=Lassemodula mainna vurke ja bidjá árvvuid Nepomukis
381 -Comment[sk]=Plugin na uloženie a bodovanie udalosti v Nepomuku
382 -Comment[sl]=Vstavek za shranjevanje in označevanje dogodkov v Nepomuku
383 -Comment[sr]=Прикључак за складиштење и оцењивање догађаја у Непомуку
384 -Comment[sr@ijekavian]=Прикључак за складиштење и оцењивање догађаја у Непомуку
385 -Comment[sr@ijekavianlatin]=Priključak za skladištenje i ocenjivanje događaja u Nepomuku
386 -Comment[sr@latin]=Priključak za skladištenje i ocenjivanje događaja u Nepomuku
387 -Comment[sv]=Insticksprogram för att lagra och betygsätta händelser i Nepomuk
388 -Comment[tr]=Nepomuk'ta olayları derecelendirmek ve saklamak için gerekli eklenti
389 -Comment[uk]=Додаток для зберігання і оцінки подій у Nepomuk
390 -Comment[x-test]=xxPlugin to store and score events in Nepomukxx
391 -Comment[zh_CN]=将事件在 Nepomuk 中存储并打分的插件
392 -Comment[zh_TW]=在 Nepomuk 裡儲存與評分事件用的外掛程式
393 -Type=Service
394 -Icon=nepomukk
395 +Hidden=true
396
397 -X-KDE-ServiceTypes=ActivityManager/Plugin
398 -X-KDE-Library=activitymanager_plugin_nepomuk
399 -X-KDE-PluginInfo-Author=Ivan Cukic
400 -X-KDE-PluginInfo-Email=ivan.cukic@×××.org
401 -X-KDE-PluginInfo-Name=org.kde.kactivitymanager.nepomuk
402 -X-KDE-PluginInfo-Version=1.0
403 -X-KDE-PluginInfo-Website=http://plasma.kde.org/
404 -X-KDE-PluginInfo-Category=Language
405 -X-KDE-PluginInfo-Depends=
406 -X-KDE-PluginInfo-License=GPL
407 -X-KDE-PluginInfo-EnabledByDefault=true
408 -
409 -X-ActivityManager-PluginType=lazyeventhandler
410 -X-ActivityManager-PluginOverrides=activitymanager_plugin_dummy
411 diff -ruN kactivities-4.8.1/service/plugins/slc/activitymanager-plugin-slc.desktop kactivities-4.8.2/service/plugins/slc/activitymanager-plugin-slc.desktop
412 --- kactivities-4.8.1/service/plugins/slc/activitymanager-plugin-slc.desktop 2012-02-29 23:56:02.000000000 +0100
413 +++ kactivities-4.8.2/service/plugins/slc/activitymanager-plugin-slc.desktop 2012-03-29 12:58:36.000000000 +0200
414 @@ -37,6 +37,7 @@
415 Comment[ca]=Connector per proporcionar dades al sistema SLC
416 Comment[da]=Plugin til at levere data til SLC-systemet
417 Comment[de]=Modul, um dem SLC-System Daten bereitzustellen.
418 +Comment[el]=Πρόσθετο παροχής δεδομένων στο σύστημα SLC
419 Comment[es]=Complemento para proporcionar datos al sistema SLC
420 Comment[et]=Plugin andmete pakkumiseks SLC süsteemile
421 Comment[eu]=SLC sistemari datuak hornitzeko plugina