aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@src.gnome.org>2007-08-10 16:53:56 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-08-10 16:53:56 +0800
commit92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c (patch)
tree96582aa11cb7857c50542d812e2e01f904835aa8 /calendar/gui
parent630376903f102d7948756fb350d09a041663feae (diff)
downloadgsoc2013-evolution-92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c.tar
gsoc2013-evolution-92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c.tar.gz
gsoc2013-evolution-92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c.tar.bz2
gsoc2013-evolution-92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c.tar.lz
gsoc2013-evolution-92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c.tar.xz
gsoc2013-evolution-92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c.tar.zst
gsoc2013-evolution-92315fc8f7520d2fe14f164cbe5e21aec5bd5b0c.zip
2007-08-10 mcrha Fix for bug #351552
svn path=/trunk/; revision=33975
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c22
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c16
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.h2
3 files changed, 28 insertions, 12 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index 3f723e1719..27fb53cfaf 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -257,7 +257,7 @@ dequeue_client (gpointer key, gpointer value, gpointer user_data)
ECal *client = value;
d (printf("%s:%d (dequeue_client) - Removing client %p\n ", __FILE__, __LINE__, client));
- alarm_queue_remove_client (client);
+ alarm_queue_remove_client (client, TRUE);
}
/* Finalize handler for the alarm notify system */
@@ -442,12 +442,18 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource
/* if loading of this requires password and password is not currently availble in e-password
session skip this source loading. we do not really want to prompt for auth from alarm dameon*/
- if ((e_source_get_property (source, "auth") &&
- (!e_passwords_get_password (e_source_get_property(source, "auth-domain"), pass_key)))) {
- g_mutex_unlock (an->priv->mutex);
- g_free (str_uri);
- g_free (pass_key);
- return;
+ if (e_source_get_property (source, "auth")) {
+ const gchar *name = e_source_get_property (source, "auth-domain");
+
+ if (!name)
+ name = e_source_peek_name (source);
+
+ if (!e_passwords_get_password (name, pass_key)) {
+ g_mutex_unlock (an->priv->mutex);
+ g_free (str_uri);
+ g_free (pass_key);
+ return;
+ }
}
client = auth_new_cal_from_source (source, source_type);
@@ -474,7 +480,7 @@ alarm_notify_remove_calendar (AlarmNotify *an, ECalSourceType source_type, const
client = g_hash_table_lookup (priv->uri_client_hash[source_type], str_uri);
if (client) {
d (printf("%s:%d (alarm_notify_remove_calendar) - Removing Client %p\n", __FILE__, __LINE__, client));
- alarm_queue_remove_client (client);
+ alarm_queue_remove_client (client, FALSE);
g_hash_table_remove (priv->uri_client_hash[source_type], str_uri);
}
}
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
diff --git a/calendar/gui/alarm-notify/alarm-queue.h b/calendar/gui/alarm-notify/alarm-queue.h
index 60e1abde46..25638e4333 100644
--- a/calendar/gui/alarm-notify/alarm-queue.h
+++ b/calendar/gui/alarm-notify/alarm-queue.h
@@ -28,7 +28,7 @@ void alarm_queue_init (gpointer);
void alarm_queue_done (void);
void alarm_queue_add_client (ECal *client);
-void alarm_queue_remove_client (ECal *client);
+void alarm_queue_remove_client (ECal *client, gboolean immediately);
#endif