From 853a95b6d5d225e501d62f5858583d7c0527f9b3 Mon Sep 17 00:00:00 2001 From: Thomas Posch Date: Mon, 3 Jun 2019 21:52:10 +0200 Subject: [PATCH] Tighter match own service when trying to find suitable window to open path in. Summary: Current implementation matches org.kde.dolphin-.*PID while trying to exclude itself from the list of running instances. With this fix applied only org.kde.dolphin-PID is matched. Test Plan: Open dolphin twice. Observe only one window. Reviewers: feverfew, #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D21547 --- src/global.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/global.cpp b/src/global.cpp index e7ff67d77..97d743438 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -81,7 +81,8 @@ bool Dolphin::attachToExistingInstance(const QList& urls, bool openFiles, // Don't match the service without trailing "-" (unique instance) const QString pattern = QStringLiteral("org.kde.dolphin-"); - const QString myPid = QString::number(QCoreApplication::applicationPid()); + // Don't match the pid without leading "-" + const QString myPid = QStringLiteral("-") + QString::number(QCoreApplication::applicationPid()); QVector, QStringList>> dolphinServices; if (!preferredService.isEmpty()) { QSharedPointer preferred( -- 2.47.3