aboutsummaryrefslogtreecommitdiff
path: root/devel/kf5-kdbusaddons/files/patch-src_kdbusservice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'devel/kf5-kdbusaddons/files/patch-src_kdbusservice.cpp')
-rw-r--r--devel/kf5-kdbusaddons/files/patch-src_kdbusservice.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/devel/kf5-kdbusaddons/files/patch-src_kdbusservice.cpp b/devel/kf5-kdbusaddons/files/patch-src_kdbusservice.cpp
new file mode 100644
index 000000000000..4e3cadceeb7d
--- /dev/null
+++ b/devel/kf5-kdbusaddons/files/patch-src_kdbusservice.cpp
@@ -0,0 +1,23 @@
+diff --git a/src/kdbusservice.cpp b/src/kdbusservice.cpp
+--- src/kdbusservice.cpp
++++ src/kdbusservice.cpp
+@@ -129,6 +130,18 @@
+ } else {
+ d->serviceName += QLatin1Char('-') + QString::number(QCoreApplication::applicationPid());
+ }
++ } else if (options & KDBusService::Unique) {
++ auto reply = bus->registeredServiceNames();
++ if (!reply.isValid()) {
++ return;
++ }
++
++ for (const auto& serviceName : reply.value()) {
++ if (serviceName.startsWith(d->serviceName)) {
++ d->serviceName = serviceName;
++ return;
++ }
++ }
+ }
+ }
+
+