aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-09-19 05:12:37 +0800
committerDan Winship <danw@src.gnome.org>2001-09-19 05:12:37 +0800
commite73fea5ecfc8b1840eaff2b3c4d88fa9bd46df87 (patch)
treefb26689f28e86825852605fd9a0affd95a09c472 /mail/folder-browser.c
parent54141f67b759d3533605a06305ead06d1d3ec4f7 (diff)
downloadgsoc2013-evolution-e73fea5ecfc8b1840eaff2b3c4d88fa9bd46df87.tar.gz
gsoc2013-evolution-e73fea5ecfc8b1840eaff2b3c4d88fa9bd46df87.tar.zst
gsoc2013-evolution-e73fea5ecfc8b1840eaff2b3c4d88fa9bd46df87.zip
Merged into folder_browser_new: nothing ever changes the URI of an
* folder-browser.c (folder_browser_set_uri): Merged into folder_browser_new: nothing ever changes the URI of an existing folder browser any more. (folder_browser_new): Make this take a uri argument and do the work folder_browser_set_uri used to do, except that we set fb->uri right away, so that if the folder browser's control is activated before got_folder() gets called, then folder_browser_ui_add_list() will have access to the correct uri for purposes of setting ViewThreaded, etc. Fixes #4913. (got_folder): Don't set fb->uri here since it will already have been set. Don't call message_list_set_threaded, since it should be a noop now (and if it's not, it would make the message list not match the menu item). * folder-browser-ui.c (folder_browser_ui_add_list): Remove some code that was failing to work around the problems above. * message-browser.c (message_browser_new): Pass uri to folder_browser_new, remove call to set_uri. * folder-browser-factory.c (folder_browser_factory_new_control): Likewise. Also fix a s/destroy/unref/ in an error cleanup. svn path=/trunk/; revision=12954
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index cadd95035f..a54451db92 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -687,22 +687,13 @@ got_folder(char *uri, CamelFolder *folder, void *data)
d(printf ("got folder '%s' = %p\n", uri, folder));
- if (fb->folder == folder)
- goto done;
-
- if (fb->folder)
- camel_object_unref (CAMEL_OBJECT (fb->folder));
- g_free (fb->uri);
- fb->uri = g_strdup (uri);
fb->folder = folder;
-
if (folder == NULL)
goto done;
camel_object_ref (CAMEL_OBJECT (folder));
gtk_widget_set_sensitive (GTK_WIDGET (fb->search), camel_folder_has_search_capability (folder));
- message_list_set_threaded (fb->message_list, mail_config_get_thread_list (fb->uri));
message_list_set_folder (fb->message_list, folder,
folder_browser_is_drafts (fb) ||
folder_browser_is_sent (fb) ||
@@ -723,17 +714,6 @@ got_folder(char *uri, CamelFolder *folder, void *data)
gtk_signal_emit (GTK_OBJECT (fb), folder_browser_signals [FOLDER_LOADED], fb->uri);
}
-gboolean
-folder_browser_set_uri (FolderBrowser *folder_browser, const char *uri)
-{
- if (uri && *uri) {
- gtk_object_ref((GtkObject *)folder_browser);
- mail_get_folder(uri, got_folder, folder_browser);
- }
-
- return TRUE;
-}
-
void
folder_browser_set_ui_component (FolderBrowser *fb, BonoboUIComponent *uicomp)
{
@@ -1471,8 +1451,6 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
g_free (uids->pdata[i]);
g_ptr_array_free (uids, TRUE);
-display_menu:
-
/* generate the "Filter on Mailing List menu item name */
if (mailing_list_name == NULL) {
enable_mask |= IS_MAILING_LIST;
@@ -1867,7 +1845,7 @@ my_folder_browser_init (GtkObject *object)
}
GtkWidget *
-folder_browser_new (const GNOME_Evolution_Shell shell)
+folder_browser_new (const GNOME_Evolution_Shell shell, const char *uri)
{
CORBA_Environment ev;
FolderBrowser *folder_browser;
@@ -1877,7 +1855,6 @@ folder_browser_new (const GNOME_Evolution_Shell shell)
folder_browser = gtk_type_new (folder_browser_get_type ());
my_folder_browser_init (GTK_OBJECT (folder_browser));
- folder_browser->uri = NULL;
folder_browser->shell = CORBA_Object_duplicate (shell, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
@@ -1889,6 +1866,10 @@ folder_browser_new (const GNOME_Evolution_Shell shell)
CORBA_exception_free (&ev);
+ folder_browser->uri = g_strdup (uri);
+ gtk_object_ref (GTK_OBJECT (folder_browser));
+ mail_get_folder (folder_browser->uri, got_folder, folder_browser);
+
return GTK_WIDGET (folder_browser);
}