aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-07-26 23:15:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-27 00:26:55 +0800
commit36b9debed099b1ad0b5d6a8af792f620bf7f124a (patch)
tree797f5587b1a6503ca0751c0243989a21eafab700 /modules/mail
parent9279429501af7858716b0e317810a264192bb763 (diff)
downloadgsoc2013-evolution-36b9debed099b1ad0b5d6a8af792f620bf7f124a.tar.gz
gsoc2013-evolution-36b9debed099b1ad0b5d6a8af792f620bf7f124a.tar.zst
gsoc2013-evolution-36b9debed099b1ad0b5d6a8af792f620bf7f124a.zip
More code cleanup.
Diffstat (limited to 'modules/mail')
-rw-r--r--modules/mail/e-mail-shell-content.c42
-rw-r--r--modules/mail/e-mail-shell-view-private.c8
-rw-r--r--modules/mail/evolution-module-mail.c5
3 files changed, 34 insertions, 21 deletions
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 6e5168c8a4..7a410bac55 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -89,12 +89,15 @@ reconnect_folder_loaded_event (EMailReader *child, EMailReader *parent)
}
static void
-msc_view_changed (EMailView *view, EMailShellContent *content)
+mail_shell_content_view_changed_cb (EMailView *view,
+ EMailShellContent *content)
{
+ g_object_freeze_notify (G_OBJECT (content));
g_object_notify (G_OBJECT (content), "group-by-threads");
g_object_notify (G_OBJECT (content), "show-deleted");
g_object_notify (G_OBJECT (content), "preview-visible");
g_object_notify (G_OBJECT (content), "orientation");
+ g_object_thaw_notify (G_OBJECT (content));
}
static void
@@ -123,19 +126,24 @@ mail_shell_content_constructed (GObject *object)
container = GTK_WIDGET (object);
if (e_shell_get_express_mode(e_shell_get_default ())) {
- widget = e_mail_notebook_view_new (E_SHELL_CONTENT(object));
- g_signal_connect (widget, "view-changed", G_CALLBACK(msc_view_changed), object);
+ widget = e_mail_notebook_view_new (shell_view);
+ g_signal_connect (
+ widget, "view-changed",
+ G_CALLBACK (mail_shell_content_view_changed_cb),
+ object);
} else
- widget = e_mail_paned_view_new (E_SHELL_CONTENT(object));
+ widget = e_mail_paned_view_new (shell_view);
+
E_MAIL_SHELL_CONTENT(object)->view = (EMailView *)widget;
gtk_container_add (GTK_CONTAINER (container), widget);
gtk_widget_show (widget);
- g_signal_connect ( E_MAIL_READER(widget), "changed",
- G_CALLBACK (reconnect_changed_event),
- object);
- g_signal_connect ( E_MAIL_READER (widget), "folder-loaded",
- G_CALLBACK (reconnect_folder_loaded_event),
- object);
+
+ g_signal_connect (
+ widget, "changed",
+ G_CALLBACK (reconnect_changed_event), object);
+ g_signal_connect (
+ widget, "folder-loaded",
+ G_CALLBACK (reconnect_folder_loaded_event), object);
}
@@ -422,7 +430,6 @@ e_mail_shell_content_register_type (GTypeModule *type_module)
g_type_module_add_interface (
type_module, mail_shell_content_type,
GTK_TYPE_ORIENTABLE, &orientable_info);
-
}
GtkWidget *
@@ -438,7 +445,18 @@ e_mail_shell_content_new (EShellView *shell_view)
EShellSearchbar *
e_mail_shell_content_get_searchbar (EMailShellContent *mail_shell_content)
{
- return e_mail_view_get_searchbar (mail_shell_content->view);
+ GtkWidget *searchbar;
+ EShellView *shell_view;
+ EShellContent *shell_content;
+
+ g_return_val_if_fail (
+ E_IS_MAIL_SHELL_CONTENT (mail_shell_content), NULL);
+
+ shell_content = E_SHELL_CONTENT (mail_shell_content);
+ shell_view = e_shell_content_get_shell_view (shell_content);
+ searchbar = e_shell_view_get_searchbar (shell_view);
+
+ return E_SHELL_SEARCHBAR (searchbar);
}
void
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index 75a272ec73..d11322899d 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -319,11 +319,11 @@ mail_shell_view_reader_changed_cb (EMailShellView *mail_shell_view,
e_mail_shell_view_update_sidebar (mail_shell_view);
/* Connect if its not connected already */
- if (g_signal_handler_find (message_list, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL,
- mail_shell_view_message_list_key_press_cb,
- NULL))
+ if (g_signal_handler_find (
+ message_list, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
+ mail_shell_view_message_list_key_press_cb, NULL))
return;
+
g_signal_connect_swapped (
message_list, "key-press",
G_CALLBACK (mail_shell_view_message_list_key_press_cb),
diff --git a/modules/mail/evolution-module-mail.c b/modules/mail/evolution-module-mail.c
index cc4e8f41aa..9e9744569b 100644
--- a/modules/mail/evolution-module-mail.c
+++ b/modules/mail/evolution-module-mail.c
@@ -33,9 +33,6 @@
#include "e-mail-config-format-html.h"
#include "e-mail-config-web-view.h"
-#include "mail/e-mail-paned-view.h"
-#include "mail/e-mail-notebook-view.h"
-
/* Module Entry Points */
void e_module_load (GTypeModule *type_module);
void e_module_unload (GTypeModule *type_module);
@@ -54,8 +51,6 @@ e_module_load (GTypeModule *type_module)
e_mail_shell_backend_register_type (type_module);
e_mail_shell_content_register_type (type_module);
- e_mail_paned_view_register_type (type_module);
- e_mail_notebook_view_register_type (type_module);
e_mail_shell_sidebar_register_type (type_module);
e_mail_shell_view_register_type (type_module);