diff options
| author | Kai Uwe Broulik <[email protected]> | 2017-03-08 16:52:15 +0100 |
|---|---|---|
| committer | Kai Uwe Broulik <[email protected]> | 2017-03-08 16:52:15 +0100 |
| commit | b79ea9f5e4a83e4cc877235a6aa62f666bee0289 (patch) | |
| tree | 5a7fbc123ab92d25923392607b8c8cf64edf196d /src/global.cpp | |
| parent | 6dcbb8127c5a1da644f2927521ccac40bea54614 (diff) | |
Pass application name and icon to KRun
Otherwise this results in the generic executable icon as bouncy cursor.
Differential Revision: https://phabricator.kde.org/D4823
Diffstat (limited to 'src/global.cpp')
| -rw-r--r-- | src/global.cpp | 20 |
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()); +} |
