diff options
| author | xiphon <xiphon@protonmail.com> | 2020-11-30 15:22:31 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-11-30 15:36:19 +0000 |
| commit | ea1fee2f5f842a293458a66638c15ff79e1d101d (patch) | |
| tree | 146d01bfda438697cc814b4b4eaec5796fbda9a2 /src/main | |
| parent | 96f9c11320ee3c4f1f1c35f3ac8e8f78340bd378 (diff) | |
| download | monzero-gui-ea1fee2f5f842a293458a66638c15ff79e1d101d.tar.gz monzero-gui-ea1fee2f5f842a293458a66638c15ff79e1d101d.tar.xz monzero-gui-ea1fee2f5f842a293458a66638c15ff79e1d101d.zip | |
main: Linux - ask to create desktop entry on the first start
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/main.cpp | 5 | ||||
| -rw-r--r-- | src/main/oshelper.cpp | 9 | ||||
| -rw-r--r-- | src/main/oshelper.h | 1 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp index 79e172ca..47369bd5 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -319,11 +319,6 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw return 1; } - // Desktop entry -#ifdef Q_OS_LINUX - registerXdgMime(app); -#endif - IPC *ipc = new IPC(&app); QStringList posArgs = parser.positionalArguments(); diff --git a/src/main/oshelper.cpp b/src/main/oshelper.cpp index 9b24262e..7584732e 100644 --- a/src/main/oshelper.cpp +++ b/src/main/oshelper.cpp @@ -46,11 +46,13 @@ #endif #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) #include <X11/XKBlib.h> +#undef Bool #undef KeyPress #undef KeyRelease #undef FocusIn #undef FocusOut // #undef those Xlib #defines that conflict with QEvent::Type enum +#include "qt/utils.h" #endif #if defined(Q_OS_WIN) @@ -85,6 +87,13 @@ OSHelper::OSHelper(QObject *parent) : QObject(parent) } +void OSHelper::createDesktopEntry() const +{ +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) + registerXdgMime(); +#endif +} + QString OSHelper::downloadLocation() const { return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); diff --git a/src/main/oshelper.h b/src/main/oshelper.h index f3bc4c04..96f58073 100644 --- a/src/main/oshelper.h +++ b/src/main/oshelper.h @@ -41,6 +41,7 @@ class OSHelper : public QObject public: explicit OSHelper(QObject *parent = 0); + Q_INVOKABLE void createDesktopEntry() const; Q_INVOKABLE QString downloadLocation() const; Q_INVOKABLE bool openContainingFolder(const QString &filePath) const; Q_INVOKABLE QString openSaveFileDialog(const QString &title, const QString &folder, const QString &filename) const; |
