Changeset View
Changeset View
Standalone View
Standalone View
src/global.h
Show All 16 Lines | |||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef GLOBAL_H | 20 | #ifndef GLOBAL_H | ||
21 | #define GLOBAL_H | 21 | #define GLOBAL_H | ||
22 | 22 | | |||
23 | #include <QList> | 23 | #include <QList> | ||
24 | #include <QUrl> | 24 | #include <QUrl> | ||
25 | #include <QStringLiteral> | ||||
elvisangelaccio: Unnecessary include | |||||
25 | 26 | | |||
26 | namespace Dolphin { | 27 | namespace Dolphin { | ||
27 | QList<QUrl> validateUris(const QStringList& uriList); | 28 | QList<QUrl> validateUris(const QStringList& uriList); | ||
28 | 29 | | |||
29 | /** | 30 | /** | ||
30 | * Returns the home url which is defined in General Settings | 31 | * Returns the home url which is defined in General Settings | ||
31 | */ | 32 | */ | ||
32 | QUrl homeUrl(); | 33 | QUrl homeUrl(); | ||
33 | 34 | | |||
34 | enum class OpenNewWindowFlag { | 35 | enum class OpenNewWindowFlag { | ||
35 | None = 0, | 36 | None = 0, | ||
36 | Select = 1<<1 | 37 | Select = 1<<1 | ||
37 | }; | 38 | }; | ||
38 | Q_DECLARE_FLAGS(OpenNewWindowFlags, OpenNewWindowFlag) | 39 | Q_DECLARE_FLAGS(OpenNewWindowFlags, OpenNewWindowFlag) | ||
39 | 40 | | |||
40 | /** | 41 | /** | ||
41 | * Opens a new Dolphin window | 42 | * Opens a new Dolphin window | ||
42 | */ | 43 | */ | ||
43 | void openNewWindow(const QList<QUrl> &urls = {}, QWidget *window = nullptr, const OpenNewWindowFlags &flags = OpenNewWindowFlag::None); | 44 | void openNewWindow(const QList<QUrl> &urls = {}, QWidget *window = nullptr, const OpenNewWindowFlags &flags = OpenNewWindowFlag::None); | ||
44 | 45 | | |||
45 | /** | 46 | /** | ||
47 | * Attaches URLs to an existing Dolphin instance if possible. | ||||
48 | * Returns true if URLs were successfully attached | ||||
49 | */ | ||||
50 | bool attachToExistingInstance(const QStringList& urls, bool openFiles, bool splitView, const QString& preferredService = ""); | ||||
elvisangelaccio: Missing pass-by-const-reference for `urls` | |||||
Prefer QString() to "". I wonder if we could add new flags to OpenNewWindowFlag and get rid of these bools in the signature. elvisangelaccio: Prefer `QString()` to `""`.
I wonder if we could add new flags to `OpenNewWindowFlag` and get… | |||||
At a cursory glance, might make it more messier as we'll need if conditionals as we can't set flags over DBus. feverfew: At a cursory glance, might make it more messier as we'll need `if` conditionals as we can't set… | |||||
51 | | ||||
52 | /** | ||||
46 | * TODO: Move this somewhere global to all KDE apps, not just Dolphin | 53 | * TODO: Move this somewhere global to all KDE apps, not just Dolphin | ||
47 | */ | 54 | */ | ||
48 | const int VERTICAL_SPACER_HEIGHT = 18; | 55 | const int VERTICAL_SPACER_HEIGHT = 18; | ||
49 | } | 56 | } | ||
50 | 57 | | |||
51 | #endif //GLOBAL_H | 58 | #endif //GLOBAL_H |
Unnecessary include