aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-06 04:20:37 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-06 04:21:56 +0800
commited94c3461ea6a4df6dc0bd8eba31952650690e4d (patch)
tree60b7369bb231c696084eab3bb91bd260d4316ab5
parent575f27afecf4d16b7badd20856cddd2c56790b91 (diff)
downloadgsoc2013-evolution-ed94c3461ea6a4df6dc0bd8eba31952650690e4d.tar
gsoc2013-evolution-ed94c3461ea6a4df6dc0bd8eba31952650690e4d.tar.gz
gsoc2013-evolution-ed94c3461ea6a4df6dc0bd8eba31952650690e4d.tar.bz2
gsoc2013-evolution-ed94c3461ea6a4df6dc0bd8eba31952650690e4d.tar.lz
gsoc2013-evolution-ed94c3461ea6a4df6dc0bd8eba31952650690e4d.tar.xz
gsoc2013-evolution-ed94c3461ea6a4df6dc0bd8eba31952650690e4d.tar.zst
gsoc2013-evolution-ed94c3461ea6a4df6dc0bd8eba31952650690e4d.zip
EMFilterFolderElement: Use the new folder URI format.
No longer need to distinguish between Camel URIs and Evolution URIs.
-rw-r--r--mail/em-filter-folder-element.c36
-rw-r--r--mail/em-filter-folder-element.h4
-rw-r--r--mail/em-vfolder-context.c13
3 files changed, 8 insertions, 45 deletions
diff --git a/mail/em-filter-folder-element.c b/mail/em-filter-folder-element.c
index 76828f7bb5..4a5d3595aa 100644
--- a/mail/em-filter-folder-element.c
+++ b/mail/em-filter-folder-element.c
@@ -256,10 +256,7 @@ xml_encode (EFilterElement *fe)
value = xmlNewNode(NULL, (xmlChar *) "value");
xmlSetProp(value, (xmlChar *) "name", (xmlChar *) fe->name);
- if (ff->store_camel_uri)
- xmlSetProp(value, (xmlChar *) "type", (xmlChar *) "folder-curi");
- else
- xmlSetProp(value, (xmlChar *) "type", (xmlChar *) "folder");
+ xmlSetProp(value, (xmlChar *) "type", (xmlChar *) "folder");
work = xmlNewChild(value, NULL, (xmlChar *) "folder", NULL);
xmlSetProp(work, (xmlChar *) "uri", (xmlChar *) ff->priv->uri);
@@ -272,19 +269,10 @@ xml_decode (EFilterElement *fe, xmlNodePtr node)
{
EMFilterFolderElement *ff = (EMFilterFolderElement *) fe;
xmlNodePtr n;
- xmlChar *type;
xmlFree (fe->name);
fe->name = (gchar *) xmlGetProp(node, (xmlChar *) "name");
- type = xmlGetProp (node, (xmlChar *) "type");
- if (type) {
- ff->store_camel_uri = g_str_equal ((const gchar *) type, "folder-curi");
- xmlFree (type);
- } else {
- ff->store_camel_uri = FALSE;
- }
-
n = node->children;
while (n) {
if (!strcmp((gchar *) n->name, "folder")) {
@@ -310,12 +298,9 @@ folder_selected (EMFolderSelectionButton *button,
const gchar *uri;
uri = em_folder_selection_button_get_selection (button);
- g_free (ff->priv->uri);
- if (ff->store_camel_uri)
- ff->priv->uri = g_strdup (uri);
- else
- ff->priv->uri = uri != NULL ? em_uri_from_camel (uri) : NULL;
+ g_free (ff->priv->uri);
+ ff->priv->uri = g_strdup (uri);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
gtk_window_present (GTK_WINDOW (toplevel));
@@ -327,24 +312,13 @@ get_widget (EFilterElement *fe)
EMFilterFolderElement *ff = (EMFilterFolderElement *) fe;
EMailSession *session;
GtkWidget *button;
- gchar *uri;
session = em_filter_folder_element_get_session (ff);
- if (ff->store_camel_uri)
- uri = ff->priv->uri;
- else
- uri = em_uri_to_camel (ff->priv->uri);
-
button = em_folder_selection_button_new (
session, _("Select Folder"), NULL);
-
em_folder_selection_button_set_selection (
- EM_FOLDER_SELECTION_BUTTON (button), uri);
-
- if (!ff->store_camel_uri)
- g_free (uri);
-
+ EM_FOLDER_SELECTION_BUTTON (button), ff->priv->uri);
gtk_widget_show (button);
g_signal_connect (
@@ -372,8 +346,6 @@ static void
emff_copy_value (EFilterElement *de, EFilterElement *se)
{
if (EM_IS_FILTER_FOLDER_ELEMENT (se)) {
- ((EMFilterFolderElement *) de)->store_camel_uri =
- ((EMFilterFolderElement *) se)->store_camel_uri;
em_filter_folder_element_set_uri (
EM_FILTER_FOLDER_ELEMENT (de),
EM_FILTER_FOLDER_ELEMENT (se)->priv->uri);
diff --git a/mail/em-filter-folder-element.h b/mail/em-filter-folder-element.h
index 95061be5a6..f71b4c128b 100644
--- a/mail/em-filter-folder-element.h
+++ b/mail/em-filter-folder-element.h
@@ -56,10 +56,6 @@ typedef struct _EMFilterFolderElementPrivate EMFilterFolderElementPrivate;
struct _EMFilterFolderElement {
EFilterElement parent;
EMFilterFolderElementPrivate *priv;
-
- /* TRUE if 'uri' should contain Camel URI, otherwise
- * contains Evolution's URI with an Account ID. */
- gboolean store_camel_uri;
};
struct _EMFilterFolderElementClass {
diff --git a/mail/em-vfolder-context.c b/mail/em-vfolder-context.c
index 5f78da434a..ebad8f2bac 100644
--- a/mail/em-vfolder-context.c
+++ b/mail/em-vfolder-context.c
@@ -124,18 +124,13 @@ vfolder_context_new_element (ERuleContext *context,
if (strcmp (type, "score") == 0)
return e_filter_int_new_type("score", -3, 3);
- if (strcmp (type, "folder-curi") == 0) {
- EFilterElement *element;
-
- element = em_filter_folder_element_new (priv->session);
- ((EMFilterFolderElement *) element)->store_camel_uri = TRUE;
-
- return element;
- }
-
if (strcmp (type, "folder") == 0)
return em_filter_folder_element_new (priv->session);
+ /* XXX Legacy type name. Same as "folder" now. */
+ if (strcmp (type, "folder-curi") == 0)
+ return em_filter_folder_element_new (priv->session);
+
return E_RULE_CONTEXT_CLASS (em_vfolder_context_parent_class)->
new_element (context, type);
}