Gentoo Archives: gentoo-commits

From: "Tomas Chvatal (scarabeus)" <scarabeus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/kdelibs/files: 4.2.0-kded.patch 4.2.0-kio_copy.patch 4.2.0-klauncher_konsole.patch 4.2.0-klauncher.patch
Date: Sat, 31 Jan 2009 13:39:45
Message-Id: E1LTG4U-0000DK-KF@stork.gentoo.org
1 scarabeus 09/01/31 13:39:42
2
3 Added: 4.2.0-kded.patch 4.2.0-kio_copy.patch
4 4.2.0-klauncher_konsole.patch 4.2.0-klauncher.patch
5 Log:
6 Add upstream patches. Revbump.
7 (Portage version: 2.2_rc23/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 kde-base/kdelibs/files/4.2.0-kded.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-kded.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-kded.patch?rev=1.1&content-type=text/plain
14
15 Index: 4.2.0-kded.patch
16 ===================================================================
17 --- branches/KDE/4.2/kdelibs/kded/kded.cpp 2009/01/30 20:27:26 918837
18 +++ branches/KDE/4.2/kdelibs/kded/kded.cpp 2009/01/30 20:28:25 918838
19 @@ -115,9 +115,8 @@
20 KToolInvocation::kdeinitExecWait( "kdontchangethehostname", args );
21 }
22
23 -Kded::Kded(bool checkUpdates)
24 - : b_checkUpdates(checkUpdates),
25 - m_needDelayedCheck(false)
26 +Kded::Kded()
27 + : m_needDelayedCheck(false)
28 {
29 _self = this;
30
31 @@ -280,7 +279,7 @@
32 KSharedConfig::Ptr config = KGlobal::config();
33 // Ensure the service exists.
34 KService::Ptr service = KService::serviceByDesktopPath("kded/"+obj+".desktop");
35 - if (!service)
36 + if (!service)
37 return;
38 KConfigGroup cg(config, QString("Module-%1").arg(service->desktopEntryName()));
39 cg.writeEntry("autoload", autoload);
40 @@ -290,7 +289,7 @@
41 bool Kded::isModuleAutoloaded(const QString &obj) const
42 {
43 KService::Ptr s = KService::serviceByDesktopPath("kded/"+obj+".desktop");
44 - if (!s)
45 + if (!s)
46 return false;
47 return isModuleAutoloaded(s);
48 }
49 @@ -307,7 +306,7 @@
50 bool Kded::isModuleLoadedOnDemand(const QString &obj) const
51 {
52 KService::Ptr s = KService::serviceByDesktopPath("kded/"+obj+".desktop");
53 - if (!s)
54 + if (!s)
55 return false;
56 return isModuleLoadedOnDemand(s);
57 }
58 @@ -446,7 +445,7 @@
59
60 void Kded::updateDirWatch()
61 {
62 - if (!b_checkUpdates) return;
63 + if (!bCheckUpdates) return;
64
65 delete m_pDirWatch;
66 m_pDirWatch = new KDirWatch;
67 @@ -471,7 +470,7 @@
68 {
69 delete KSycoca::self();
70
71 - if (!b_checkUpdates) return;
72 + if (!bCheckUpdates) return;
73
74 if (delayedCheck) return;
75
76 @@ -921,7 +920,7 @@
77 checkStamps = cg.readEntry("CheckFileStamps", true);
78 delayedCheck = cg.readEntry("DelayedCheck", false);
79
80 - Kded *kded = new Kded(false); // Build data base
81 + Kded *kded = new Kded(); // Build data base
82
83 KDE_signal(SIGTERM, sighandler);
84 KDE_signal(SIGHUP, sighandler);
85 --- branches/KDE/4.2/kdelibs/kded/kded.h 2009/01/30 20:27:26 918837
86 +++ branches/KDE/4.2/kdelibs/kded/kded.h 2009/01/30 20:28:25 918838
87 @@ -41,7 +41,7 @@
88 {
89 Q_OBJECT
90 public:
91 - Kded(bool checkUpdates);
92 + Kded();
93 virtual ~Kded();
94
95 static Kded *self() { return _self;}
96 @@ -186,8 +186,6 @@
97 */
98 KDirWatch* m_pDirWatch;
99
100 - bool b_checkUpdates;
101 -
102 /**
103 * When a desktop file is updated, a timer is started (5 sec)
104 * before rebuilding the binary - so that multiple updates result
105
106
107
108 1.1 kde-base/kdelibs/files/4.2.0-kio_copy.patch
109
110 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-kio_copy.patch?rev=1.1&view=markup
111 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-kio_copy.patch?rev=1.1&content-type=text/plain
112
113 Index: 4.2.0-kio_copy.patch
114 ===================================================================
115 Index: branches/KDE/4.2/kdelibs/kio/kio/copyjob.h
116 ===================================================================
117 --- branches/KDE/4.2/kdelibs/kio/kio/copyjob.h (revision 917169)
118 +++ branches/KDE/4.2/kdelibs/kio/kio/copyjob.h (revision 917170)
119 @@ -245,6 +245,7 @@
120
121 protected:
122 CopyJob(CopyJobPrivate &dd);
123 + void emitResult();
124
125 private:
126 Q_PRIVATE_SLOT(d_func(), void slotStart())
127 Index: branches/KDE/4.2/kdelibs/kio/kio/copyjob.cpp
128 ===================================================================
129 --- branches/KDE/4.2/kdelibs/kio/kio/copyjob.cpp (revision 917169)
130 +++ branches/KDE/4.2/kdelibs/kio/kio/copyjob.cpp (revision 917170)
131 @@ -153,7 +153,7 @@
132 QList<CopyInfo> dirs;
133 KUrl::List dirsToRemove;
134 KUrl::List m_srcList;
135 - KUrl::List m_skippedSourceUrls;
136 + KUrl::List m_successSrcList;
137 KUrl::List::const_iterator m_currentStatSrc;
138 bool m_bCurrentSrcIsDir;
139 bool m_bCurrentOperationIsLink;
140 @@ -770,10 +770,6 @@
141
142 void CopyJobPrivate::skip( const KUrl & sourceUrl )
143 {
144 - // If this is one if toplevel sources,
145 - // remove it from d->m_srcList, for a correct FilesRemoved() signal
146 - // But don't do it right away, we have iterators into that list (#157601)
147 - m_skippedSourceUrls.append( sourceUrl );
148 dirsToRemove.removeAll( sourceUrl );
149 }
150
151 @@ -857,6 +853,7 @@
152 {
153 //this is required for the undo feature
154 emit q->copyingDone( q, (*it).uSource, (*it).uDest, (*it).mtime, true, false );
155 + m_successSrcList.append((*it).uSource);
156 m_directoriesCopied.append( *it );
157 dirs.erase( it );
158 }
159 @@ -1118,6 +1115,7 @@
160 emit q->copyingDone( q, (*it).uSource, (*it).uDest, (*it).mtime, false, false );
161 if (m_mode == CopyJob::Move)
162 org::kde::KDirNotify::emitFileMoved( (*it).uSource.url(), (*it).uDest.url() );
163 + m_successSrcList.append((*it).uSource);
164 }
165 // remove from list, to move on to next file
166 files.erase( it );
167 @@ -1372,7 +1370,7 @@
168 KIO::Job * newjob = 0;
169 if ( m_mode == CopyJob::Link ) {
170 // User requested that a symlink be made
171 - JobFlags flags = bOverwrite ? Overwrite : DefaultFlags;
172 + const JobFlags flags = bOverwrite ? Overwrite : DefaultFlags;
173 newjob = linkNextFile(uSource, uDest, flags);
174 if (!newjob)
175 return;
176 @@ -1384,7 +1382,7 @@
177 (uSource.pass() == uDest.pass()))
178 // Copying a symlink - only on the same protocol/host/etc. (#5601, downloading an FTP file through its link),
179 {
180 - JobFlags flags = bOverwrite ? Overwrite : DefaultFlags;
181 + const JobFlags flags = bOverwrite ? Overwrite : DefaultFlags;
182 KIO::SimpleJob *newJob = KIO::symlink( (*it).linkDest, uDest, flags | HideProgressInfo /*no GUI*/ );
183 Scheduler::scheduleJob(newJob);
184 newjob = newJob;
185 @@ -1509,23 +1507,6 @@
186 // but then we need to jump to the else part below. Maybe with a recursive call?
187 #endif
188 } else {
189 - // Finished - tell the world
190 - if ( !m_bOnlyRenames )
191 - {
192 - KUrl url( m_globalDest );
193 - if ( m_globalDestinationState != DEST_IS_DIR || m_asMethod )
194 - url.setPath( url.directory() );
195 - //kDebug(7007) << "KDirNotify'ing FilesAdded " << url;
196 - org::kde::KDirNotify::emitFilesAdded( url.url() );
197 -
198 - Q_FOREACH(const KUrl& url, m_skippedSourceUrls)
199 - m_srcList.removeAll(url);
200 -
201 - if ( m_mode == CopyJob::Move && !m_srcList.isEmpty() ) {
202 - //kDebug(7007) << "KDirNotify'ing FilesRemoved " << m_srcList.toStringList();
203 - org::kde::KDirNotify::emitFilesRemoved( m_srcList.toStringList() );
204 - }
205 - }
206 if (m_reportTimer)
207 m_reportTimer->stop();
208 --m_processedFiles; // undo the "start at 1" hack
209 @@ -1535,6 +1516,27 @@
210 }
211 }
212
213 +void CopyJob::emitResult()
214 +{
215 + Q_D(CopyJob);
216 + // Before we go, tell the world about the changes that were made.
217 + // Even if some error made us abort midway, we might still have done
218 + // part of the job so we better update the views! (#118583)
219 + if (!d->m_bOnlyRenames) {
220 + KUrl url(d->m_globalDest);
221 + if (d->m_globalDestinationState != DEST_IS_DIR || d->m_asMethod)
222 + url.setPath(url.directory());
223 + //kDebug(7007) << "KDirNotify'ing FilesAdded " << url;
224 + org::kde::KDirNotify::emitFilesAdded( url.url() );
225 +
226 + if (d->m_mode == CopyJob::Move && !d->m_successSrcList.isEmpty()) {
227 + kDebug(7007) << "KDirNotify'ing FilesRemoved" << d->m_successSrcList.toStringList();
228 + org::kde::KDirNotify::emitFilesRemoved(d->m_successSrcList.toStringList());
229 + }
230 + }
231 + Job::emitResult();
232 +}
233 +
234 void CopyJobPrivate::slotProcessedSize( KJob*, qulonglong data_size )
235 {
236 Q_Q(CopyJob);
237 @@ -1801,6 +1803,7 @@
238 kDebug(7007) << "Renaming succeeded, move on";
239 ++m_processedFiles;
240 emit q->copyingDone( q, *m_currentStatSrc, dest, -1 /*mtime unknown, and not needed*/, true, true );
241 + m_successSrcList.append(*m_currentStatSrc);
242 statNextSrc();
243 }
244 }
245
246
247
248 1.1 kde-base/kdelibs/files/4.2.0-klauncher_konsole.patch
249
250 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-klauncher_konsole.patch?rev=1.1&view=markup
251 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-klauncher_konsole.patch?rev=1.1&content-type=text/plain
252
253 Index: 4.2.0-klauncher_konsole.patch
254 ===================================================================
255 Index: branches/KDE/4.2/kdelibs/kinit/klauncher.cpp
256 ===================================================================
257 --- branches/KDE/4.2/kdelibs/kinit/klauncher.cpp (revision 918653)
258 +++ branches/KDE/4.2/kdelibs/kinit/klauncher.cpp (revision 918654)
259 @@ -58,6 +58,9 @@
260
261 // #define KLAUNCHER_VERBOSE_OUTPUT
262
263 +static const char* const s_DBusStartupTypeToString[] =
264 + { "DBusNone", "DBusUnique", "DBusMulti", "DBusWait", "ERROR" };
265 +
266 using namespace KIO;
267
268 IdleSlave::IdleSlave(QObject *parent)
269 @@ -393,15 +396,19 @@
270 if (request->pid == pid)
271 {
272 if (request->dbus_startup_type == KService::DBusWait)
273 - request->status = KLaunchRequest::Done;
274 + request->status = KLaunchRequest::Done;
275 else if ((request->dbus_startup_type == KService::DBusUnique)
276 - && QDBusConnection::sessionBus().interface()->isServiceRegistered(request->dbus_name))
277 - request->status = KLaunchRequest::Running;
278 - else
279 - request->status = KLaunchRequest::Error;
280 + && QDBusConnection::sessionBus().interface()->isServiceRegistered(request->dbus_name)) {
281 + request->status = KLaunchRequest::Running;
282 #ifdef KLAUNCHER_VERBOSE_OUTPUT
283 - kDebug(7016) << pid << "died, requestDone. status=" << request->status;
284 + kDebug(7016) << pid << "running as a unique app";
285 #endif
286 + } else {
287 + request->status = KLaunchRequest::Error;
288 +#ifdef KLAUNCHER_VERBOSE_OUTPUT
289 + kDebug(7016) << pid << "died, requestDone. status=" << request->status;
290 +#endif
291 + }
292 requestDone(request);
293 return;
294 }
295 @@ -446,19 +453,29 @@
296 if (request->status != KLaunchRequest::Launching)
297 continue;
298
299 +#ifdef KLAUNCHER_VERBOSE_OUTPUT
300 + kDebug(7016) << "had pending request" << request->name << s_DBusStartupTypeToString[request->dbus_startup_type] << "dbus_name" << request->dbus_name << request->tolerant_dbus_name;
301 +#endif
302 // For unique services check the requested service name first
303 - if ((request->dbus_startup_type == KService::DBusUnique) &&
304 - ((appId == request->dbus_name) ||
305 - QDBusConnection::sessionBus().interface()->isServiceRegistered(request->dbus_name)))
306 - {
307 - request->status = KLaunchRequest::Running;
308 - requestDone(request);
309 - continue;
310 + if (request->dbus_startup_type == KService::DBusUnique) {
311 + if ((appId == request->dbus_name) || // just started
312 + QDBusConnection::sessionBus().interface()->isServiceRegistered(request->dbus_name)) { // was already running
313 + request->status = KLaunchRequest::Running;
314 +#ifdef KLAUNCHER_VERBOSE_OUTPUT
315 + kDebug(7016) << "OK, unique app" << request->dbus_name << "is running";
316 +#endif
317 + requestDone(request);
318 + continue;
319 + } else {
320 +#ifdef KLAUNCHER_VERBOSE_OUTPUT
321 + kDebug(7016) << "unique app" << request->dbus_name << "not running yet";
322 +#endif
323 + }
324 }
325
326 - const QString rAppId = request->dbus_name;
327 + const QString rAppId = !request->tolerant_dbus_name.isEmpty() ? request->tolerant_dbus_name : request->dbus_name;
328 #ifdef KLAUNCHER_VERBOSE_OUTPUT
329 - kDebug(7016) << "had pending request" << rAppId;
330 + //kDebug(7016) << "using" << rAppId << "for matching";
331 #endif
332 if (rAppId.isEmpty())
333 continue;
334 @@ -818,11 +835,18 @@
335 request->dbus_name = v.toString().toUtf8();
336 }
337 if (request->dbus_name.isEmpty()) {
338 - request->dbus_name = "*." + QFile::encodeName(KRun::binaryName(service->exec(), true));
339 + const QString binName = KRun::binaryName(service->exec(), true);
340 + request->dbus_name = "org.kde." + binName;
341 + request->tolerant_dbus_name = "*." + binName;
342 }
343 }
344 }
345
346 +#ifdef KLAUNCHER_VERBOSE_OUTPUT
347 + kDebug(7016) << "name=" << request->name << "dbus_name=" << request->dbus_name
348 + << "startup type=" << s_DBusStartupTypeToString[request->dbus_startup_type];
349 +#endif
350 +
351 request->pid = 0;
352 request->envs = envs;
353 send_service_startup_info( request, service, startup_id, envs );
354 @@ -938,7 +962,7 @@
355 request->arg_list.append(arg.toLocal8Bit());
356 }
357
358 - request->name = app.toLocal8Bit();
359 + request->name = app;
360
361 if (wait)
362 request->dbus_startup_type = KService::DBusWait;
363 @@ -1113,7 +1137,7 @@
364 }
365 if (mSlaveValgrind == arg1)
366 {
367 - arg_list.prepend(QFile::encodeName(KLibLoader::findLibrary(name.toLocal8Bit())));
368 + arg_list.prepend(QFile::encodeName(KLibLoader::findLibrary(name)));
369 arg_list.prepend(QFile::encodeName(KStandardDirs::locate("exe", "kioslave")));
370 name = "valgrind";
371 if (!mSlaveValgrindSkin.isEmpty()) {
372 Index: branches/KDE/4.2/kdelibs/kinit/klauncher.h
373 ===================================================================
374 --- branches/KDE/4.2/kdelibs/kinit/klauncher.h (revision 918653)
375 +++ branches/KDE/4.2/kdelibs/kinit/klauncher.h (revision 918654)
376 @@ -87,6 +87,7 @@
377 QString name;
378 QStringList arg_list;
379 QString dbus_name;
380 + QString tolerant_dbus_name;
381 enum status_t { Init = 0, Launching, Running, Error, Done };
382 pid_t pid;
383 status_t status;
384
385
386
387 1.1 kde-base/kdelibs/files/4.2.0-klauncher.patch
388
389 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-klauncher.patch?rev=1.1&view=markup
390 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdelibs/files/4.2.0-klauncher.patch?rev=1.1&content-type=text/plain
391
392 Index: 4.2.0-klauncher.patch
393 ===================================================================
394 Index: branches/KDE/4.2/kdelibs/kinit/klauncher.cpp
395 ===================================================================
396 --- branches/KDE/4.2/kdelibs/kinit/klauncher.cpp (revision 918402)
397 +++ branches/KDE/4.2/kdelibs/kinit/klauncher.cpp (revision 918403)
398 @@ -167,7 +167,7 @@
399
400 KLauncher::KLauncher(int _kdeinitSocket)
401 : QObject(0),
402 - kdeinitSocket(_kdeinitSocket), dontBlockReading(false)
403 + kdeinitSocket(_kdeinitSocket)
404 {
405 #ifdef Q_WS_X11
406 mCached_dpy = NULL;
407 @@ -276,8 +276,24 @@
408 {
409 ssize_t result;
410 int bytes_left = len;
411 - while ( bytes_left > 0)
412 - {
413 + while (bytes_left > 0) {
414 + // in case we get a request to start an application and data arrive
415 + // to kdeinitSocket at the same time, requestStart() will already
416 + // call slotKDEInitData(), so we must check there's still something
417 + // to read, otherwise this would block
418 +
419 + // Same thing if kdeinit dies without warning.
420 +
421 + fd_set in;
422 + timeval tm = { 30, 0 }; // 30 seconds timeout, so we're not stuck in case kdeinit dies on us
423 + FD_ZERO ( &in );
424 + FD_SET( sock, &in );
425 + select( sock + 1, &in, 0, 0, &tm );
426 + if( !FD_ISSET( sock, &in )) {
427 + kDebug(7016) << "read_socket" << sock << "nothing to read, kdeinit4 must be dead";
428 + return -1;
429 + }
430 +
431 result = read(sock, buffer, bytes_left);
432 if (result > 0)
433 {
434 @@ -298,21 +314,7 @@
435 {
436 klauncher_header request_header;
437 QByteArray requestData;
438 - if( dontBlockReading )
439 - {
440 - // in case we get a request to start an application and data arrive
441 - // to kdeinitSocket at the same time, requestStart() will already
442 - // call slotKDEInitData(), so we must check there's still something
443 - // to read, otherwise this would block
444 - fd_set in;
445 - timeval tm = { 0, 0 };
446 - FD_ZERO ( &in );
447 - FD_SET( kdeinitSocket, &in );
448 - select( kdeinitSocket + 1, &in, 0, 0, &tm );
449 - if( !FD_ISSET( kdeinitSocket, &in ))
450 - return;
451 - }
452 - dontBlockReading = false;
453 +
454 int result = read_socket(kdeinitSocket, (char *) &request_header,
455 sizeof( request_header));
456 if (result == -1)
457 @@ -647,17 +649,21 @@
458 request_header.cmd = LAUNCHER_EXEC_NEW;
459 #endif
460 request_header.arg_length = requestData.length();
461 +
462 +#ifdef KLAUNCHER_VERBOSE_OUTPUT
463 + kDebug(7016) << "Asking kdeinit to start" << request->name << request->arg_list
464 + << "cmd=" << commandToString(request_header.cmd);
465 +#endif
466 +
467 write(kdeinitSocket, &request_header, sizeof(request_header));
468 write(kdeinitSocket, requestData.data(), requestData.length());
469
470 // Wait for pid to return.
471 lastRequest = request;
472 - dontBlockReading = false;
473 do {
474 slotKDEInitData( kdeinitSocket );
475 }
476 while (lastRequest != 0);
477 - dontBlockReading = true;
478 #endif
479 }