- dolphinInterfaces.front().second << newUrls;
-
- for (const auto& interface: qAsConst(dolphinInterfaces)) {
- if (!interface.second.isEmpty()) {
- auto reply = openFiles ? interface.first->openFiles(interface.second, splitView) : interface.first->openDirectories(interface.second, splitView);
- reply.waitForFinished();
- if (!reply.isError()) {
- interface.first->activateWindow();
- attached = true;
- }
+
+ for (const auto &interface : std::as_const(dolphinInterfaces)) {
+ if (interface.second.isEmpty()) {
+ continue;
+ }
+ auto reply = openFiles ? interface.first->openFiles(interface.second, splitView) : interface.first->openDirectories(interface.second, splitView);
+ reply.waitForFinished();
+ if (!reply.isError()) {
+ interface.first->activateWindow(activationToken);
+ attached = true;
+ }
+ }
+ if (attached && !newWindowURLs.isEmpty()) {
+ if (openFiles) {
+ openNewWindow(newWindowURLs, nullptr, Dolphin::OpenNewWindowFlag::Select);
+ } else {
+ openNewWindow(newWindowURLs);