X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ccb3658b3aa7f5b0f0b71cb6e91808bdfe58af64..7caef6d251a1611842f73a9942f1bfc1dd2ec13b:/src/global.cpp 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 +#include + +#include + #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 &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()); +}