From: Jose Dapena Paz Date: Mon, 31 Aug 2009 12:56:50 +0000 (+0200) Subject: Handle properly ca_context_open, so that we can play more than one tone. X-Git-Tag: 3.0.17-rc45~1 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=28d019df4f60f67426a816fc4da9f8df51784a8d Handle properly ca_context_open, so that we can play more than one tone. * src/hildon2/modest-platform.c (modest_platform_play_email_tone): track if we already called ca_context_open succesfully (fixes NB#134700). --- diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index e857ca9..f8554c1 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -111,6 +111,7 @@ #define MODEST_ALARMD_APPID PACKAGE_NAME static ca_context *ca_con = NULL; +static gboolean ca_con_opened = FALSE; static void modest_platform_play_email_tone (void); @@ -2663,9 +2664,13 @@ modest_platform_play_email_tone (void) } } - if ((ret = ca_context_open(ca_con)) != CA_SUCCESS) { - g_warning("ca_context_open: %s\n", ca_strerror(ret)); - return; + if (!ca_con_opened) { + if ((ret = ca_context_open(ca_con)) != CA_SUCCESS) { + g_warning("ca_context_open: %s\n", ca_strerror(ret)); + return; + } else { + ca_con_opened = TRUE; + } } ca_proplist_create(&pl);