┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dbusinterface.cpp
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2018-09-17 12:02:51 +0200
committerDavid Edmundson <[email protected]>2018-09-17 12:04:00 +0200
commitcb6c71ae1b7e2a19c876608e375f7ba7068977a3 (patch)
treeb7fac3acd8d9c474c07dfe1ad19ceca9bd7f94e6 /src/dbusinterface.cpp
parentb98948ae1e036e46501e91aa0f074f9728d26ab2 (diff)
Keep org.freedesktop.FileManager1 registered across processes
Summary: Currently if someone starts 2 dolphins, the second cannot register org.freedesktop.FileManager1 meaning and when the first dolphin quits, no-one has it registered. It doesn't cause a huge problem right now as we just dbus-activate a new one if needed, but it means the behaviour is a bit inconsistent and non-optimal. DBus has a system to queue names, meaning that as long as any dolphin is running this name is owned by one of the processes. Also this patch registers the service after the object which is technically safer. Test Plan: Ran d-feet Opened 2 dolphins, closed the first Service was still registered and the PID of the owning process changed. Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D15539
Diffstat (limited to 'src/dbusinterface.cpp')
-rw-r--r--src/dbusinterface.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dbusinterface.cpp b/src/dbusinterface.cpp
index e5192f207..c780bc7cd 100644
--- a/src/dbusinterface.cpp
+++ b/src/dbusinterface.cpp
@@ -23,13 +23,15 @@
#include <KPropertiesDialog>
#include <QDBusConnection>
+#include <QDBusConnectionInterface>
DBusInterface::DBusInterface() :
QObject()
{
- QDBusConnection::sessionBus().registerService(QStringLiteral("org.freedesktop.FileManager1"));
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/freedesktop/FileManager1"), this,
QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
+ QDBusConnection::sessionBus().interface()->registerService(QStringLiteral("org.freedesktop.FileManager1"),
+ QDBusConnectionInterface::QueueService);
}
void DBusInterface::ShowFolders(const QStringList& uriList, const QString& startUpId)