don't alow it anymore to set the backend directly

This commit is contained in:
Patrick von Reth 2015-02-04 10:22:35 +01:00
parent e65e7d9cbe
commit 2713e36f90
5 changed files with 4 additions and 31 deletions

View File

@ -18,6 +18,7 @@
#include "settingsdialog.h"
#include "ui_settingsdialog.h"
#include "snore.h"
#include "snore_p.h"
#include <QAbstractButton>
#include <QTabWidget>
@ -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();
}

View File

@ -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;

View File

@ -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:
/**

View File

@ -73,19 +73,6 @@ QSystemTrayIcon *TrayIcon::trayIcon()
return m_trayIcon;
}
void TrayIcon::setPrimaryBackend()
{
QAction *a = qobject_cast<QAction *>(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()
{

View File

@ -48,7 +48,6 @@ private:
QHash<QTimer *, Snore::Notification> m_notifications;
public slots:
void setPrimaryBackend();
void slotTestNotification();
void sloutUpdateTestNotification();
void slotSettings();