Use Q_GLOBAL_STATIC for Qt only builds

This commit is contained in:
craig.p.drummond
2014-03-17 19:52:47 +00:00
parent 176e9e01a5
commit 0f320b7631
27 changed files with 133 additions and 434 deletions

View File

@@ -29,6 +29,7 @@
#include "mpdparseutils.h"
#include "utils.h"
#include "mediakeys.h"
#include "globalstatic.h"
#ifdef ENABLE_KDE_SUPPORT
#include <KDE/KGlobal>
#include <KDE/KConfig>
@@ -38,8 +39,6 @@
#include <QApplication>
#include <QWidget>
#include <QTimer>
K_GLOBAL_STATIC(Settings, instance)
#else
#include "mediakeys.h"
#endif
@@ -49,18 +48,7 @@ K_GLOBAL_STATIC(Settings, instance)
#define RESTRICT(VAL, MIN_VAL, MAX_VAL) (VAL<MIN_VAL ? MIN_VAL : (VAL>MAX_VAL ? MAX_VAL : VAL))
Settings * Settings::self()
{
#ifdef ENABLE_KDE_SUPPORT
return instance;
#else
static Settings *instance=0;
if (!instance) {
instance=new Settings;
}
return instance;
#endif
}
GLOBAL_STATIC(Settings, instance)
struct MpdDefaults
{