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