Changeset View
Changeset View
Standalone View
Standalone View
src/klauncher/klauncher.cpp
Show First 20 Lines • Show All 314 Lines • ▼ Show 20 Line(s) | 308 | if (lastRequest && (status == LAUNCHER_ERROR)) { | |||
---|---|---|---|---|---|
315 | return; | 315 | return; | ||
316 | } | 316 | } | ||
317 | 317 | | |||
318 | qWarning() << "Unexpected request return" << (unsigned int) status; | 318 | qWarning() << "Unexpected request return" << (unsigned int) status; | ||
319 | } | 319 | } | ||
320 | 320 | | |||
321 | void | 321 | void | ||
322 | KLauncher::processDied(pid_t pid, long exitStatus) | 322 | KLauncher::processDied(pid_t pid, long exitStatus) | ||
323 | { | 323 | { | ||
324 | qCDebug(KLAUNCHER) << pid << "exitStatus=" << exitStatus; | 324 | qCDebug(KLAUNCHER) << pid << "exitStatus=" << exitStatus; | ||
dfaure: This seems to be mixed with an unrelated change, now. | |||||
325 | // We should probably check the exitStatus for the uniqueapp case? | 325 | // We should probably check the exitStatus for the uniqueapp case? | ||
326 | foreach (KLaunchRequest *request, requestList) { | 326 | foreach (KLaunchRequest *request, requestList) { | ||
327 | qCDebug(KLAUNCHER) << " had pending request" << request->pid; | 327 | qCDebug(KLAUNCHER) << " had pending request" << request->pid; | ||
328 | if (request->pid == pid) { | 328 | if (request->pid == pid) { | ||
329 | if ((request->dbus_startup_type == KService::DBusUnique) | 329 | if ((request->dbus_startup_type == KService::DBusUnique) | ||
330 | && QDBusConnection::sessionBus().interface()->isServiceRegistered(request->dbus_name)) { | 330 | && QDBusConnection::sessionBus().interface()->isServiceRegistered(request->dbus_name)) { | ||
331 | request->status = KLaunchRequest::Running; | 331 | request->status = KLaunchRequest::Running; | ||
332 | qCDebug(KLAUNCHER) << pid << "running as a unique app"; | 332 | qCDebug(KLAUNCHER) << pid << "running as a unique app"; | ||
Show All 22 Lines | 348 | { | |||
355 | 355 | | |||
356 | if (pendingAppId.startsWith(QLatin1String("*."))) { | 356 | if (pendingAppId.startsWith(QLatin1String("*."))) { | ||
357 | const QString pendingName = pendingAppId.mid(2); | 357 | const QString pendingName = pendingAppId.mid(2); | ||
358 | const QString appName = newAppId.mid(newAppId.lastIndexOf(QLatin1Char('.')) + 1); | 358 | const QString appName = newAppId.mid(newAppId.lastIndexOf(QLatin1Char('.')) + 1); | ||
359 | qCDebug(KLAUNCHER) << "appName=" << appName; | 359 | qCDebug(KLAUNCHER) << "appName=" << appName; | ||
360 | return appName == pendingName; | 360 | return appName == pendingName; | ||
361 | } | 361 | } | ||
362 | 362 | | |||
363 | // Match sandboxed apps (e.g. flatpak), see https://phabricator.kde.org/D5775 | ||||
364 | if (newAppId.endsWith(QLatin1String(".kdbus"))) { | ||||
QString::endsWith() has a QLatin1String overload, which would be slightly better here. dfaure: QString::endsWith() has a QLatin1String overload, which would be slightly better here. | |||||
365 | return newAppId.leftRef(newAppId.length() - 6) == pendingAppId; | ||||
So if I start kdesudoku and kdesu quickly, when kdesudoku is started, the pending entry for kdesu will think it matches? ;) dfaure: So if I start kdesudoku and kdesu quickly, when kdesudoku is started, the pending entry for… | |||||
366 | } | ||||
367 | | ||||
363 | return newAppId == pendingAppId; | 368 | return newAppId == pendingAppId; | ||
364 | } | 369 | } | ||
365 | 370 | | |||
366 | void | 371 | void | ||
367 | KLauncher::slotNameOwnerChanged(const QString &appId, const QString &oldOwner, | 372 | KLauncher::slotNameOwnerChanged(const QString &appId, const QString &oldOwner, | ||
368 | const QString &newOwner) | 373 | const QString &newOwner) | ||
369 | { | 374 | { | ||
370 | Q_UNUSED(oldOwner); | 375 | Q_UNUSED(oldOwner); | ||
▲ Show 20 Lines • Show All 895 Lines • Show Last 20 Lines |
This seems to be mixed with an unrelated change, now.