Changeset View
Changeset View
Standalone View
Standalone View
src/global.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 74 | { | |||
---|---|---|---|---|---|
85 | const QString myPid = QStringLiteral("-") + QString::number(QCoreApplication::applicationPid()); | 85 | const QString myPid = QStringLiteral("-") + QString::number(QCoreApplication::applicationPid()); | ||
86 | QVector<QPair<QSharedPointer<QDBusInterface>, QStringList>> dolphinServices; | 86 | QVector<QPair<QSharedPointer<QDBusInterface>, QStringList>> dolphinServices; | ||
87 | if (!preferredService.isEmpty()) { | 87 | if (!preferredService.isEmpty()) { | ||
88 | QSharedPointer<QDBusInterface> preferred( | 88 | QSharedPointer<QDBusInterface> preferred( | ||
89 | new QDBusInterface(preferredService, | 89 | new QDBusInterface(preferredService, | ||
90 | QStringLiteral("/dolphin/Dolphin_1"), | 90 | QStringLiteral("/dolphin/Dolphin_1"), | ||
91 | QStringLiteral("org.kde.dolphin.MainWindow")) | 91 | QStringLiteral("org.kde.dolphin.MainWindow")) | ||
92 | ); | 92 | ); | ||
93 | if (preferred->isValid()) { | 93 | if (preferred->isValid() && !preferred->lastError().isValid()) { | ||
94 | dolphinServices.append(qMakePair(preferred, QStringList() )); | 94 | dolphinServices.append(qMakePair(preferred, QStringList() )); | ||
95 | } | 95 | } | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | // find all dolphin instances | 98 | // find all dolphin instances | ||
99 | for (const QString& service : services) { | 99 | for (const QString& service : services) { | ||
100 | if (service.startsWith(pattern) && !service.endsWith(myPid)) { | 100 | if (service.startsWith(pattern) && !service.endsWith(myPid)) { | ||
101 | // Check if instance can handle our URLs | 101 | // Check if instance can handle our URLs | ||
102 | QSharedPointer<QDBusInterface> instance( | 102 | QSharedPointer<QDBusInterface> instance( | ||
103 | new QDBusInterface(service, | 103 | new QDBusInterface(service, | ||
104 | QStringLiteral("/dolphin/Dolphin_1"), | 104 | QStringLiteral("/dolphin/Dolphin_1"), | ||
105 | QStringLiteral("org.kde.dolphin.MainWindow")) | 105 | QStringLiteral("org.kde.dolphin.MainWindow")) | ||
106 | ); | 106 | ); | ||
107 | if (!instance->isValid() || instance->lastError().isValid()) { | 107 | if (!instance->isValid() || instance->lastError().isValid()) { | ||
108 | continue; | 108 | continue; | ||
109 | } | 109 | } | ||
110 | dolphinServices.append(qMakePair(instance, QStringList())); | 110 | dolphinServices.append(qMakePair(instance, QStringList())); | ||
feverfew: I think now it would be appropriate to change this to read the same as L93-95. | |||||
Makes sense, done with c18f5fde4b9be141b6de9325f92b03f774c2868b. elvisangelaccio: Makes sense, done with c18f5fde4b9be141b6de9325f92b03f774c2868b. | |||||
111 | } | 111 | } | ||
112 | } | 112 | } | ||
113 | 113 | | |||
114 | if (dolphinServices.isEmpty()) { | 114 | if (dolphinServices.isEmpty()) { | ||
115 | return false; | 115 | return false; | ||
116 | } | 116 | } | ||
117 | 117 | | |||
118 | QStringList newUrls; | 118 | QStringList newUrls; | ||
Show All 27 Lines |
I think now it would be appropriate to change this to read the same as L93-95.