diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-10-07 19:40:16 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-10-07 19:40:27 (GMT) |
commit | 88eab3d1d9b722590da3837e3c79839189ea58d2 (patch) | |
tree | 05709f368187657c5788ebf2d5206cb47414933d /Swift/Controllers/EventNotifier.cpp | |
parent | e433e70d3dd015db5124ee72085e758635260168 (diff) | |
download | swift-contrib-88eab3d1d9b722590da3837e3c79839189ea58d2.zip swift-contrib-88eab3d1d9b722590da3837e3c79839189ea58d2.tar.bz2 |
Code cleanup from recent commits
Diffstat (limited to 'Swift/Controllers/EventNotifier.cpp')
-rw-r--r-- | Swift/Controllers/EventNotifier.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Swift/Controllers/EventNotifier.cpp b/Swift/Controllers/EventNotifier.cpp index 7743d6f..7c8adaf 100644 --- a/Swift/Controllers/EventNotifier.cpp +++ b/Swift/Controllers/EventNotifier.cpp @@ -16,17 +16,12 @@ #include "Swift/Controllers/XMPPEvents/MessageEvent.h" #include "Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h" #include "Swift/Controllers/XMPPEvents/ErrorEvent.h" -#include "Swift/Controllers/UIEvents/UIEventStream.h" -#include "Swift/Controllers/UIEvents/ToggleNotificationsUIEvent.h" #include "Swiften/Settings/SettingsProvider.h" namespace Swift { -EventNotifier::EventNotifier(EventController* eventController, Notifier* notifier, AvatarManager* avatarManager, NickResolver* nickResolver, UIEventStream* uiEvents, SettingsProvider* settings) : eventController(eventController), notifier(notifier), avatarManager(avatarManager), nickResolver(nickResolver), uiEvents(uiEvents), settings(settings) { +EventNotifier::EventNotifier(EventController* eventController, Notifier* notifier, AvatarManager* avatarManager, NickResolver* nickResolver) : eventController(eventController), notifier(notifier), avatarManager(avatarManager), nickResolver(nickResolver) { eventController->onEventQueueEventAdded.connect(boost::bind(&EventNotifier::handleEventAdded, this, _1)); - bool enabled = settings->getBoolSetting("showNotifications", true); - notifier->setEnabled(enabled); - uiEvents->send(boost::shared_ptr<ToggleNotificationsUIEvent>(new ToggleNotificationsUIEvent(enabled))); } EventNotifier::~EventNotifier() { @@ -55,14 +50,4 @@ void EventNotifier::handleNotificationActivated(JID jid) { onNotificationActivated(jid); } -void EventNotifier::handleUIEvent(boost::shared_ptr<UIEvent> event) { - boost::shared_ptr<ToggleNotificationsUIEvent> notificationsEvent = boost::dynamic_pointer_cast<ToggleNotificationsUIEvent>(event); - if (notificationsEvent) { - bool enabled = notificationsEvent->getEnabled(); - if (enabled != notifier->getEnabled()) { - notifier->setEnabled(enabled); - settings->storeBool("showNotifications", enabled); - } - } -} } |