aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-08-20 22:56:27 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-08-20 22:56:27 +0800
commitdcd1c6ecdc35fbe1b3e1918261b358b77afb20e5 (patch)
tree694ac51c5088b4269a5b15839eaaefd88f7a917b /mail
parentde73ad44045a26fc41c3434488feb0dd9d981b0a (diff)
downloadgsoc2013-evolution-dcd1c6ecdc35fbe1b3e1918261b358b77afb20e5.tar
gsoc2013-evolution-dcd1c6ecdc35fbe1b3e1918261b358b77afb20e5.tar.gz
gsoc2013-evolution-dcd1c6ecdc35fbe1b3e1918261b358b77afb20e5.tar.bz2
gsoc2013-evolution-dcd1c6ecdc35fbe1b3e1918261b358b77afb20e5.tar.lz
gsoc2013-evolution-dcd1c6ecdc35fbe1b3e1918261b358b77afb20e5.tar.xz
gsoc2013-evolution-dcd1c6ecdc35fbe1b3e1918261b358b77afb20e5.tar.zst
gsoc2013-evolution-dcd1c6ecdc35fbe1b3e1918261b358b77afb20e5.zip
Alternate fix for bug #467599 (also bug #467883).
2007-08-20 Matthew Barnes <mbarnes@redhat.com> * mail/mail-component.c (enable_folder_tree): Alternate fix for bug #467599 (also bug #467883). svn path=/trunk/; revision=34047
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-component.c37
2 files changed, 22 insertions, 20 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 98c1945e99..c58306e0e1 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-20 Matthew Barnes <mbarnes@redhat.com>
+
+ * mail-component.c (enable_folder_tree):
+ Alternate fix for bug #467599 (also bug #467883).
+
2007-08-20 Tobias Mueller <tobiasmue@svn.gnome.org>
** Fix for bug #467382
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 938a720fe3..79d5350fc8 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -501,7 +501,6 @@ view_on_url (GObject *emitter, const char *url, const char *nice_url, MailCompon
static void
view_changed(EMFolderView *emfv, EComponentView *component_view)
{
- MailComponent *mc = mail_component_peek ();
EInfoLabel *el = g_object_get_data((GObject *)component_view, "info-label");
CORBA_Environment ev;
@@ -650,39 +649,37 @@ disable_folder_tree (gpointer *emfb, GtkWidget *widget)
static void
enable_folder_tree (GtkWidget *emfb, GtkWidget *emft)
{
- char *uri;
+ EMFolderView *emfv = (EMFolderView *) emfb;
CamelURL *selected_curl, *current_curl;
- CamelFolder *folder;
- CamelException ex;
- EMFolderView *emfv = (EMFolderView *)emfb;
+ gchar *uri;
- /* current_curl - Currently displayed folder (can be the account_search_vfolder) */
- MessageList *ml = emfv->list;
- folder = ml->folder;
- uri = mail_tools_folder_to_url (folder);
- current_curl = camel_url_new (uri, NULL);
+ /* Get the currently displayed folder. */
+ uri = mail_tools_folder_to_url (emfv->list->folder);
+ current_curl = uri ? camel_url_new (uri, NULL) : NULL;
g_free (uri);
- /* selected_curl - Folder that is/was selected in the folder tree */
- uri = em_folder_tree_get_selected_uri ((EMFolderTree *) emft);
+ /* Get the selected folder in the folder tree. */
+ uri = em_folder_tree_get_selected_uri (EM_FOLDER_TREE (emft));
+ selected_curl = uri ? camel_url_new (uri, NULL) : NULL;
+
+ if (current_curl && selected_curl && !camel_url_equal (selected_curl, current_curl)) {
+ CamelFolder *folder;
+ CamelException ex;
- /* if no folder is selected, skip this section */
- if (uri && *uri) {
camel_exception_init (&ex);
folder = mail_tool_uri_to_folder (uri, 0, &ex);
- selected_curl = camel_url_new (uri, NULL);
camel_exception_clear (&ex);
- 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);
-
- camel_url_free (selected_curl);
- g_free (uri);
+ 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. */