aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/alarm-queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/alarm-notify/alarm-queue.c')
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index 06d1d3b4cd..08dda9ad66 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -77,7 +77,7 @@
static AlarmNotificationsDialog *alarm_notifications_dialog = NULL;
/* Whether the queueing system has been initialized */
-static gboolean alarm_queue_inited;
+static gboolean alarm_queue_inited = FALSE;
/* When the alarm queue system is inited, this gets set to the last time an
* alarm notification was issued. This lets us present any notifications that
@@ -2146,8 +2146,15 @@ alarm_queue_remove_async (EThread *e, AlarmMsg *msg, void *data)
g_hash_table_remove (client_alarms_hash, client);
}
+/** alarm_queue_remove_client
+ *
+ * asynchronously remove client from alarm queue.
+ * @param client Client to remove.
+ * @param immediately Indicates whether use thread or do it right now.
+ */
+
void
-alarm_queue_remove_client (ECal *client)
+alarm_queue_remove_client (ECal *client, gboolean immediately)
{
AlarmMsg *msg;
struct _alarm_client_msg *list;
@@ -2161,7 +2168,10 @@ alarm_queue_remove_client (ECal *client)
msg->data = list;
d(printf("%s:%d (alarm_queue_remove_client) - Posting a task\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ if (immediately)
+ alarm_queue_remove_async (NULL, msg, NULL);
+ else
+ e_thread_put(alarm_operation_thread, (EMsg *)msg);
}
/* Update non-time related variables for various structures on modification of an existing component