fix warnings and crash

This commit is contained in:
Patrick von Reth 2015-06-26 13:00:46 +02:00
parent 5ecd0c3cc3
commit 361ee29e94
3 changed files with 6 additions and 4 deletions

View File

@ -27,7 +27,7 @@
#include "version.h"
#include <iostream>
#include <memory>
#include <QSettings>
#include <QThread>
@ -48,8 +48,8 @@ SnoreCore::SnoreCore(QObject *parent):
SnoreCore &SnoreCore::instance()
{
static SnoreCore instance(qApp);
return instance;
static SnoreCore *instance(new SnoreCore(qApp));
return *instance;
}
SnoreCore::~SnoreCore()

View File

@ -32,6 +32,7 @@
using namespace Snore;
SnoreCorePrivate::SnoreCorePrivate():
m_localSettingsPrefix(qApp->applicationName().isEmpty() ? "SnoreNotify" : qApp->applicationName()),
m_settings(new QSettings("Snorenotify", "libsnore", this))
{
snoreDebug(SNORE_INFO) << "Version:" << Version::version();
@ -45,6 +46,7 @@ SnoreCorePrivate::SnoreCorePrivate():
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(slotAboutToQuit()));
m_defaultApp = Application("SnoreNotify", Icon(":/root/snore.png"));
}

View File

@ -101,7 +101,7 @@ private:
Application m_defaultApp;
QString m_localSettingsPrefix = qApp->applicationName().isEmpty() ? "SnoreNotify" : qApp->applicationName();
QString m_localSettingsPrefix;
QSettings *m_settings;