aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-08 11:45:00 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-09-08 11:45:00 -0500
commit48b162d72dc3e470e95de8259901e9689d229668 (patch)
treef6669dc628b60c4ce4c2ff980db56fd50a6ced44 /src
parentb06dda0e74e93e107b0be4158bd82ba1e8853bc4 (diff)
downloadayatana-indicator-power-48b162d72dc3e470e95de8259901e9689d229668.tar.gz
ayatana-indicator-power-48b162d72dc3e470e95de8259901e9689d229668.tar.bz2
ayatana-indicator-power-48b162d72dc3e470e95de8259901e9689d229668.zip
in notifier.c, don't call notify_get_server_caps() if notify_init() failed.
Diffstat (limited to 'src')
-rw-r--r--src/notifier.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/notifier.c b/src/notifier.c
index ed079e5..a059447 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -361,18 +361,21 @@ indicator_power_notifier_init (IndicatorPowerNotifier * self)
GList * caps;
GList * l;
+ actions_supported = FALSE;
+
if (!notify_init("indicator-power-service"))
{
g_critical("Unable to initialize libnotify! Notifications might not be shown.");
}
-
- /* see if actions are supported */
- actions_supported = FALSE;
- caps = notify_get_server_caps();
- for (l=caps; l!=NULL && !actions_supported; l=l->next)
- if (!g_strcmp0(l->data, "actions"))
- actions_supported = TRUE;
- g_list_free_full(caps, g_free);
+ else
+ {
+ /* see if actions are supported */
+ caps = notify_get_server_caps();
+ for (l=caps; l!=NULL && !actions_supported; l=l->next)
+ if (!g_strcmp0(l->data, "actions"))
+ actions_supported = TRUE;
+ g_list_free_full(caps, g_free);
+ }
}
}