┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/global.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/global.cpp')
-rw-r--r--src/global.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/global.cpp b/src/global.cpp
index 3d6d7dd5e..20dee00fa 100644
--- a/src/global.cpp
+++ b/src/global.cpp
@@ -17,6 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <QApplication>
+#include <QIcon>
+
+#include <KRun>
+
#include "global.h"
#include "dolphindebug.h"
@@ -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());
+}