mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Move variables closer to their usage
GIT_SILENT
This commit is contained in:
parent
2de943fbe4
commit
4a25f01b7c
|
@ -77,12 +77,6 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi
|
||||||
return false;
|
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;
|
QVector<QPair<QSharedPointer<QDBusInterface>, QStringList>> dolphinServices;
|
||||||
if (!preferredService.isEmpty()) {
|
if (!preferredService.isEmpty()) {
|
||||||
QSharedPointer<QDBusInterface> preferred(
|
QSharedPointer<QDBusInterface> preferred(
|
||||||
|
@ -96,6 +90,11 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi
|
||||||
}
|
}
|
||||||
|
|
||||||
// find all dolphin instances
|
// 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) {
|
for (const QString& service : services) {
|
||||||
if (service.startsWith(pattern) && !service.endsWith(myPid)) {
|
if (service.startsWith(pattern) && !service.endsWith(myPid)) {
|
||||||
// Check if instance can handle our URLs
|
// Check if instance can handle our URLs
|
||||||
|
|
Loading…
Reference in a new issue