Re: [evolution-patches] Patch for bug#208647 with attachment



Hope this looks good.Since the info_flags holds good for both vtrash and vjunk i had to compare the full_name and not the folder name with CAMEL_VTRASH_NAME.

On 8/5/05, Not Zed <notzed ximian com> wrote:

This is extremely messy.  If you want to add another menu item, define
it separetely.

Apart from that, you can't base the vtrash test on the folder name.
Base it on the folder type from the folderinfo.


On Fri, 2005-08-05 at 19:30 +0530, Antony Vincent Pandian wrote:
>
> -       for (i = 0; i < sizeof (emft_popup_items) / sizeof
> (emft_popup_items[0]); i++)
> -               menus = g_slist_prepend (menus, &emft_popup_items[i]);
> +       for (i = 0; i < sizeof (emft_popup_items) / sizeof
> (emft_popup_items[0]); i++){
> +       /* 6 is the position where empty trash menu item will be
> inserted */
> +               if (i != 6 ||  !g_strcasecmp (full_name,
> CAMEL_VTRASH_NAME))
> +                       menus = g_slist_prepend (menus,
> &emft_popup_items[i]);
> +       }
--
adfa(evolution-2.4:20087): gtkhtml-WARNING **: cannot find icon:
'stock_insert-url' in gnome




--
Luv,
S.Antony Vincent Pandian
--- /home/evolution/Antony/empty_trash_bug/em-folder-tree.c	2005-08-04 00:27:50.000000000 +0530
+++ em-folder-tree.c	2005-08-09 20:41:02.000000000 +0530
@@ -2081,6 +2081,12 @@ emft_popup_rename_folder (EPopup *ep, EP
 }
 
 static void
+emft_popup_empty_trash (EPopup *ep, EPopupItem *pitem, void *data)
+{
+	em_utils_empty_trash (data);
+}
+
+static void
 emft_popup_properties (EPopup *ep, EPopupItem *pitem, void *data)
 {
 	EMFolderTree *emft = data;
@@ -2119,6 +2125,7 @@ static EPopupItem emft_popup_items[] = {
 	{ E_POPUP_BAR, "80.emc" },
 	{ E_POPUP_ITEM, "80.emc.00", N_("_Properties"), emft_popup_properties, NULL, "stock_folder-properties", 0, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT }
 };
+static EPopupItem trash_popup_item = {E_POPUP_ITEM, "20.emc.03", N_("_Empty Trash"), emft_popup_empty_trash,NULL,NULL, 1, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT};
 
 static void
 emft_popup_free(EPopup *ep, GSList *items, void *data)
@@ -2196,6 +2203,9 @@ emft_popup (EMFolderTree *emft, GdkEvent
 	
 	for (i = 0; i < sizeof (emft_popup_items) / sizeof (emft_popup_items[0]); i++)
 		menus = g_slist_prepend (menus, &emft_popup_items[i]);
+
+	if (!strcmp (full_name, CAMEL_VTRASH_NAME))
+		menus = g_slist_prepend (menus, &trash_popup_item);
 	
 	e_popup_add_items ((EPopup *)emp, menus, NULL, emft_popup_free, emft);
 
--- /home/evolution/Antony/empty_trash_bug/ChangeLog	2005-08-05 18:34:26.000000000 +0530
+++ ChangeLog	2005-08-05 18:38:30.000000000 +0530
@@ -1,3 +1,9 @@
+2005-08-05  S.Antony Vincent Pandian <santony gmail com>
+
+	* em-folder-tree.c : Fix #208647. Have added a menu item 
+	Empty Trash in the folder tree's right click popup and its
+	callback.
+
 2005-07-29  Shreyas Srinivasan  <sshreyas novell com>
 
 	* mail-ops.c: Fix #311223. Include <camel/camel-multipart.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]