aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-08-08 12:26:12 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-08 12:26:12 +0800
commitcea054cd54d84479352a43bbabc19c9ce9af5efb (patch)
treeba02763209ba0f22989024004f57689071603ec5 /filter
parent91a6b6899e5568ed34f913bedb538dd6c9e35b32 (diff)
downloadgsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.gz
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.zst
gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.zip
Merge revisions 35747:35930 from trunk.
svn path=/branches/kill-bonobo/; revision=35931
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog19
-rw-r--r--filter/filter-label.c33
-rw-r--r--filter/filter-rule.c7
3 files changed, 40 insertions, 19 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 1e713d561e..145ae2c029 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,22 @@
+2008-07-30 Takao Fujiwara <takao.fujiwara@sun.com>
+
+ Reviewed by Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #545303
+
+ * filter-rule.c: (xml_decode): Add gettext in the xml string.
+
+2008-07-28 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #530388
+
+ * filter-label.c: (filter_label_init), (filter_label_finalise),
+ (fill_options), (filter_label_count), (filter_label_label),
+ (filter_label_index): Make 'cache_lock' a rec mutex.
+ * filter-label.c: (regen_label_options): Guard also regeneration
+ of each tracked item with the rec lock, thus noone will touch
+ 'tracked_filters' GSList until we are fully done with it.
+
2008-07-03 Milan Crha <mcrha@redhat.com>
** Fix for bug #243201
diff --git a/filter/filter-label.c b/filter/filter-label.c
index 90906e8ba1..7291e36b4c 100644
--- a/filter/filter-label.c
+++ b/filter/filter-label.c
@@ -74,7 +74,7 @@ filter_label_get_type (void)
return type;
}
-static GStaticMutex cache_lock = G_STATIC_MUTEX_INIT;
+static GStaticRecMutex cache_lock = G_STATIC_REC_MUTEX_INIT;
static guint cache_notifier_id = 0;
static GSList *tracked_filters = NULL;
static GSList *labels_cache = NULL;
@@ -103,7 +103,7 @@ filter_label_init (FilterLabel *fl)
{
((FilterOption *) fl)->type = "label";
- g_static_mutex_lock (&cache_lock);
+ g_static_rec_mutex_lock (&cache_lock);
if (!tracked_filters) {
fill_cache ();
@@ -115,7 +115,7 @@ filter_label_init (FilterLabel *fl)
tracked_filters = g_slist_prepend (tracked_filters, fl);
- g_static_mutex_unlock (&cache_lock);
+ g_static_rec_mutex_unlock (&cache_lock);
}
static void
@@ -123,7 +123,7 @@ filter_label_finalise (GObject *obj)
{
G_OBJECT_CLASS (parent_class)->finalize (obj);
- g_static_mutex_lock (&cache_lock);
+ g_static_rec_mutex_lock (&cache_lock);
tracked_filters = g_slist_remove (tracked_filters, obj);
@@ -138,7 +138,7 @@ filter_label_finalise (GObject *obj)
gconf_client = NULL;
}
- g_static_mutex_unlock (&cache_lock);
+ g_static_rec_mutex_unlock (&cache_lock);
}
/**
@@ -176,7 +176,7 @@ fill_options (FilterOption *fo)
{
GSList *l;
- g_static_mutex_lock (&cache_lock);
+ g_static_rec_mutex_lock (&cache_lock);
for (l = labels_cache; l; l = l->next) {
EUtilLabel *label = l->data;
@@ -197,7 +197,7 @@ fill_options (FilterOption *fo)
g_free (title);
}
- g_static_mutex_unlock (&cache_lock);
+ g_static_rec_mutex_unlock (&cache_lock);
}
static void
@@ -222,12 +222,13 @@ regen_label_options (FilterOption *fo)
static void
gconf_labels_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
{
- g_static_mutex_lock (&cache_lock);
+ g_static_rec_mutex_lock (&cache_lock);
+
clear_cache ();
fill_cache ();
- g_static_mutex_unlock (&cache_lock);
-
g_slist_foreach (tracked_filters, (GFunc)regen_label_options, NULL);
+
+ g_static_rec_mutex_unlock (&cache_lock);
}
/* ************************************************************************* */
@@ -237,11 +238,11 @@ filter_label_count (void)
{
int res;
- g_static_mutex_lock (&cache_lock);
+ g_static_rec_mutex_lock (&cache_lock);
res = g_slist_length (labels_cache);
- g_static_mutex_unlock (&cache_lock);
+ g_static_rec_mutex_unlock (&cache_lock);
return res;
}
@@ -253,7 +254,7 @@ filter_label_label (int i)
GSList *l;
EUtilLabel *label;
- g_static_mutex_lock (&cache_lock);
+ g_static_rec_mutex_lock (&cache_lock);
l = g_slist_nth (labels_cache, i);
@@ -269,7 +270,7 @@ filter_label_label (int i)
res = label->tag;
}
- g_static_mutex_unlock (&cache_lock);
+ g_static_rec_mutex_unlock (&cache_lock);
return res;
}
@@ -280,7 +281,7 @@ filter_label_index (const char *label)
int i;
GSList *l;
- g_static_mutex_lock (&cache_lock);
+ g_static_rec_mutex_lock (&cache_lock);
for (i = 0, l = labels_cache; l; i++, l = l->next) {
EUtilLabel *lbl = l->data;
@@ -293,7 +294,7 @@ filter_label_index (const char *label)
break;
}
- g_static_mutex_unlock (&cache_lock);
+ g_static_rec_mutex_unlock (&cache_lock);
if (l)
return i;
diff --git a/filter/filter-rule.c b/filter/filter-rule.c
index e6e59baeac..c7e79269e6 100644
--- a/filter/filter-rule.c
+++ b/filter/filter-rule.c
@@ -444,12 +444,13 @@ xml_decode (FilterRule *fr, xmlNodePtr node, RuleContext *f)
load_set (work, fr, f);
} else if (!strcmp ((char *)work->name, "title") || !strcmp ((char *)work->name, "_title")) {
if (!fr->name) {
- char *str, *decstr;
+ char *str, *decstr = NULL;
str = (char *)xmlNodeGetContent (work);
- decstr = g_strdup (str);
- if (str)
+ if (str) {
+ decstr = g_strdup (_(str));
xmlFree (str);
+ }
fr->name = decstr;
}
}