]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/global.cpp
Remove unused #include
[dolphin.git] / src / global.cpp
index 3d6d7dd5e7b7d4ec6c0f3af89aa9bb967820f59f..aaeb5812060e18d7f2a38d494d9afa3afc4eedcd 100644 (file)
  */
 
 #include "global.h"
-#include "dolphindebug.h"
 
 #include "dolphin_generalsettings.h"
+#include "dolphindebug.h"
+
+#include <KRun>
+
+#include <QApplication>
+#include <QIcon>
 
 QList<QUrl> Dolphin::validateUris(const QStringList& uriList)
 {
@@ -41,3 +46,18 @@ QUrl Dolphin::homeUrl()
 {
     return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile);
 }
+
+void Dolphin::openNewWindow(const QList<QUrl> &urls, QWidget *window, const OpenNewWindowFlags &flags)
+{
+    QString command = QStringLiteral("dolphin");
+
+    if (flags.testFlag(OpenNewWindowFlag::Select)) {
+        command.append(QLatin1String(" --select"));
+    }
+
+    if (!urls.isEmpty()) {
+        command.append(QLatin1String(" %U"));
+    }
+
+    KRun::run(command, urls, window, qApp->applicationDisplayName(), qApp->windowIcon().name());
+}