diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-03-05 05:07:00 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-03-05 05:07:00 +0800 |
commit | 018866693e09f835b137b25f255d795f69d4a50e (patch) | |
tree | 1f6067064c09729fbbbc723d5060d9e469df6ce3 /mail | |
parent | 7a0455fc2b247575cb6fe7199a7494fa812503c4 (diff) | |
download | gsoc2013-evolution-018866693e09f835b137b25f255d795f69d4a50e.tar.gz gsoc2013-evolution-018866693e09f835b137b25f255d795f69d4a50e.tar.zst gsoc2013-evolution-018866693e09f835b137b25f255d795f69d4a50e.zip |
If event == NULL, don't try to use event->key.time
2004-03-04 Jeffrey Stedfast <fejj@ximian.com>
* em-folder-view.c (emfv_popup): If event == NULL, don't try to
use event->key.time
* em-migrate.c (upgrade_vfolder_sources_1_4): New function to
upgrade vfolder sources.
(em_upgrade_xml_1_4): If the doc is vfolders.xml, upgrade the
sources nodes.
svn path=/trunk/; revision=24971
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 10 | ||||
-rw-r--r-- | mail/em-folder-view.c | 4 | ||||
-rw-r--r-- | mail/em-migrate.c | 49 |
3 files changed, 58 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 34d3fc8963..82ce46656b 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2004-03-04 Jeffrey Stedfast <fejj@ximian.com> + + * em-folder-view.c (emfv_popup): If event == NULL, don't try to + use event->key.time + + * em-migrate.c (upgrade_vfolder_sources_1_4): New function to + upgrade vfolder sources. + (em_upgrade_xml_1_4): If the doc is vfolders.xml, upgrade the + sources nodes. + 2004-03-03 Not Zed <NotZed@Ximian.com> ** See bug #53738. diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index d7da84caff..8d25f92942 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -884,9 +884,9 @@ emfv_popup(EMFolderView *emfv, GdkEvent *event) menu = em_popup_create_menu_once(emp, target, target->mask, target->mask); - if (event == NULL || event->type == GDK_KEY_PRESS) { + if (event == NULL || event->type == GDK_KEY_PRESS) { /* FIXME: menu pos function */ - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, event->key.time); + gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, event ? event->key.time : time (NULL)); } else { gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time); } diff --git a/mail/em-migrate.c b/mail/em-migrate.c index 8096e2ef99..19d44387d7 100644 --- a/mail/em-migrate.c +++ b/mail/em-migrate.c @@ -1737,9 +1737,52 @@ upgrade_xml_uris_1_4 (const char *uri) } } +static void +upgrade_vfolder_sources_1_4 (xmlDocPtr doc) +{ + xmlNodePtr root, node; + + if (!doc || !(root = xmlDocGetRootElement (doc))) + return; + + if (!root->name || strcmp (root->name, "filteroptions") != 0) { + /* root node is not <filteroptions>, nothing to upgrade */ + return; + } + + if (!(node = xml_find_node (root, "ruleset"))) { + /* no ruleset node, nothing to upgrade */ + return; + } + + node = node->children; + while (node != NULL) { + if (node->name && !strcmp (node->name, "rule")) { + xmlNodePtr sources; + char *src; + + if (!(src = xmlGetProp (node, "source"))) + src = xmlStrdup ("local"); /* default to all local folders? */ + + xmlSetProp (node, "source", "incoming"); + + if (!(sources = xml_find_node (node, "sources"))) + sources = xmlNewChild (node, NULL, "sources", NULL); + + xmlSetProp (sources, "with", src); + xmlFree (src); + } + + node = node->next; + } +} + static int -em_upgrade_xml_1_4 (xmlDocPtr doc) +em_upgrade_xml_1_4 (xmlDocPtr doc, gboolean vfolders_xml) { + if (vfolders_xml) + upgrade_vfolder_sources_1_4 (doc); + return upgrade_xml_uris (doc, upgrade_xml_uris_1_4); } @@ -2157,10 +2200,10 @@ em_migrate_1_4 (const char *evolution_dir, xmlDocPtr filters, xmlDocPtr vfolders if (em_upgrade_accounts_1_4 () == -1) return -1; - if (em_upgrade_xml_1_4 (filters) == -1) + if (em_upgrade_xml_1_4 (filters, FALSE) == -1) return -1; - if (em_upgrade_xml_1_4 (vfolders) == -1) + if (em_upgrade_xml_1_4 (vfolders, TRUE) == -1) return -1; path = g_build_filename (g_get_home_dir (), "evolution", "searches.xml", NULL); |