evolution/evolution-2.11.90-enable-folder-tree.patch
2007-08-18 07:29:43 +00:00

49 lines
1.6 KiB
Diff

--- evolution-2.11.90/mail/mail-component.c.enable-folder-tree 2007-08-18 02:21:45.000000000 -0400
+++ evolution-2.11.90/mail/mail-component.c 2007-08-18 02:23:54.000000000 -0400
@@ -652,30 +652,33 @@ enable_folder_tree (GtkWidget *emfb, Gtk
{
char *uri;
CamelURL *selected_curl, *current_curl;
- CamelFolder *folder;
- CamelException ex;
EMFolderView *emfv = (EMFolderView *)emfb;
/* Currently displayed folder */
- MessageList *ml = emfv->list;
- folder = ml->folder;
- uri = mail_tools_folder_to_url (folder);
- current_curl = camel_url_new (uri, NULL);
+ uri = mail_tools_folder_to_url (emfv->list->folder);
+ current_curl = uri ? camel_url_new (uri, NULL) : NULL;
+ g_free (uri);
- /* Selected folder in emft*/
+ /* Selected folder in emft */
uri = em_folder_tree_get_selected_uri ((EMFolderTree *) emft);
- folder = mail_tool_uri_to_folder (uri, 0, &ex);
- selected_curl = camel_url_new (uri, NULL);
+ selected_curl = uri ? camel_url_new (uri, NULL) : NULL;
- if (!camel_url_equal (selected_curl, current_curl))
- g_signal_emit_by_name (emft, "folder-selected", emft, uri, folder->full_name, uri, folder->folder_flags);
+ if (current_curl && selected_curl && !camel_url_equal (selected_curl, current_curl)) {
+ CamelFolder *folder;
+ CamelException ex;
+
+ camel_exception_init (&ex);
+ folder = mail_tool_uri_to_folder (uri, 0, &ex);
+ g_signal_emit_by_name (
+ emft, "folder-selected", emft, uri,
+ folder->full_name, uri, folder->folder_flags);
+ }
gtk_widget_set_sensitive (emft, TRUE);
camel_url_free (current_curl);
camel_url_free (selected_curl);
g_free (uri);
-
}
/* Evolution::Component CORBA methods. */