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 | 25 | | |||
elvisangelaccio: Unnecessary include | |||||
26 | namespace Dolphin { | 26 | namespace Dolphin { | ||
27 | QList<QUrl> validateUris(const QStringList& uriList); | 27 | QList<QUrl> validateUris(const QStringList& uriList); | ||
28 | 28 | | |||
29 | /** | 29 | /** | ||
30 | * Returns the home url which is defined in General Settings | 30 | * Returns the home url which is defined in General Settings | ||
31 | */ | 31 | */ | ||
32 | QUrl homeUrl(); | 32 | QUrl homeUrl(); | ||
33 | 33 | | |||
34 | enum class OpenNewWindowFlag { | 34 | enum class OpenNewWindowFlag { | ||
35 | None = 0, | 35 | None = 0, | ||
36 | Select = 1<<1 | 36 | Select = 1<<1 | ||
37 | }; | 37 | }; | ||
38 | Q_DECLARE_FLAGS(OpenNewWindowFlags, OpenNewWindowFlag) | 38 | Q_DECLARE_FLAGS(OpenNewWindowFlags, OpenNewWindowFlag) | ||
39 | 39 | | |||
40 | /** | 40 | /** | ||
41 | * Opens a new Dolphin window | 41 | * Opens a new Dolphin window | ||
42 | */ | 42 | */ | ||
43 | void openNewWindow(const QList<QUrl> &urls = {}, QWidget *window = nullptr, const OpenNewWindowFlags &flags = OpenNewWindowFlag::None); | 43 | void openNewWindow(const QList<QUrl> &urls = {}, QWidget *window = nullptr, const OpenNewWindowFlags &flags = OpenNewWindowFlag::None); | ||
44 | 44 | | |||
45 | /** | 45 | /** | ||
46 | * Attaches URLs to an existing Dolphin instance if possible. | ||||
47 | * Returns true if URLs were successfully attached | ||||
48 | */ | ||||
49 | bool attachToExistingInstance(const QStringList urls, bool openFiles, bool splitView); | ||||
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… | |||||
50 | | ||||
51 | /** | ||||
46 | * TODO: Move this somewhere global to all KDE apps, not just Dolphin | 52 | * TODO: Move this somewhere global to all KDE apps, not just Dolphin | ||
47 | */ | 53 | */ | ||
48 | const int VERTICAL_SPACER_HEIGHT = 18; | 54 | const int VERTICAL_SPACER_HEIGHT = 18; | ||
49 | } | 55 | } | ||
50 | 56 | | |||
51 | #endif //GLOBAL_H | 57 | #endif //GLOBAL_H |
Unnecessary include