Q_GLOBAL_STATIC is unnecessary on basic data types.

This commit is contained in:
Albert Vaca 2016-11-26 15:55:18 +01:00
parent d71d3090d2
commit 1a2b227dff

View file

@ -34,7 +34,7 @@
#include "backends/devicelink.h" #include "backends/devicelink.h"
#include "backends/linkprovider.h" #include "backends/linkprovider.h"
Q_GLOBAL_STATIC(Daemon*, s_instance) static Daemon* s_instance = nullptr;
struct DaemonPrivate struct DaemonPrivate
{ {
@ -49,16 +49,16 @@ struct DaemonPrivate
Daemon* Daemon::instance() Daemon* Daemon::instance()
{ {
Q_ASSERT(s_instance.exists()); Q_ASSERT(s_instance != nullptr);
return *s_instance; return s_instance;
} }
Daemon::Daemon(QObject *parent, bool testMode) Daemon::Daemon(QObject *parent, bool testMode)
: QObject(parent) : QObject(parent)
, d(new DaemonPrivate) , d(new DaemonPrivate)
{ {
Q_ASSERT(!s_instance.exists()); Q_ASSERT(!s_instance);
*s_instance = this; s_instance = this;
qCDebug(KDECONNECT_CORE) << "KdeConnect daemon starting"; qCDebug(KDECONNECT_CORE) << "KdeConnect daemon starting";
//Load backends //Load backends