diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-12 12:12:01 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-12 12:12:01 +0800 |
commit | c7d3c9f95609123035ebaa267f9d2e6ecfa8c2e8 (patch) | |
tree | 246bdb714e24e1b0c9a8ce4a3e45a46b230316de /mail/em-filter-folder-element.c | |
parent | f8b33bc4ebe9dd8043674141b5fe4660efaa99e8 (diff) | |
download | gsoc2013-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 'mail/em-filter-folder-element.c')
-rw-r--r-- | mail/em-filter-folder-element.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/mail/em-filter-folder-element.c b/mail/em-filter-folder-element.c index 3f49796650..b4b098b4b6 100644 --- a/mail/em-filter-folder-element.c +++ b/mail/em-filter-folder-element.c @@ -181,7 +181,10 @@ xml_encode(FilterElement *fe) value = xmlNewNode(NULL, (unsigned const char *)"value"); xmlSetProp(value, (unsigned const char *)"name", (unsigned char *)fe->name); - xmlSetProp(value, (unsigned const char *)"type", (unsigned const char *)"folder"); + if (ff->store_camel_uri) + xmlSetProp(value, (unsigned const char *)"type", (unsigned const char *)"folder-curi"); + else + xmlSetProp(value, (unsigned const char *)"type", (unsigned const char *)"folder"); work = xmlNewChild(value, NULL, (unsigned const char *)"folder", NULL); xmlSetProp(work, (unsigned const char *)"uri", (unsigned const char *)ff->uri); @@ -194,12 +197,21 @@ xml_decode(FilterElement *fe, xmlNodePtr node) { EMFilterFolderElement *ff = (EMFilterFolderElement *)fe; xmlNodePtr n; + xmlChar *type; d(printf("Decoding folder from xml %p\n", fe)); xmlFree(fe->name); fe->name = (char *)xmlGetProp(node, (unsigned const char *)"name"); + type = xmlGetProp (node, (unsigned const char *)"type"); + if (type) { + ff->store_camel_uri = g_str_equal ((const char *)type, "folder-curi"); + xmlFree (type); + } else { + ff->store_camel_uri = FALSE; + } + n = node->children; while(n) { if (!strcmp((char *)n->name, "folder")) { @@ -224,7 +236,11 @@ folder_selected(EMFolderSelectionButton *button, EMFilterFolderElement *ff) uri = em_folder_selection_button_get_selection(button); g_free(ff->uri); - ff->uri = uri!=NULL?em_uri_from_camel(uri):NULL; + + if (ff->store_camel_uri) + ff->uri = g_strdup (uri); + else + ff->uri = uri != NULL ? em_uri_from_camel (uri) : NULL; gdk_window_raise(GTK_WIDGET(gtk_widget_get_ancestor(GTK_WIDGET(button), GTK_TYPE_WINDOW))->window); } @@ -237,11 +253,16 @@ get_widget(FilterElement *fe) GtkWidget *button; char *uri; - uri = em_uri_to_camel(ff->uri); + if (ff->store_camel_uri) + uri = ff->uri; + else + uri = em_uri_to_camel (ff->uri); model = e_mail_shell_module_get_folder_tree_model (mail_shell_module); button = em_folder_selection_button_new (model, _("Select Folder"), NULL); em_folder_selection_button_set_selection(EM_FOLDER_SELECTION_BUTTON(button), uri); - g_free(uri); + + if (!ff->store_camel_uri) + g_free(uri); gtk_widget_show(button); g_signal_connect(button, "selected", G_CALLBACK(folder_selected), ff); @@ -266,8 +287,9 @@ format_sexp(FilterElement *fe, GString *out) static void emff_copy_value(FilterElement *de, FilterElement *se) { - if (EM_IS_FILTER_FOLDER_ELEMENT(se)) + if (EM_IS_FILTER_FOLDER_ELEMENT(se)) { + ((EMFilterFolderElement *)de)->store_camel_uri = ((EMFilterFolderElement *)se)->store_camel_uri; em_filter_folder_element_set_value((EMFilterFolderElement *)de, ((EMFilterFolderElement *)se)->uri); - else + } else parent_class->copy_value(de, se); } |