diff options
author | Remko Tronçon <git@el-tramo.be> | 2012-03-15 19:21:46 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-03-15 19:21:46 (GMT) |
commit | 138223ab9ca917420d107d95a113e7628c27bac5 (patch) | |
tree | b7d71cc491af5723b72eec205695ac51cb2edf74 /SwifTools/Notifier | |
parent | 68d037d25824bcddfbb1316a221cd7a15ed109c2 (diff) | |
download | swift-contrib-138223ab9ca917420d107d95a113e7628c27bac5.zip swift-contrib-138223ab9ca917420d107d95a113e7628c27bac5.tar.bz2 |
Added purge to Growl.
Diffstat (limited to 'SwifTools/Notifier')
-rw-r--r-- | SwifTools/Notifier/GrowlNotifier.h | 8 | ||||
-rw-r--r-- | SwifTools/Notifier/GrowlNotifier.mm | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/SwifTools/Notifier/GrowlNotifier.h b/SwifTools/Notifier/GrowlNotifier.h index f1fb8c6..73f1008 100644 --- a/SwifTools/Notifier/GrowlNotifier.h +++ b/SwifTools/Notifier/GrowlNotifier.h @@ -29,9 +29,11 @@ namespace Swift { void handleNotificationClicked(void* data); void handleNotificationTimedOut(void* data); - virtual void purgeCallbacks() { -#warning FIXME: Implement - } + virtual void purgeCallbacks(); + + private: + void clearPendingNotifications(); + private: class Private; boost::shared_ptr<Private> p; diff --git a/SwifTools/Notifier/GrowlNotifier.mm b/SwifTools/Notifier/GrowlNotifier.mm index b0f26ce..c1996d9 100644 --- a/SwifTools/Notifier/GrowlNotifier.mm +++ b/SwifTools/Notifier/GrowlNotifier.mm @@ -60,10 +60,7 @@ GrowlNotifier::GrowlNotifier(const std::string& name) { GrowlNotifier::~GrowlNotifier() { [GrowlApplicationBridge setGrowlDelegate: nil]; - foreach (Context* context, p->pendingNotifications) { - delete context; - } - p->pendingNotifications.clear(); + clearPendingNotifications(); } void GrowlNotifier::showMessage(Type type, const std::string& subject, const std::string& description, const boost::filesystem::path& picturePath, boost::function<void()> callback) { @@ -106,4 +103,15 @@ bool GrowlNotifier::isExternallyConfigured() const { return ![GrowlApplicationBridge isMistEnabled]; } +void GrowlNotifier::purgeCallbacks() { + clearPendingNotifications(); +} + +void GrowlNotifier::clearPendingNotifications() { + foreach (Context* context, p->pendingNotifications) { + delete context; + } + p->pendingNotifications.clear(); +} + } |