X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/0309bb18185f77c425cf7c69508f049c439eedb0..87e8d0ba5f:/src/global.cpp diff --git a/src/global.cpp b/src/global.cpp index 3d6d7dd5e..d0e477bc8 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -19,9 +19,13 @@ #include "global.h" #include "dolphindebug.h" - #include "dolphin_generalsettings.h" +#include + +#include +#include + QList Dolphin::validateUris(const QStringList& uriList) { const QString currentDir = QDir::currentPath(); @@ -41,3 +45,18 @@ QUrl Dolphin::homeUrl() { return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile); } + +void Dolphin::openNewWindow(const QList &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()); +}