evolution r36995 - branches/gnome-2-24/mail
- From: sragavan svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36995 - branches/gnome-2-24/mail
- Date: Tue, 6 Jan 2009 05:02:46 +0000 (UTC)
Author: sragavan
Date: Tue Jan 6 05:02:45 2009
New Revision: 36995
URL: http://svn.gnome.org/viewvc/evolution?rev=36995&view=rev
Log:
2009-01-06 Srinivasa Ragavan <sragavan novell com>
** Fix for bug #546637
* em-folder-tree.c: (emft_popup_uvfolder), (emft_popup): Hack for
unread vfolder to work better. This is just for now, not for ever.
Modified:
branches/gnome-2-24/mail/ChangeLog
branches/gnome-2-24/mail/em-folder-tree.c
Modified: branches/gnome-2-24/mail/em-folder-tree.c
==============================================================================
--- branches/gnome-2-24/mail/em-folder-tree.c (original)
+++ branches/gnome-2-24/mail/em-folder-tree.c Tue Jan 6 05:02:45 2009
@@ -2094,6 +2094,23 @@
g_free (uri);
}
+static void
+emft_popup_uvfolder (EPopup *ep, EPopupItem *pitem, void *data)
+{
+ EMFolderTree *emft = data;
+ CamelFolder *folder;
+ char *meta = camel_object_meta_get(folder, "vfolder:unread");
+
+ if ((folder = em_folder_tree_get_selected_folder (emft)) != NULL) {
+ if (!meta || strcmp(meta, "false") == 0)
+ camel_object_meta_set(folder, "vfolder:unread", "true");
+ else
+ camel_object_meta_set(folder, "vfolder:unread", "false");
+ }
+ camel_object_state_write (folder);
+ g_free (meta);
+}
+
static EPopupItem emft_popup_items[] = {
#if 0
{ E_POPUP_ITEM, "00.emc.00", N_("_View"), emft_popup_view, NULL, NULL, EM_POPUP_FOLDER_SELECT },
@@ -2211,6 +2228,25 @@
if ((folder_type_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_TRASH)
menus = g_slist_prepend (menus, &trash_popup_item);
+ if (!isstore && strstr(uri, "vfolder")) {
+ /* This is a vfolder, so lets add hacked up menu item. */
+ static EPopupItem *item = NULL;
+ char *meta = camel_object_meta_get (selfolder, "vfolder:unread");
+
+ if (!item)
+ item = g_malloc0(sizeof(*item));
+ if (meta && (strcmp (meta, "true") == 0))
+ item->type = E_POPUP_TOGGLE | E_POPUP_ACTIVE;
+ else
+ item->type = E_POPUP_TOGGLE & ~E_POPUP_ACTIVE;
+ item->path = "99.emc.99";
+ item->label = _("_Unread Search Folder");
+ item->activate = emft_popup_uvfolder;
+ item->visible = EM_POPUP_FOLDER_SELECT;
+ item->user_data = NULL;
+ menus = g_slist_prepend (menus, item);
+ g_free (meta);
+ }
e_popup_add_items ((EPopup *)emp, menus, NULL, emft_popup_free, emft);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]