diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-04 02:42:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-04 02:42:29 +0800 |
commit | a9c9f0be5fd5aa5667412a7f1fb516d9133874df (patch) | |
tree | 4bbad728c879104495663703512688f423d04b57 /mail | |
parent | 76280e456d8d9789e9a9d2186926fc5607bd8967 (diff) | |
download | gsoc2013-evolution-a9c9f0be5fd5aa5667412a7f1fb516d9133874df.tar.gz gsoc2013-evolution-a9c9f0be5fd5aa5667412a7f1fb516d9133874df.tar.zst gsoc2013-evolution-a9c9f0be5fd5aa5667412a7f1fb516d9133874df.zip |
Remove e_mail_reader_get_folder_uri().
Instead call e_mail_reader_get_folder() and, if you really need to,
generate the folder URI with e_mail_folder_uri_from_folder().
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-notebook-view.c | 35 | ||||
-rw-r--r-- | mail/e-mail-paned-view.c | 17 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 24 | ||||
-rw-r--r-- | mail/e-mail-reader.h | 2 |
4 files changed, 35 insertions, 43 deletions
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index 0a73508cbf..d6e4b4a9aa 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -32,6 +32,7 @@ #include "mail/em-folder-tree.h" #include "e-mail-notebook-view.h" #include "e-mail-folder-pane.h" +#include "e-mail-folder-utils.h" #include "e-mail-message-pane.h" #include <shell/e-shell-window-actions.h> @@ -122,7 +123,7 @@ mnv_page_changed (GtkNotebook *book, EShellSidebar *shell_sidebar; EMFolderTree *folder_tree; EMailView *mview; - const gchar *uri; + CamelFolder *folder; priv = E_MAIL_NOTEBOOK_VIEW (view)->priv; @@ -130,13 +131,18 @@ mnv_page_changed (GtkNotebook *book, shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); page = gtk_notebook_get_nth_page (book, page_num); - uri = e_mail_reader_get_folder_uri (E_MAIL_READER (page)); + folder = e_mail_reader_get_folder (E_MAIL_READER (page)); mview = E_MAIL_VIEW (page); g_object_get (shell_sidebar, "folder-tree", &folder_tree, NULL); - if (uri && E_IS_MAIL_FOLDER_PANE (mview)) - em_folder_tree_set_selected (folder_tree, uri, FALSE); + if (folder != NULL && E_IS_MAIL_FOLDER_PANE (mview)) { + gchar *folder_uri; + + folder_uri = e_mail_folder_uri_from_folder (folder); + em_folder_tree_set_selected (folder_tree, folder_uri, FALSE); + g_free (folder_uri); + } if (mview != priv->current_view) { e_mail_view_set_previous_view (mview, priv->current_view); @@ -261,12 +267,19 @@ mnv_tab_closed_cb (ClutterTimeline *timeline, struct _tab_data *data) { EMailView *page = g_object_get_data ((GObject *)data->tab, "page"); - const gchar *folder_uri = e_mail_reader_get_folder_uri (E_MAIL_READER (page)); EMailView *prev; gint num; - if (E_IS_MAIL_FOLDER_PANE (page)) + if (E_IS_MAIL_FOLDER_PANE (page)) { + CamelFolder *folder; + gchar *folder_uri; + + folder = e_mail_reader_get_folder (E_MAIL_READER (page)); + folder_uri = e_mail_folder_uri_from_folder (folder); g_hash_table_remove (data->view->priv->views, folder_uri); + g_free (folder_uri); + } + prev = e_mail_view_get_previous_view (page); if (prev) { num = emnv_get_page_num (data->view, (GtkWidget *)prev); @@ -332,15 +345,21 @@ tab_remove_gtk_cb (GtkWidget *button, EMailNotebookView *view) { EMailView *page = g_object_get_data ((GObject *)button, "page"); - const gchar *folder_uri = e_mail_reader_get_folder_uri (E_MAIL_READER (page)); EMailView *prev; gint num; if (gtk_notebook_get_n_pages (view->priv->book) == 1) return; - if (E_IS_MAIL_FOLDER_PANE (page)) + if (E_IS_MAIL_FOLDER_PANE (page)) { + CamelFolder *folder; + gchar *folder_uri; + + folder = e_mail_reader_get_folder (E_MAIL_READER (page)); + folder_uri = e_mail_folder_uri_from_folder (folder); g_hash_table_remove (view->priv->views, folder_uri); + g_free (folder_uri); + } prev = e_mail_view_get_previous_view (page); if (prev) { diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index e91050b499..33c8a6e98a 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -44,6 +44,7 @@ #include "mail-config.h" #include "mail-ops.h" #include "message-list.h" +#include "e-mail-folder-utils.h" #include "e-mail-reader-utils.h" #define E_SHELL_WINDOW_ACTION_GROUP_MAIL(window) \ @@ -95,22 +96,25 @@ mail_paned_view_save_boolean (EMailView *view, { EShellView *shell_view; EMailReader *reader; + CamelFolder *folder; GKeyFile *key_file; - const gchar *folder_uri; + gchar *folder_uri; gchar *group_name; shell_view = e_mail_view_get_shell_view (view); key_file = e_shell_view_get_state_key_file (shell_view); reader = E_MAIL_READER (view); - folder_uri = e_mail_reader_get_folder_uri (reader); + folder = e_mail_reader_get_folder (reader); - if (folder_uri == NULL) + if (folder == NULL) return; + folder_uri = e_mail_folder_uri_from_folder (folder); group_name = g_strdup_printf ("Folder %s", folder_uri); g_key_file_set_boolean (key_file, group_name, key, value); g_free (group_name); + g_free (folder_uri); e_shell_view_set_state_dirty (shell_view); } @@ -749,7 +753,6 @@ mail_paned_view_update_view_instance (EMailView *view) GtkOrientation orientation; gboolean outgoing_folder; gboolean show_vertical_view; - const gchar *folder_uri; gchar *view_id; priv = E_MAIL_PANED_VIEW (view)->priv; @@ -764,21 +767,17 @@ mail_paned_view_update_view_instance (EMailView *view) reader = E_MAIL_READER (view); folder = e_mail_reader_get_folder (reader); - folder_uri = e_mail_reader_get_folder_uri (reader); /* If no folder is selected, return silently. */ if (folder == NULL) return; - /* If we have a folder, we should also have a URI. */ - g_return_if_fail (folder_uri != NULL); - if (priv->view_instance != NULL) { g_object_unref (priv->view_instance); priv->view_instance = NULL; } - view_id = g_strdup (folder_uri); + view_id = e_mail_folder_uri_from_folder (folder); e_filename_make_safe (view_id); outgoing_folder = diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 21d5341de2..808deda0fd 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -2869,16 +2869,6 @@ mail_reader_get_folder (EMailReader *reader) return MESSAGE_LIST (message_list)->folder; } -static const gchar * -mail_reader_get_folder_uri (EMailReader *reader) -{ - GtkWidget *message_list; - - message_list = e_mail_reader_get_message_list (reader); - - return MESSAGE_LIST (message_list)->folder_uri; -} - static gboolean mail_reader_get_enable_show_folder (EMailReader *reader) { @@ -3386,7 +3376,6 @@ e_mail_reader_default_init (EMailReaderInterface *interface) interface->get_selected_uids = mail_reader_get_selected_uids; interface->get_folder = mail_reader_get_folder; - interface->get_folder_uri = mail_reader_get_folder_uri; interface->enable_show_folder = mail_reader_get_enable_show_folder; interface->set_folder = mail_reader_set_folder; interface->set_message = mail_reader_set_message; @@ -4081,19 +4070,6 @@ e_mail_reader_get_folder (EMailReader *reader) return interface->get_folder (reader); } -const gchar * -e_mail_reader_get_folder_uri (EMailReader *reader) -{ - EMailReaderInterface *interface; - - g_return_val_if_fail (E_IS_MAIL_READER (reader), NULL); - - interface = E_MAIL_READER_GET_INTERFACE (reader); - g_return_val_if_fail (interface->get_folder_uri != NULL, NULL); - - return interface->get_folder_uri (reader); -} - void e_mail_reader_set_folder (EMailReader *reader, CamelFolder *folder) diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h index d6a7597a54..9c5da8fcd8 100644 --- a/mail/e-mail-reader.h +++ b/mail/e-mail-reader.h @@ -96,7 +96,6 @@ struct _EMailReaderInterface { GtkWindow * (*get_window) (EMailReader *reader); CamelFolder * (*get_folder) (EMailReader *reader); - const gchar * (*get_folder_uri) (EMailReader *reader); void (*set_folder) (EMailReader *reader, CamelFolder *folder); void (*set_message) (EMailReader *reader, @@ -133,7 +132,6 @@ GtkMenu * e_mail_reader_get_popup_menu (EMailReader *reader); GPtrArray * e_mail_reader_get_selected_uids (EMailReader *reader); GtkWindow * e_mail_reader_get_window (EMailReader *reader); CamelFolder * e_mail_reader_get_folder (EMailReader *reader); -const gchar * e_mail_reader_get_folder_uri (EMailReader *reader); void e_mail_reader_set_folder (EMailReader *reader, CamelFolder *folder); void e_mail_reader_set_message (EMailReader *reader, |