-bool Dolphin::attachToExistingInstance(const QList<QUrl>& urls, bool openFiles, bool splitView, const QString& preferredService)
+bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFiles, bool splitView, const QString& preferredService)
{
if (KWindowSystem::isPlatformWayland()) {
// TODO: once Wayland clients can raise or activate themselves remove this conditional
{
if (KWindowSystem::isPlatformWayland()) {
// TODO: once Wayland clients can raise or activate themselves remove this conditional
// Don't match the service without trailing "-" (unique instance)
const QString pattern = QStringLiteral("org.kde.dolphin-");
// Don't match the service without trailing "-" (unique instance)
const QString pattern = QStringLiteral("org.kde.dolphin-");
QVector<QPair<QSharedPointer<QDBusInterface>, QStringList>> dolphinServices;
if (!preferredService.isEmpty()) {
QSharedPointer<QDBusInterface> preferred(
QVector<QPair<QSharedPointer<QDBusInterface>, QStringList>> dolphinServices;
if (!preferredService.isEmpty()) {
QSharedPointer<QDBusInterface> preferred(
QStringLiteral("/dolphin/Dolphin_1"),
QStringLiteral("org.kde.dolphin.MainWindow"))
);
QStringLiteral("/dolphin/Dolphin_1"),
QStringLiteral("org.kde.dolphin.MainWindow"))
);
bool urlFound = false;
for (auto& service: dolphinServices) {
QDBusReply<bool> isUrlOpen = service.first->call(QStringLiteral("isUrlOpen"), url);
bool urlFound = false;
for (auto& service: dolphinServices) {
QDBusReply<bool> isUrlOpen = service.first->call(QStringLiteral("isUrlOpen"), url);