diff --git a/src/core/settingsdialog.cpp b/src/core/settingsdialog.cpp index e16c719..f7841fd 100644 --- a/src/core/settingsdialog.cpp +++ b/src/core/settingsdialog.cpp @@ -18,6 +18,7 @@ #include "settingsdialog.h" #include "ui_settingsdialog.h" #include "snore.h" +#include "snore_p.h" #include #include @@ -77,7 +78,7 @@ void SettingsDialog::load() void SettingsDialog::save() { snoreDebug(SNORE_DEBUG) << "saving"; - m_snore->setPrimaryNotificationBackend(ui->primaryBackendComboBox->currentText()); + m_snore->d()->setBackendIfAvailible(ui->primaryBackendComboBox->currentText()); for (auto w : m_tabs) { w->saveSettings(); } diff --git a/src/core/snore.cpp b/src/core/snore.cpp index 3621b48..3a81f80 100644 --- a/src/core/snore.cpp +++ b/src/core/snore.cpp @@ -138,12 +138,6 @@ const QStringList SnoreCore::pluginNames(SnorePlugin::PluginTypes type) const return out; } -bool SnoreCore::setPrimaryNotificationBackend(const QString &backend) -{ - Q_D(SnoreCore); - return d->setBackendIfAvailible(backend); -} - const QString SnoreCore::primaryNotificationBackend() const { Q_D(const SnoreCore); @@ -224,7 +218,7 @@ bool SnoreCore::pluginIsEnabled(const QString &pluginName) const return d->m_plugins.value(pluginName)->isInitialized(); } -const SnoreCorePrivate *SnoreCore::d() +SnoreCorePrivate *SnoreCore::d() { Q_D(SnoreCore); return d; diff --git a/src/core/snore.h b/src/core/snore.h index c19fb7c..f23024f 100644 --- a/src/core/snore.h +++ b/src/core/snore.h @@ -111,14 +111,6 @@ public: */ const QStringList pluginNames(SnorePlugin::PluginTypes type) const; - /** - * Sets the primary backend. - * - * @param backend the name of the backend - * @return whether the backend was initialied succesfully. - */ - bool setPrimaryNotificationBackend(const QString &backend); - /** * * @return the name of the active primary backend @@ -178,7 +170,7 @@ public: /** * @return a pointer to the private class, for internal use only. */ - const SnoreCorePrivate *d(); + SnoreCorePrivate *d(); signals: /** diff --git a/src/daemon/trayicon.cpp b/src/daemon/trayicon.cpp index 11a46b3..4866325 100644 --- a/src/daemon/trayicon.cpp +++ b/src/daemon/trayicon.cpp @@ -73,19 +73,6 @@ QSystemTrayIcon *TrayIcon::trayIcon() return m_trayIcon; } -void TrayIcon::setPrimaryBackend() -{ - QAction *a = qobject_cast(sender()); - m_snore->setPrimaryNotificationBackend(a->text()); - - foreach(QAction * action, m_backendActions->actions()) { - if (action->text() == m_snore->primaryNotificationBackend()) { - action->setChecked(true); - break; - } - } -} - void TrayIcon::slotTestNotification() { diff --git a/src/daemon/trayicon.h b/src/daemon/trayicon.h index 79e693b..4505243 100644 --- a/src/daemon/trayicon.h +++ b/src/daemon/trayicon.h @@ -48,7 +48,6 @@ private: QHash m_notifications; public slots: - void setPrimaryBackend(); void slotTestNotification(); void sloutUpdateTestNotification(); void slotSettings();