[evolution-patches] Evolution patch for 19965 and 43846



--- Begin Message ---
Hi, there,

I made a patch for bug 19965 and 43846.

When delete a folder in folder list, it can remove all linked shortcuts
on all shortcut bars.

Please review it and give your suggestions.

Thanks.
Calvin
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1286.2.10
diff -u -r1.1286.2.10 ChangeLog
--- ChangeLog	30 Sep 2003 09:58:01 -0000	1.1286.2.10
+++ ChangeLog	30 Oct 2003 03:56:24 -0000
@@ -1,3 +1,9 @@
+2003-10-30  Calvin Liu <calvin liu sun com>
+	* e-shell-folder-commands.c
+	update e_shell_command_delete_folder()
+	add remove_shortcuts_from_shortcut_bar()
+	Fix bug #19965 and #43846
+
 2003-09-30  Ismael Olea <ismael olea org>
 
 	* e-shell-about-box.c: fixed encoding for Spanish translators.
Index: e-shell-folder-commands.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-folder-commands.c,v
retrieving revision 1.58.4.1
diff -u -r1.58.4.1 e-shell-folder-commands.c
--- e-shell-folder-commands.c	9 Jul 2003 19:44:53 -0000	1.58.4.1
+++ e-shell-folder-commands.c	30 Oct 2003 03:56:37 -0000
@@ -424,6 +424,35 @@
 }
 
 void
+remove_shortcuts_from_shortcut_bar (EShell *shell,
+				    const char *folder_path)
+{
+	EShortcuts *shortcuts;
+	EShortcutItem *item;
+	const GSList *p,*group;
+	int group_num;
+	int loopGroup;
+	int shortcut_num;
+	int loopShortcut;
+
+	char *uri_of_shortcut;
+
+	uri_of_shortcut = g_strconcat (E_SHELL_URI_PREFIX, folder_path, NULL);
+	shortcuts = e_shell_get_shortcuts (shell);
+	group_num = e_shortcuts_get_num_groups(shortcuts);
+	for ( loopGroup = 0; loopGroup < group_num; loopGroup ++ ){
+	group = e_shortcuts_get_shortcuts_in_group ( shortcuts, loopGroup);
+		shortcut_num = g_slist_length (group);
+		for ( loopShortcut = shortcut_num - 1; loopShortcut >= 0; loopShortcut -- ){
+			item = e_shortcuts_get_shortcut (shortcuts, loopGroup, loopShortcut);
+			if ( 0 == g_strcasecmp ( item->uri, uri_of_shortcut ) ){
+				e_shortcuts_remove_shortcut ( shortcuts, loopGroup, loopShortcut);
+			}
+		}
+	}
+}
+
+void
 e_shell_command_delete_folder (EShell *shell,
 			       EShellView *shell_view,
 			       const char *folder_path)
@@ -441,8 +470,10 @@
 	if (folder_path == NULL)
 		folder_path = e_shell_view_get_current_path (shell_view);
 
-	if (delete_dialog (shell_view, get_folder_name (shell, folder_path)) == GTK_RESPONSE_OK)
+	if (delete_dialog (shell_view, get_folder_name (shell, folder_path)) == GTK_RESPONSE_OK){
+		remove_shortcuts_from_shortcut_bar (shell, folder_path);
 		e_storage_set_async_remove_folder (storage_set, folder_path, delete_cb, shell_view);
+	}
 }
 
 

--- End Message ---


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