From: Elvis Angelaccio Date: Sun, 11 Aug 2019 14:01:41 +0000 (+0200) Subject: Merge branch 'Applications/19.08' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/87f30d3fc8172649b3c905b04e20655ca18ac68f?hp=-c Merge branch 'Applications/19.08' --- 87f30d3fc8172649b3c905b04e20655ca18ac68f diff --combined src/global.cpp index d39d202a2,21660a828..64282e711 --- a/src/global.cpp +++ b/src/global.cpp @@@ -77,6 -77,12 +77,6 @@@ bool Dolphin::attachToExistingInstance( return false; } - const QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames().value(); - - // Don't match the service without trailing "-" (unique instance) - const QString pattern = QStringLiteral("org.kde.dolphin-"); - // Don't match the pid without leading "-" - const QString myPid = QStringLiteral("-") + QString::number(QCoreApplication::applicationPid()); QVector, QStringList>> dolphinServices; if (!preferredService.isEmpty()) { QSharedPointer preferred( @@@ -84,17 -90,12 +84,17 @@@ QStringLiteral("/dolphin/Dolphin_1"), QStringLiteral("org.kde.dolphin.MainWindow")) ); - if (preferred->isValid()) { + if (preferred->isValid() && !preferred->lastError().isValid()) { - dolphinServices.append(qMakePair(preferred, QStringList() )); + dolphinServices.append(qMakePair(preferred, QStringList())); } } // find all dolphin instances + const QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames().value(); + // Don't match the service without trailing "-" (unique instance) + const QString pattern = QStringLiteral("org.kde.dolphin-"); + // Don't match the pid without leading "-" + const QString myPid = QStringLiteral("-") + QString::number(QCoreApplication::applicationPid()); for (const QString& service : services) { if (service.startsWith(pattern) && !service.endsWith(myPid)) { // Check if instance can handle our URLs @@@ -123,9 -124,9 +123,9 @@@ for (auto& service: dolphinServices) { QDBusReply isUrlOpen = service.first->call(QStringLiteral("isUrlOpen"), url); if (isUrlOpen.isValid() && isUrlOpen.value()) { - service.second.append(url); - urlFound = true; - break; + service.second.append(url); + urlFound = true; + break; } } if (!urlFound) {