aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--mail/ChangeLog25
-rw-r--r--mail/folder-browser-factory.c9
-rw-r--r--mail/folder-browser-ui.c4
-rw-r--r--mail/folder-browser.c29
-rw-r--r--mail/folder-browser.h6
-rw-r--r--mail/message-browser.c4
6 files changed, 36 insertions, 41 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index a8f7fa1f00..3536b72fdf 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,28 @@
+2001-09-18 Dan Winship <danw@ximian.com>
+
+ * 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.
+
2001-09-18 Jeffrey Stedfast <fejj@ximian.com>
* mail-session.c (get_password): Pass a 'cache-me' argument to
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c
index 568d1cfaf5..a7c45d822d 100644
--- a/mail/folder-browser-factory.c
+++ b/mail/folder-browser-factory.c
@@ -166,23 +166,18 @@ folder_browser_factory_new_control (const char *uri,
BonoboControl *control;
GtkWidget *folder_browser;
- folder_browser = folder_browser_new (shell);
+ folder_browser = folder_browser_new (shell, uri);
if (folder_browser == NULL)
return NULL;
FOLDER_BROWSER (folder_browser)->pref_master = TRUE; /* save UI settings changed in this FB */
- if (!folder_browser_set_uri (FOLDER_BROWSER (folder_browser), uri)) {
- gtk_object_sink (GTK_OBJECT (folder_browser));
- return NULL;
- }
-
gtk_widget_show (folder_browser);
control = bonobo_control_new (folder_browser);
if (control == NULL) {
- gtk_object_destroy (GTK_OBJECT (folder_browser));
+ gtk_object_unref (GTK_OBJECT (folder_browser));
return NULL;
}
diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c
index ca60821ae4..ad2b45f452 100644
--- a/mail/folder-browser-ui.c
+++ b/mail/folder-browser-ui.c
@@ -343,10 +343,8 @@ folder_browser_ui_add_list (FolderBrowser *fb)
/* Threaded toggle */
state = mail_config_get_thread_list (FOLDER_BROWSER (fb)->uri);
- bonobo_ui_component_set_prop (uic, "/commands/ViewThreaded", "state", state ? "1" : "0", NULL);
bonobo_ui_component_add_listener (uic, "ViewThreaded", folder_browser_toggle_threads, fb);
- /* FIXME: this kind of bypasses bonobo but seems the only way when we change components */
- folder_browser_toggle_threads (uic, "", Bonobo_UIComponent_STATE_CHANGED, state ? "1" : "0", fb);
+ bonobo_ui_component_set_prop (uic, "/commands/ViewThreaded", "state", state ? "1" : "0", NULL);
/* Property menu */
folder_browser_setup_property_menu (fb, fb->uicomp);
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);
}
diff --git a/mail/folder-browser.h b/mail/folder-browser.h
index 7f95e324b5..82768f20b8 100644
--- a/mail/folder-browser.h
+++ b/mail/folder-browser.h
@@ -95,14 +95,12 @@ struct fb_ondemand_closure {
};
GtkType folder_browser_get_type (void);
-GtkWidget *folder_browser_new (const GNOME_Evolution_Shell shell);
+GtkWidget *folder_browser_new (const GNOME_Evolution_Shell shell,
+ const char *uri);
void folder_browser_set_ui_component (FolderBrowser *fb,
BonoboUIComponent *uicomp);
-gboolean folder_browser_set_uri (FolderBrowser *folder_browser,
- const char *uri);
-
void folder_browser_set_message_preview (FolderBrowser *folder_browser,
gboolean show_message_preview);
void folder_browser_clear_search (FolderBrowser *fb);
diff --git a/mail/message-browser.c b/mail/message-browser.c
index 87255efefe..6d7ef49398 100644
--- a/mail/message-browser.c
+++ b/mail/message-browser.c
@@ -222,7 +222,7 @@ message_browser_new (const GNOME_Evolution_Shell shell, const char *uri, const c
gtk_object_set_data_full (GTK_OBJECT (new), "uid", g_strdup (uid), g_free);
- fb = FOLDER_BROWSER (folder_browser_new (shell));
+ fb = FOLDER_BROWSER (folder_browser_new (shell, uri));
new->fb = fb;
set_bonobo_ui (GTK_WIDGET (new), fb);
@@ -253,8 +253,6 @@ message_browser_new (const GNOME_Evolution_Shell shell, const char *uri, const c
gtk_signal_connect (GTK_OBJECT (fb), "message_loaded",
message_browser_message_loaded, new);
- folder_browser_set_uri (fb, uri);
-
return GTK_WIDGET (new);
}