diff options
| author | Elvis Angelaccio <[email protected]> | 2019-08-11 12:37:51 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2019-08-11 12:37:51 +0200 |
| commit | 4a25f01b7c137249f0aff67f48acb996095887c2 (patch) | |
| tree | 9acbdeda20766a33b37d30f8ad67f6d9d7a8808a | |
| parent | 2de943fbe452db02e882754e67863aa6600d2f8d (diff) | |
Move variables closer to their usage
GIT_SILENT
| -rw-r--r-- | src/global.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/global.cpp b/src/global.cpp index 58997ec46..d39d202a2 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -77,12 +77,6 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi 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<QPair<QSharedPointer<QDBusInterface>, QStringList>> dolphinServices; if (!preferredService.isEmpty()) { QSharedPointer<QDBusInterface> preferred( @@ -96,6 +90,11 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi } // 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 |
