Change in kio[master]: KRun: make klauncher dependency optional.
David Faure (Code Review)
noreply at kde.org
Wed Dec 17 08:16:04 UTC 2014
David Faure has uploaded a new change for review.
https://gerrit.vesnicky.cesnet.cz/r/248
Change subject: KRun: make klauncher dependency optional.
......................................................................
KRun: make klauncher dependency optional.
If klauncher can't be started, then start the service "by hand";
we already had a code path for that for other cases.
Change-Id: I058221aaeb8a6b3e583a16e5b377280a5660ebc6
---
M src/widgets/krun.cpp
1 file changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.vesnicky.cesnet.cz:29418/kio refs/changes/48/248/1
diff --git a/src/widgets/krun.cpp b/src/widgets/krun.cpp
index 8f77901..89ae26d 100644
--- a/src/widgets/krun.cpp
+++ b/src/widgets/krun.cpp
@@ -40,6 +40,8 @@
#include <QDesktopWidget>
#include <qmimedatabase.h>
#include <QDebug>
+#include <QDBusConnection>
+#include <QDBusConnectionInterface>
#include <kiconloader.h>
#include <kjobuidelegate.h>
@@ -709,7 +711,18 @@
}
}
- if (tempFiles || _service.entryPath().isEmpty() || !suggestedFileName.isEmpty()) {
+ bool useKToolInvocation = !(tempFiles || _service.entryPath().isEmpty() || !suggestedFileName.isEmpty());
+
+ if (useKToolInvocation) {
+ // Is klauncher installed? Let's try to start it, if it fails, then we won't use it.
+ KToolInvocation::ensureKdeinitRunning();
+ QDBusConnectionInterface *dbusDaemon = QDBusConnection::sessionBus().interface();
+ if (!dbusDaemon->isServiceRegistered(QString::fromLatin1("org.kde.klauncher5"))) {
+ useKToolInvocation = false;
+ }
+ }
+
+ if (!useKToolInvocation) {
return runTempService(_service, _urls, window, tempFiles, suggestedFileName, asn);
}
--
To view, visit https://gerrit.vesnicky.cesnet.cz/r/248
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I058221aaeb8a6b3e583a16e5b377280a5660ebc6
Gerrit-PatchSet: 1
Gerrit-Project: kio
Gerrit-Branch: master
Gerrit-Owner: David Faure <faure at kde.org>
Gerrit-Reviewer: Sysadmin Testing Account <null at kde.org>
More information about the Kde-frameworks-devel
mailing list