aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-12 12:12:01 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-12 12:12:01 +0800
commitc7d3c9f95609123035ebaa267f9d2e6ecfa8c2e8 (patch)
tree246bdb714e24e1b0c9a8ce4a3e45a46b230316de /filter
parentf8b33bc4ebe9dd8043674141b5fe4660efaa99e8 (diff)
downloadgsoc2013-evolution-c7d3c9f95609123035ebaa267f9d2e6ecfa8c2e8.tar.gz
gsoc2013-evolution-c7d3c9f95609123035ebaa267f9d2e6ecfa8c2e8.tar.zst
gsoc2013-evolution-c7d3c9f95609123035ebaa267f9d2e6ecfa8c2e8.zip
Merge revisions 36866:37046 from trunk.
svn path=/branches/kill-bonobo/; revision=37050
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog35
-rw-r--r--filter/filter-code.c20
-rw-r--r--filter/filter-code.h2
-rw-r--r--filter/filter-int.c2
-rw-r--r--filter/filter-option.c11
-rw-r--r--filter/rule-context.c4
-rw-r--r--filter/rule-editor.c3
7 files changed, 63 insertions, 14 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 367645ea18..a30463deb5 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,38 @@
+2009-01-11 Tor Lillqvist <tml@novell.com>
+
+ * filter-option.c (get_dynamic_options): Add cast to avoid
+ warning.
+
+2009-01-11 Tor Lillqvist <tml@novell.com>
+
+ ** Bug #567244
+
+ * filter-option.c (get_dynamic_options): For portability, use
+ <gmodule.h> API instead of <dlfcn.h> API.
+
+2009-01-08 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #567031
+
+ * rule-editor.c: (rule_editor_new): Hide also label of the combo.
+
+2009-01-08 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #339879
+
+ * filter-code.h: (filter_code_new):
+ * filter-code.c: (filter_code_new), (build_code):
+ * rule-context.c: (new_element):
+ Have two types of code expression, one "code", which adds also
+ a "match-all" into the expression, and a "rawcode" without it.
+
+2008-12-15 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #563669
+
+ * filter-int.c: (get_widget):
+ Use zero GtkSpinButton's PageSize, as Gtk+ requires.
+
2008-12-10 Milan Crha <mcrha@redhat.com>
** Part of fix for bug #563870
diff --git a/filter/filter-code.c b/filter/filter-code.c
index 2ca98313b6..1de9c3aba6 100644
--- a/filter/filter-code.c
+++ b/filter/filter-code.c
@@ -98,9 +98,16 @@ filter_code_finalise (GObject *obj)
* Return value: A new #FilterCode object.
**/
FilterCode *
-filter_code_new (void)
+filter_code_new (gboolean raw_code)
{
- return (FilterCode *) g_object_new (FILTER_TYPE_CODE, NULL, NULL);
+ FilterCode *fc = (FilterCode *) g_object_new (FILTER_TYPE_CODE, NULL, NULL);
+
+ if (fc && raw_code) {
+ xmlFree (((FilterInput *) fc)->type);
+ ((FilterInput *) fc)->type = (char *)xmlStrdup ((const unsigned char *)"rawcode");
+ }
+
+ return fc;
}
/* here, the string IS the code */
@@ -109,14 +116,19 @@ build_code (FilterElement *fe, GString *out, struct _FilterPart *ff)
{
GList *l;
FilterInput *fi = (FilterInput *)fe;
+ gboolean is_rawcode = fi && fi->type && g_str_equal (fi->type, "rawcode");
+
+ if (!is_rawcode)
+ g_string_append(out, "(match-all ");
- g_string_append(out, "(match-all ");
l = fi->values;
while (l) {
g_string_append(out, (char *)l->data);
l = g_list_next(l);
}
- g_string_append(out, ")");
+
+ if (!is_rawcode)
+ g_string_append (out, ")");
}
/* and we have no value */
diff --git a/filter/filter-code.h b/filter/filter-code.h
index 3ea5559a2c..7199bcef68 100644
--- a/filter/filter-code.h
+++ b/filter/filter-code.h
@@ -49,7 +49,7 @@ struct _FilterCodeClass {
};
GType filter_code_get_type (void);
-FilterCode *filter_code_new (void);
+FilterCode *filter_code_new (gboolean raw_code);
/* methods */
diff --git a/filter/filter-int.c b/filter/filter-int.c
index 5336884eae..969a477331 100644
--- a/filter/filter-int.c
+++ b/filter/filter-int.c
@@ -241,7 +241,7 @@ get_widget (FilterElement *fe)
GtkObject *adjustment;
FilterInt *fs = (FilterInt *)fe;
- adjustment = gtk_adjustment_new (0.0, (gfloat)fs->min, (gfloat)fs->max, 1.0, 1.0, 1.0);
+ adjustment = gtk_adjustment_new (0.0, (gfloat)fs->min, (gfloat)fs->max, 1.0, 1.0, 0);
spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), fs->max>fs->min+1000?5.0:1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
diff --git a/filter/filter-option.c b/filter/filter-option.c
index 2d79b609c9..7af511b543 100644
--- a/filter/filter-option.c
+++ b/filter/filter-option.c
@@ -29,7 +29,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <dlfcn.h>
+#include <gmodule.h>
#include "filter-option.h"
#include "filter-part.h"
@@ -352,23 +352,22 @@ option_changed (GtkWidget *widget, FilterElement *fe)
static GSList *
get_dynamic_options (FilterOption *fo)
{
- void *module;
+ GModule *module;
GSList *(*get_func)(void);
GSList *res = NULL;
if (!fo || !fo->dynamic_func)
return res;
- module = dlopen (NULL, RTLD_LAZY);
+ module = g_module_open (NULL, G_MODULE_BIND_LAZY);
- get_func = dlsym (module, fo->dynamic_func);
- if (get_func) {
+ if (g_module_symbol (module, fo->dynamic_func, (gpointer) &get_func)) {
res = get_func ();
} else {
g_warning ("optionlist dynamic fill function '%s' not found", fo->dynamic_func);
}
- dlclose (module);
+ g_module_close (module);
return res;
}
diff --git a/filter/rule-context.c b/filter/rule-context.c
index a7f739615b..0a7438b12c 100644
--- a/filter/rule-context.c
+++ b/filter/rule-context.c
@@ -905,7 +905,9 @@ new_element(RuleContext *rc, const char *type)
/* FIXME: temporary ... need real address type */
return (FilterElement *) filter_input_new_type_name (type);
} else if (!strcmp (type, "code")) {
- return (FilterElement *) filter_code_new ();
+ return (FilterElement *) filter_code_new (FALSE);
+ } else if (!strcmp (type, "rawcode")) {
+ return (FilterElement *) filter_code_new (TRUE);
} else if (!strcmp (type, "colour")) {
return (FilterElement *) filter_colour_new ();
} else if (!strcmp (type, "optionlist")) {
diff --git a/filter/rule-editor.c b/filter/rule-editor.c
index 16e79f0ee3..dc4c65a24c 100644
--- a/filter/rule-editor.c
+++ b/filter/rule-editor.c
@@ -175,7 +175,8 @@ rule_editor_new (RuleContext *rc, const char *source, const char *label)
gui = glade_xml_new (filter_glade, "rule_editor", NULL);
g_free (filter_glade);
rule_editor_construct (re, rc, gui, source, label);
- gtk_widget_hide(glade_xml_get_widget (gui, "filter_source"));
+ gtk_widget_hide(glade_xml_get_widget (gui, "label17"));
+ gtk_widget_hide(glade_xml_get_widget (gui, "filter_source"));
g_object_unref (gui);
return re;