diff --git a/src/core/plugins/plugins.cpp b/src/core/plugins/plugins.cpp index 42f15c5..5953ae2 100644 --- a/src/core/plugins/plugins.cpp +++ b/src/core/plugins/plugins.cpp @@ -59,16 +59,6 @@ bool SnorePlugin::isInitialized() const return m_initialized; } -SnoreCore *SnorePlugin::snore() -{ - return &SnoreCore::instance(); -} - -const SnoreCore *SnorePlugin::snore() const -{ - return &SnoreCore::instance(); -} - QVariant SnorePlugin::value(const QString &key) const { return SnoreCore::instance().settings()->value(normaliseKey(key)); diff --git a/src/core/plugins/plugins.h b/src/core/plugins/plugins.h index 66547ea..eed8d8c 100644 --- a/src/core/plugins/plugins.h +++ b/src/core/plugins/plugins.h @@ -48,8 +48,6 @@ public: virtual bool initialize(); virtual bool deinitialize(); bool isInitialized() const; - LIBSNORE_DEPRECATED SnoreCore *snore(); - LIBSNORE_DEPRECATED const SnoreCore *snore() const; const QString &name() const; PluginTypes type() const; diff --git a/src/core/plugins/snorebackend.cpp b/src/core/plugins/snorebackend.cpp index be742fb..dff0865 100644 --- a/src/core/plugins/snorebackend.cpp +++ b/src/core/plugins/snorebackend.cpp @@ -173,7 +173,7 @@ bool SnoreBackend::deinitialize() requestCloseNotification(n, Notification::DISMISSED); } - foreach(const Application & a, snore()->aplications()) { + for(const Application & a : SnoreCore::instance().aplications()) { slotDeregisterApplication(a); } disconnect(SnoreCorePrivate::instance(), SIGNAL(applicationRegistered(Snore::Application)), this, SLOT(slotRegisterApplication(Snore::Application))); diff --git a/src/plugins/backends/snarl/snarl.cpp b/src/plugins/backends/snarl/snarl.cpp index b751ba4..32aeb91 100644 --- a/src/plugins/backends/snarl/snarl.cpp +++ b/src/plugins/backends/snarl/snarl.cpp @@ -49,7 +49,7 @@ public: if (msg->message == SNARL_GLOBAL_MESSAGE) { int action = msg->wParam; if (action == SnarlEnums::SnarlLaunched) { - foreach(const Application & a, m_snarl->snore()->aplications()) { + for(const Application & a : SnoreCore::instance().aplications()) { m_snarl->slotRegisterApplication(a); } } diff --git a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp index b7f7808..96ca85b 100644 --- a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp +++ b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp @@ -96,7 +96,7 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id, icon = Icon(":/root/snore.png"); } - if (!snore()->aplications().contains(app_name)) { + if (!SnoreCore::instance().aplications().contains(app_name)) { qDebug() << QIcon::themeSearchPaths(); QIcon qicon = QIcon::fromTheme(app_icon, QIcon(":/root/snore.png")); QSize max; @@ -109,9 +109,9 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id, Alert alert("DBus Alert", appIcon); app = Application(app_name, appIcon); app.addAlert(alert); - snore()->registerApplication(app); + SnoreCore::instance().registerApplication(app); } else { - app = snore()->aplications()[app_name]; + app = SnoreCore::instance().aplications()[app_name]; } if (hints.contains("urgency")) { @@ -119,8 +119,8 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id, } Notification noti; - if (replaces_id != 0 && snore()->getActiveNotificationByID(replaces_id).isValid()) { - noti = Notification(snore()->getActiveNotificationByID(replaces_id), summary, body, icon, timeout == -1 ? Notification::defaultTimeout() : timeout / 1000, priotity); + if (replaces_id != 0 && SnoreCore::instance().getActiveNotificationByID(replaces_id).isValid()) { + noti = Notification(SnoreCore::instance().getActiveNotificationByID(replaces_id), summary, body, icon, timeout == -1 ? Notification::defaultTimeout() : timeout / 1000, priotity); } else { noti = Notification(app, *app.alerts().begin(), summary, body, icon, timeout == -1 ? Notification::defaultTimeout() : timeout / 1000, priotity); } @@ -129,15 +129,15 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id, noti.addAction(Action(actions.at(i).toInt(), actions.at(i + 1))); } - snore()->broadcastNotification(noti); + SnoreCore::instance().broadcastNotification(noti); return noti.id(); } void FreedesktopFrontend::CloseNotification(uint id) { - Notification noti = snore()->getActiveNotificationByID(id); + Notification noti = SnoreCore::instance().getActiveNotificationByID(id); if (noti.isValid()) { - snore()->requestCloseNotification(noti, Notification::TIMED_OUT); + SnoreCore::instance().requestCloseNotification(noti, Notification::TIMED_OUT); } } diff --git a/src/plugins/frontends/snarlnetwork/parser.cpp b/src/plugins/frontends/snarlnetwork/parser.cpp index 74500c6..e0fd4a9 100644 --- a/src/plugins/frontends/snarlnetwork/parser.cpp +++ b/src/plugins/frontends/snarlnetwork/parser.cpp @@ -108,8 +108,8 @@ void Parser::parse(Notification &sNotification, const QString &msg, QTcpSocket * switch (action) { case NOTIFICATION: { - if (!snarl->snore()->aplications().contains(app.name())) { - snarl->snore()->registerApplication(app); + if (!SnoreCore::instance().aplications().contains(app.name())) { + SnoreCore::instance().registerApplication(app); } if (!alert.isActive()) { @@ -136,7 +136,7 @@ void Parser::parse(Notification &sNotification, const QString &msg, QTcpSocket * } break; case UNREGISTER: - snarl->snore()->deregisterApplication(app); + SnoreCore::instance().deregisterApplication(app); snarl->m_applications.take(client); break; case ERROR: diff --git a/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp b/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp index 687c852..45ce16f 100644 --- a/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp +++ b/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp @@ -103,7 +103,7 @@ void SnarlNetworkFrontend::handleMessages() Notification noti; parser->parse(noti, s, client); if (noti.isValid()) { - snore()->broadcastNotification(noti); + SnoreCore::instance().broadcastNotification(noti); write(client, QString("%1/%2\r\n").arg(out, QString::number(noti.id()))); } else { write(client, QString("%1\r\n").arg(out));