Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>2020-01-11 19:34:56 +0300
committerDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>2020-01-11 19:34:56 +0300
commit86b915d42ebff3c2c36a66fc15ba2085ae12c895 (patch)
treed523036589c4f1b6fd0860f8ded5221430a5af59 /src/gui/systray.cpp
parent738127525f0a8621500c30d40f02dd0918022ad0 (diff)
Systray now a singleton with instance(), show tray on finished wizard
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
Diffstat (limited to 'src/gui/systray.cpp')
-rw-r--r--src/gui/systray.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp
index 2157c7579..a241e5fc2 100644
--- a/src/gui/systray.cpp
+++ b/src/gui/systray.cpp
@@ -36,7 +36,17 @@
namespace OCC {
-Systray::Systray() // TODO: make singleton, provide ::instance()
+Systray *Systray::_instance = nullptr;
+
+Systray *Systray::instance()
+{
+ if (_instance == nullptr) {
+ _instance = new Systray();
+ }
+ return _instance;
+}
+
+Systray::Systray()
: _isOpen(false)
, _syncIsPaused(false)
, _trayComponent(nullptr)
@@ -62,10 +72,6 @@ Systray::Systray() // TODO: make singleton, provide ::instance()
this, &Systray::showWindow);
}
-Systray::~Systray()
-{
-}
-
void Systray::create()
{
if (_trayContext == nullptr) {