diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-07-26 12:30:38 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-07-26 13:16:42 +0800 |
commit | 81e5428a59194dd38cf2a07b2d3f9b4b6f81f6ef (patch) | |
tree | 0211046a4e44ba2a0e82b1c1ce8f9a903552f979 /mail/e-mail-folder-pane.c | |
parent | 13cf1d104bbacffaf09393678c12a7efadd53139 (diff) | |
download | gsoc2013-evolution-81e5428a59194dd38cf2a07b2d3f9b4b6f81f6ef.tar.gz gsoc2013-evolution-81e5428a59194dd38cf2a07b2d3f9b4b6f81f6ef.tar.zst gsoc2013-evolution-81e5428a59194dd38cf2a07b2d3f9b4b6f81f6ef.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'mail/e-mail-folder-pane.c')
-rw-r--r-- | mail/e-mail-folder-pane.c | 117 |
1 files changed, 32 insertions, 85 deletions
diff --git a/mail/e-mail-folder-pane.c b/mail/e-mail-folder-pane.c index e8857ae785..3d9dfc2ea9 100644 --- a/mail/e-mail-folder-pane.c +++ b/mail/e-mail-folder-pane.c @@ -46,46 +46,24 @@ ((obj), E_TYPE_MAIL_FOLDER_PANE, EMailFolderPanePrivate)) struct _EMailFolderPanePrivate { - int fo; + gint placeholder; }; enum { PROP_0, - PROP_PREVIEW_VISIBLE, + PROP_PREVIEW_VISIBLE }; -static gpointer parent_class; - +G_DEFINE_TYPE (EMailFolderPane, e_mail_folder_pane, E_TYPE_MAIL_PANED_VIEW) static void -mail_folder_pane_dispose (GObject *object) +folder_pane_set_preview_visible (EMailView *view, + gboolean preview_visible) { - EMailFolderPanePrivate *priv; - - priv = E_MAIL_FOLDER_PANE_GET_PRIVATE (object); - - /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); -} - -static void -mail_folder_pane_constructed (GObject *object) -{ - /* Chain up to parent's constructed() method. */ - if (G_OBJECT_CLASS (parent_class)->constructed) - G_OBJECT_CLASS (parent_class)->constructed (object); - -} - -static void -folder_pane_set_preview_visible (EMailPanedView *view, - gboolean preview_visible) -{ - return; } static gboolean -folder_pane_get_preview_visible (EMailPanedView *view) +folder_pane_get_preview_visible (EMailView *view) { return FALSE; @@ -93,9 +71,9 @@ folder_pane_get_preview_visible (EMailPanedView *view) static void mail_folder_pane_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_PREVIEW_VISIBLE: @@ -104,7 +82,6 @@ mail_folder_pane_get_property (GObject *object, FALSE); return; - } G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -112,9 +89,9 @@ mail_folder_pane_get_property (GObject *object, static void mail_folder_pane_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_PREVIEW_VISIBLE: @@ -124,22 +101,22 @@ mail_folder_pane_set_property (GObject *object, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } -static void +static guint mfp_open_selected_mail (EMailPanedView *view) { GPtrArray *uids; - int i; + gint i; GtkWindow *window; CamelFolder *folder; const gchar *folder_uri; - GPtrArray *views; - guint ii; + GPtrArray *views; + guint n_views, ii; - uids = e_mail_reader_get_selected_uids (E_MAIL_READER(view)); + uids = e_mail_reader_get_selected_uids (E_MAIL_READER(view)); window = e_mail_reader_get_window (E_MAIL_READER(view)); if (!em_utils_ask_open_many (window, uids->len)) { em_utils_uids_free (uids); - return; + return 0; } folder = e_mail_reader_get_folder (E_MAIL_READER(view)); @@ -148,7 +125,7 @@ mfp_open_selected_mail (EMailPanedView *view) em_utils_folder_is_outbox (folder, folder_uri) || em_utils_folder_is_templates (folder, folder_uri)) { em_utils_edit_messages (folder, uids, TRUE); - return; + return 0; } views = g_ptr_array_new (); @@ -190,78 +167,48 @@ mfp_open_selected_mail (EMailPanedView *view) camel_folder_free_message_info (folder, info); } - - for (i=0; i<views->len; i++) { + n_views = views->len; + for (i = 0; i < n_views; i++) g_signal_emit_by_name (view, "open-mail", views->pdata[i]); - } g_ptr_array_foreach (views, (GFunc) g_free, NULL); g_ptr_array_free (views, TRUE); em_utils_uids_free (uids); + return n_views; } static void -mail_folder_pane_class_init (EMailPanedViewClass *class) +e_mail_folder_pane_class_init (EMailFolderPaneClass *class) { GObjectClass *object_class; + EMailViewClass *mail_view_class; + EMailPanedViewClass *mail_paned_view_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EMailFolderPanePrivate)); object_class = G_OBJECT_CLASS (class); - object_class->dispose = mail_folder_pane_dispose; - object_class->constructed = mail_folder_pane_constructed; object_class->set_property = mail_folder_pane_set_property; object_class->get_property = mail_folder_pane_get_property; - class->open_selected_mail = mfp_open_selected_mail; + mail_view_class = E_MAIL_VIEW_CLASS (class); + mail_view_class->set_preview_visible = folder_pane_set_preview_visible; + mail_view_class->get_preview_visible = folder_pane_get_preview_visible; - E_MAIL_VIEW_CLASS(g_type_class_peek_parent(class))->set_preview_visible = folder_pane_set_preview_visible; - E_MAIL_VIEW_CLASS(g_type_class_peek_parent(class))->get_preview_visible = folder_pane_get_preview_visible; + mail_paned_view_class = E_MAIL_PANED_VIEW_CLASS (class); + mail_paned_view_class->open_selected_mail = mfp_open_selected_mail; g_object_class_override_property ( object_class, PROP_PREVIEW_VISIBLE, "preview-visible"); - } - static void -mail_folder_pane_init (EMailFolderPane *browser) +e_mail_folder_pane_init (EMailFolderPane *browser) { - browser->priv = E_MAIL_FOLDER_PANE_GET_PRIVATE (browser); - -} - -GType -e_mail_folder_pane_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EMailFolderPaneClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) mail_folder_pane_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMailFolderPane), - 0, /* n_preallocs */ - (GInstanceInitFunc) mail_folder_pane_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - E_MAIL_PANED_VIEW_TYPE, "EMailFolderPane", &type_info, 0); - - } - - return type; } GtkWidget * @@ -271,7 +218,7 @@ e_mail_folder_pane_new (EShellContent *content) return g_object_new ( E_TYPE_MAIL_FOLDER_PANE, - "shell-content", content, + "shell-content", content, "preview-visible", FALSE, NULL); } |