aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog13
-rw-r--r--src/snap.cpp19
2 files changed, 28 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index c5fa440..09f58b4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+indicator-datetime (13.10.0+14.04.20140321-0ubuntu1) trusty; urgency=low
+
+ [ Charles Kerr ]
+ * If we notify_notification_show() fails, we shouldn't play the alarm
+ sound. The alarm sound loops until the user dismisses it, which will
+ never happen if we can't talk to unity-notiifications. So the
+ outcome in this error case is that the alarm plays forever and can't
+ be dismissed by the user. (LP: #1295237)
+ * Add debug logging of what capabilities the notification server said
+ it supports. (LP: #1295271)
+
+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 21 Mar 2014 05:23:04 +0000
+
indicator-datetime (13.10.0+14.04.20140314.1-0ubuntu1) trusty; urgency=low
[ Charles Kerr ]
diff --git a/src/snap.cpp b/src/snap.cpp
index 5cf6063..3ab2941 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -186,8 +186,16 @@ std::set<std::string> get_server_caps()
{
std::set<std::string> caps_set;
auto caps_gl = notify_get_server_caps();
+ std::string caps_str;
for(auto l=caps_gl; l!=nullptr; l=l->next)
+ {
caps_set.insert((const char*)l->data);
+
+ caps_str += (const char*) l->data;;
+ if (l->next != nullptr)
+ caps_str += ", ";
+ }
+ g_debug ("%s notify_get_server() returned [%s]", G_STRFUNC, caps_str.c_str());
g_list_free_full(caps_gl, g_free);
return caps_set;
}
@@ -222,7 +230,7 @@ NotifyMode get_notify_mode()
return mode;
}
-void show_notification (SnapData* data, NotifyMode mode)
+bool show_notification (SnapData* data, NotifyMode mode)
{
const Appointment& appointment = data->appointment;
@@ -242,16 +250,19 @@ void show_notification (SnapData* data, NotifyMode mode)
}
g_object_set_data_full(G_OBJECT(nn), "snap-data", data, snap_data_destroy_notify);
+ bool shown = true;
GError * error = nullptr;
notify_notification_show(nn, &error);
if (error != NULL)
{
- g_warning("Unable to show snap decision for '%s': %s", body.c_str(), error->message);
+ g_critical("Unable to show snap decision for '%s': %s", body.c_str(), error->message);
g_error_free(error);
data->show(data->appointment);
+ shown = false;
}
g_free(title);
+ return shown;
}
/**
@@ -274,8 +285,8 @@ void notify(const Appointment& appointment,
break;
default:
- show_notification(data, NOTIFY_MODE_SNAP);
- play_alarm_sound();
+ if (show_notification(data, NOTIFY_MODE_SNAP))
+ play_alarm_sound();
break;
}
}