summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/Notifier')
-rw-r--r--SwifTools/Notifier/SnarlNotifier.cpp6
-rw-r--r--SwifTools/Notifier/SnarlNotifier.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/SwifTools/Notifier/SnarlNotifier.cpp b/SwifTools/Notifier/SnarlNotifier.cpp
index 709128b..8d7407a 100644
--- a/SwifTools/Notifier/SnarlNotifier.cpp
+++ b/SwifTools/Notifier/SnarlNotifier.cpp
@@ -17,9 +17,9 @@
namespace Swift {
-SnarlNotifier::SnarlNotifier(const String& name, Win32NotifierWindow* window, const boost::filesystem::path& icon) : window(window) {
+SnarlNotifier::SnarlNotifier(const String& name, Win32NotifierWindow* window, const boost::filesystem::path& icon) : window(window), available(false) {
window->onMessageReceived.connect(boost::bind(&SnarlNotifier::handleMessageReceived, this, _1));
- snarl.RegisterApp(name.getUTF8Data(), name.getUTF8Data(), icon.string().c_str(), window->getID(), SWIFT_SNARLNOTIFIER_MESSAGE_ID);
+ available = snarl.RegisterApp(name.getUTF8Data(), name.getUTF8Data(), icon.string().c_str(), window->getID(), SWIFT_SNARLNOTIFIER_MESSAGE_ID);
foreach(Notifier::Type type, getAllTypes()) {
snarl.AddClass(typeToString(type).getUTF8Data(), typeToString(type).getUTF8Data());
}
@@ -34,7 +34,7 @@ SnarlNotifier::~SnarlNotifier() {
}
bool SnarlNotifier::isAvailable() const {
- return false;
+ return available;
}
diff --git a/SwifTools/Notifier/SnarlNotifier.h b/SwifTools/Notifier/SnarlNotifier.h
index d03882a..9aa75f6 100644
--- a/SwifTools/Notifier/SnarlNotifier.h
+++ b/SwifTools/Notifier/SnarlNotifier.h
@@ -28,6 +28,7 @@ namespace Swift {
private:
Snarl::V41::SnarlInterface snarl;
Win32NotifierWindow* window;
+ bool available;
typedef std::map<int, boost::function<void()> > NotificationsMap;
NotificationsMap notifications;
};