Changeset View
Changeset View
Standalone View
Standalone View
src/global.cpp
Show All 21 Lines | |||||
22 | #include "dolphin_generalsettings.h" | 22 | #include "dolphin_generalsettings.h" | ||
23 | #include "dolphindebug.h" | 23 | #include "dolphindebug.h" | ||
24 | #include "dolphinmainwindowinterface.h" | 24 | #include "dolphinmainwindowinterface.h" | ||
25 | 25 | | |||
26 | #include <KDialogJobUiDelegate> | 26 | #include <KDialogJobUiDelegate> | ||
27 | #include <KIO/ApplicationLauncherJob> | 27 | #include <KIO/ApplicationLauncherJob> | ||
28 | #include <KService> | 28 | #include <KService> | ||
29 | #include <KWindowSystem> | 29 | #include <KWindowSystem> | ||
30 | #include <KShell> | ||||
30 | 31 | | |||
31 | #include <QApplication> | 32 | #include <QApplication> | ||
32 | #include <QIcon> | 33 | #include <QIcon> | ||
33 | 34 | | |||
34 | QList<QUrl> Dolphin::validateUris(const QStringList& uriList) | 35 | QList<QUrl> Dolphin::validateUris(const QStringList& uriList) | ||
35 | { | 36 | { | ||
36 | const QString currentDir = QDir::currentPath(); | 37 | const QString currentDir = QDir::currentPath(); | ||
37 | QList<QUrl> urls; | 38 | QList<QUrl> urls; | ||
Show All 10 Lines | |||||
48 | 49 | | |||
49 | QUrl Dolphin::homeUrl() | 50 | QUrl Dolphin::homeUrl() | ||
50 | { | 51 | { | ||
51 | return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile); | 52 | return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile); | ||
52 | } | 53 | } | ||
53 | 54 | | |||
54 | void Dolphin::openNewWindow(const QList<QUrl> &urls, QWidget *window, const OpenNewWindowFlags &flags) | 55 | void Dolphin::openNewWindow(const QList<QUrl> &urls, QWidget *window, const OpenNewWindowFlags &flags) | ||
55 | { | 56 | { | ||
56 | QString command = QStringLiteral("dolphin --new-window"); | 57 | QString command = QStringLiteral("%1 --new-window").arg(KShell::quoteArg(QCoreApplication::applicationFilePath())); | ||
broulik: I think you need a `KShell::quoteArgs` in case there's spaces in the path | |||||
This causes a compile error: ‘quoteArgs’ is not a member of ‘KShell’ alex: This causes a compile error: `‘quoteArgs’ is not a member of ‘KShell’`
What @broulik meant was… | |||||
57 | 58 | | |||
58 | if (flags.testFlag(OpenNewWindowFlag::Select)) { | 59 | if (flags.testFlag(OpenNewWindowFlag::Select)) { | ||
59 | command.append(QLatin1String(" --select")); | 60 | command.append(QLatin1String(" --select")); | ||
60 | } | 61 | } | ||
61 | 62 | | |||
62 | if (!urls.isEmpty()) { | 63 | if (!urls.isEmpty()) { | ||
63 | command.append(QLatin1String(" %U")); | 64 | command.append(QLatin1String(" %U")); | ||
64 | } | 65 | } | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |
I think you need a KShell::quoteArgs in case there's spaces in the path