diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-08-14 09:32:32 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-08-14 09:32:32 +0800 |
commit | 4e9050bc1e3c53e0d1ce17646c01f710085ca681 (patch) | |
tree | 44becdd3ec9fbcac74f0aca934a96ffe5dfd2af1 /mail | |
parent | 8f7b23276dfdbc8e62d9c594556c11fd2ce9b199 (diff) | |
download | gsoc2013-evolution-4e9050bc1e3c53e0d1ce17646c01f710085ca681.tar gsoc2013-evolution-4e9050bc1e3c53e0d1ce17646c01f710085ca681.tar.gz gsoc2013-evolution-4e9050bc1e3c53e0d1ce17646c01f710085ca681.tar.bz2 gsoc2013-evolution-4e9050bc1e3c53e0d1ce17646c01f710085ca681.tar.lz gsoc2013-evolution-4e9050bc1e3c53e0d1ce17646c01f710085ca681.tar.xz gsoc2013-evolution-4e9050bc1e3c53e0d1ce17646c01f710085ca681.tar.zst gsoc2013-evolution-4e9050bc1e3c53e0d1ce17646c01f710085ca681.zip |
Whitespace and coding style cleanup.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-message-pane.c | 2 | ||||
-rw-r--r-- | mail/e-mail-notebook-view.c | 78 | ||||
-rw-r--r-- | mail/e-mail-paned-view.c | 2 | ||||
-rw-r--r-- | mail/e-mail-paned-view.h | 4 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 51 | ||||
-rw-r--r-- | mail/e-mail-reader.h | 2 |
6 files changed, 74 insertions, 65 deletions
diff --git a/mail/e-mail-message-pane.c b/mail/e-mail-message-pane.c index 21f8264c84..5936cd8240 100644 --- a/mail/e-mail-message-pane.c +++ b/mail/e-mail-message-pane.c @@ -97,7 +97,7 @@ e_mail_message_pane_new (EShellView *shell_view) widget = g_object_new ( E_TYPE_MAIL_MESSAGE_PANE, "shell-view", shell_view, NULL); - + e_mail_paned_view_set_enable_show_folder (E_MAIL_PANED_VIEW(widget), TRUE); return widget; diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index 864d78ace1..0480ac281c 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -377,7 +377,7 @@ create_tab_label (EMailNotebookView *view, gtk_box_pack_end (GTK_BOX(container), widget, FALSE, FALSE, 0); g_object_set_data ((GObject *)widget, "page", page); g_object_set_data ((GObject *)page, "close-button", widget); - + g_signal_connect ( widget, "clicked", G_CALLBACK (tab_remove_gtk_cb), view); @@ -897,7 +897,7 @@ mail_netbook_view_open_mail (EMailView *view, tab = (EMailTab *)e_mail_tab_new_full (camel_message_info_subject(info), NULL, 1); g_object_set_data ((GObject *)tab, "page", pane); g_object_set_data ((GObject *)pane, "tab", tab); - + clutter_actor_show((ClutterActor *)tab); clone = e_mail_tab_new_full (camel_message_info_subject(info), NULL, 200); @@ -937,7 +937,7 @@ mail_netbook_view_open_mail (EMailView *view, e_mail_reader_set_group_by_threads ( E_MAIL_READER (pane), e_mail_reader_get_group_by_threads (E_MAIL_READER(view))); - + e_mail_reader_enable_show_folder (E_MAIL_READER(pane)); e_mail_reader_set_message (E_MAIL_READER (pane), uid); camel_message_info_free (info); @@ -947,15 +947,15 @@ mail_netbook_view_open_mail (EMailView *view, static ClutterActor * build_histogram (GtkWidget *widget, CamelFolder *folder) { - int week_time = 60 * 60 * 24 * 7; - int weeks[54]; - int i; + gint week_time = 60 * 60 * 24 * 7; + gint weeks[54]; + gint i; GPtrArray *uids; - int max = 1; + gint max = 1; ClutterActor *texture; cairo_t *cr; - float ratio; - int x = 0; + gfloat ratio; + gint x = 0; time_t now = time(NULL); GtkStyle *style; GdkColor *color; @@ -972,7 +972,7 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) CamelMessageInfo *info = camel_folder_get_message_info (folder, uids->pdata[i]); if (info) { time_t dreceived = now - camel_message_info_date_received (info); - int week; + gint week; week = (dreceived / week_time) - 1; if (week > 52) @@ -981,7 +981,7 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) weeks[week]++; camel_message_info_free (info); - } + } } for (i=0; i< 53; i++) { @@ -993,20 +993,19 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) camel_folder_free_uids (folder, uids); - texture = clutter_cairo_texture_new (200, 50); + texture = clutter_cairo_texture_new (200, 50); clutter_actor_set_size (texture, 200, 50); - cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (texture)); + cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (texture)); clutter_actor_show_all (texture); - cairo_save (cr); cairo_new_path (cr); cairo_move_to (cr, x, 50 - (weeks[52] * ratio)); cairo_set_source_rgba (cr, 0.3, 0.2, 0.4, 1.0); - for (i=51; i>=0; i--) { + for (i=51; i>=0; i--) { x+=3; cairo_line_to (cr, x, 50 - (weeks[i]*ratio)); @@ -1023,7 +1022,7 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) cairo_fill (cr); cairo_restore (cr); - cairo_destroy(cr); + cairo_destroy(cr); return texture; } @@ -1114,14 +1113,16 @@ mail_notebook_view_set_folder (EMailReader *reader, g_object_set_data ((GObject *)priv->current_view, "tab", tab); clutter_actor_show((ClutterActor *)tab); - + clone = build_histogram ((GtkWidget *)reader, folder); clutter_actor_set_reactive (clone, FALSE); clutter_actor_show (clone); e_mail_tab_set_preview_actor (tab, clone); e_mail_tab_set_can_close (tab, TRUE); - e_mail_tab_set_preview_mode (tab, e_mail_tab_picker_get_preview_mode(priv->tab_picker)); + e_mail_tab_set_preview_mode ( + tab, e_mail_tab_picker_get_preview_mode ( + priv->tab_picker)); e_mail_tab_picker_add_tab (priv->tab_picker, tab, -1); page = e_mail_tab_picker_get_tab_no (priv->tab_picker, tab); @@ -1155,7 +1156,7 @@ mail_notebook_view_set_folder (EMailReader *reader, e_mail_tab_set_text (tab, camel_folder_get_full_name(folder)); clone = build_histogram ((GtkWidget *)reader, folder); clutter_actor_set_reactive (clone, FALSE); - clutter_actor_show (clone); + clutter_actor_show (clone); e_mail_tab_set_preview_actor (tab, clone); #endif } @@ -1202,11 +1203,11 @@ static gboolean mail_notebook_view_enable_show_folder (EMailReader *reader) { EMailNotebookViewPrivate *priv = E_MAIL_NOTEBOOK_VIEW (reader)->priv; - + if (!priv->current_view) return FALSE; - return e_mail_reader_get_enable_show_folder (E_MAIL_READER(priv->current_view)); + return e_mail_reader_get_enable_show_folder (E_MAIL_READER(priv->current_view)); } static guint @@ -1283,30 +1284,33 @@ e_mail_notebook_view_init (EMailNotebookView *view) static void emnv_show_folder (EMailNotebookView *view, gpointer not_used) { - int pos; + gint pos; EMailNotebookViewPrivate *priv = view->priv; - - pos = emnv_get_page_num (view, (GtkWidget *)E_MAIL_MESSAGE_PANE(priv->current_view)->parent_folder_view); -#if HAVE_CLUTTER + pos = emnv_get_page_num ( + view, (GtkWidget *) E_MAIL_MESSAGE_PANE ( + priv->current_view)->parent_folder_view); + +#if HAVE_CLUTTER e_mail_tab_picker_set_current_tab (priv->tab_picker, pos); mnv_set_current_tab (E_MAIL_NOTEBOOK_VIEW(view), pos); #else gtk_notebook_set_current_page (priv->book, pos); #endif - } static void emnv_show_prevtab (EMailNotebookView *view, gpointer not_used) { - int pos; + gint pos; EMailNotebookViewPrivate *priv = view->priv; - - pos = emnv_get_page_num (view, (GtkWidget *)E_MAIL_MESSAGE_PANE(priv->current_view)->parent_folder_view); -#if HAVE_CLUTTER + pos = emnv_get_page_num ( + view, (GtkWidget *) E_MAIL_MESSAGE_PANE ( + priv->current_view)->parent_folder_view); + +#if HAVE_CLUTTER pos = e_mail_tab_picker_get_current_tab (priv->tab_picker); if (pos > 0) { e_mail_tab_picker_set_current_tab (priv->tab_picker, pos-1); @@ -1318,17 +1322,15 @@ emnv_show_prevtab (EMailNotebookView *view, gpointer not_used) gtk_notebook_set_current_page (priv->book, pos-1); #endif - } static void emnv_show_nexttab (EMailNotebookView *view, gpointer not_used) { - int pos; + gint pos; EMailNotebookViewPrivate *priv = view->priv; - -#if HAVE_CLUTTER +#if HAVE_CLUTTER pos = e_mail_tab_picker_get_current_tab (priv->tab_picker); if (pos < (gtk_notebook_get_n_pages (priv->book)-1)) { @@ -1341,23 +1343,21 @@ emnv_show_nexttab (EMailNotebookView *view, gpointer not_used) gtk_notebook_set_current_page (priv->book, pos+1); #endif - } static void emnv_close_tab (EMailNotebookView *view, gpointer not_used) { EMailNotebookViewPrivate *priv = view->priv; - -#if HAVE_CLUTTER - mnv_tab_closed (g_object_get_data((GObject *)priv->current_view, "tab"), + +#if HAVE_CLUTTER + mnv_tab_closed (g_object_get_data((GObject *)priv->current_view, "tab"), view); #else tab_remove_gtk_cb (g_object_get_data((GObject *)priv->current_view, "close-button"), view); #endif - } GtkWidget * diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 747147032c..2839c1f44e 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -527,7 +527,7 @@ mail_paned_view_enable_show_folder (EMailReader *reader) EMailPanedViewPrivate *priv; priv = E_MAIL_PANED_VIEW (reader)->priv; - + return priv->enable_show_folder ? TRUE : FALSE; } diff --git a/mail/e-mail-paned-view.h b/mail/e-mail-paned-view.h index 4869a9bb48..5e6879ae94 100644 --- a/mail/e-mail-paned-view.h +++ b/mail/e-mail-paned-view.h @@ -72,8 +72,8 @@ void e_mail_paned_view_hide_message_list_pane (EMailPanedView *view, gboolean visible); GtkWidget * e_mail_paned_view_get_preview (EMailPanedView *view); -void e_mail_paned_view_set_enable_show_folder - (EMailPanedView *view, +void e_mail_paned_view_set_enable_show_folder + (EMailPanedView *view, gboolean set); G_END_DECLS diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 22dccb96ca..fe76e3e7c4 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -717,28 +717,28 @@ static void action_mail_folder_cb (GtkAction *action, EMailReader *reader) { - g_signal_emit (reader, signals[SHOW_FOLDER], 0); + g_signal_emit (reader, signals[SHOW_FOLDER], 0); } static void action_mail_nexttab_cb (GtkAction *action, EMailReader *reader) { - g_signal_emit (reader, signals[SHOW_NEXTTAB], 0); + g_signal_emit (reader, signals[SHOW_NEXTTAB], 0); } static void action_mail_prevtab_cb (GtkAction *action, EMailReader *reader) { - g_signal_emit (reader, signals[SHOW_PREVTAB], 0); + g_signal_emit (reader, signals[SHOW_PREVTAB], 0); } static void action_mail_closetab_cb (GtkAction *action, EMailReader *reader) { - g_signal_emit (reader, signals[CLOSE_TAB], 0); + g_signal_emit (reader, signals[CLOSE_TAB], 0); } static void @@ -1000,7 +1000,9 @@ action_mail_reply_all_cb (GtkAction *action, uid = MESSAGE_LIST (message_list)->cursor_uid; g_return_if_fail (uid != NULL); - mail_get_message (folder, uid, action_mail_reply_all_check, reader, mail_msg_unordered_push); + mail_get_message ( + folder, uid, action_mail_reply_all_check, + reader, mail_msg_unordered_push); return; } action_mail_reply_all_check (NULL, NULL, message, reader); @@ -1033,7 +1035,10 @@ action_mail_reply_list_cb (GtkAction *action, } static void -action_mail_reply_sender_check (CamelFolder *folder, const gchar *uid, CamelMimeMessage *message, gpointer user_data) +action_mail_reply_sender_check (CamelFolder *folder, + const gchar *uid, + CamelMimeMessage *message, + gpointer user_data) { GConfClient *gconf = mail_config_get_gconf_client (); EMailReader *reader = user_data; @@ -2533,7 +2538,7 @@ mail_reader_update_actions (EMailReader *reader, gboolean single_message_selected; priv = E_MAIL_READER_GET_PRIVATE (reader); - + shell_backend = e_mail_reader_get_shell_backend (reader); shell = e_shell_backend_get_shell (shell_backend); shell_settings = e_shell_get_shell_settings (shell); @@ -2901,7 +2906,7 @@ mail_reader_class_init (EMailReaderIface *iface) iface->get_selected_uids = mail_reader_get_selected_uids; iface->get_folder = mail_reader_get_folder; iface->get_folder_uri = mail_reader_get_folder_uri; - iface->enable_show_folder = mail_reader_get_enable_show_folder; + iface->enable_show_folder = mail_reader_get_enable_show_folder; iface->set_folder = mail_reader_set_folder; iface->set_message = mail_reader_set_message; iface->open_selected_mail = e_mail_reader_open_selected; @@ -2948,7 +2953,7 @@ mail_reader_class_init (EMailReaderIface *iface) 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_NONE, 0); signals[SHOW_NEXTTAB] = g_signal_new ( "show-next-tab", @@ -2957,7 +2962,7 @@ mail_reader_class_init (EMailReaderIface *iface) 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_NONE, 0); signals[SHOW_PREVTAB] = g_signal_new ( "show-previous-tab", @@ -2966,7 +2971,7 @@ mail_reader_class_init (EMailReaderIface *iface) 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + G_TYPE_NONE, 0); signals[CLOSE_TAB] = g_signal_new ( "close-tab", @@ -2975,8 +2980,8 @@ mail_reader_class_init (EMailReaderIface *iface) 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - + G_TYPE_NONE, 0); + signals[UPDATE_ACTIONS] = g_signal_new ( "update-actions", G_OBJECT_CLASS_TYPE (iface), @@ -3757,27 +3762,31 @@ e_mail_reader_show_search_bar (EMailReader *reader) g_signal_emit (reader, signals[SHOW_SEARCH_BAR], 0); } -void +void e_mail_reader_enable_show_folder (EMailReader *reader) { - GtkAction *action; - const gchar *action_name; EMailReaderPrivate *priv; CamelFolder *folder; - char *label; + GtkAction *action; + const gchar *action_name; + const gchar *full_name; + gboolean sensitive; + gchar *label; g_return_if_fail (E_IS_MAIL_READER (reader)); priv = E_MAIL_READER_GET_PRIVATE (reader); folder = e_mail_reader_get_folder (reader); - label = g_strdup_printf (_("Folder '%s'"), camel_folder_get_full_name(folder)); + full_name = camel_folder_get_full_name (folder); + label = g_strdup_printf (_("Folder '%s'"), full_name); action_name = "mail-goto-folder"; action = e_mail_reader_get_action (reader, action_name); - g_object_set (action, "visible", TRUE, - "label", label, NULL); - gtk_action_set_sensitive (action, e_mail_reader_get_enable_show_folder (reader)); + sensitive = e_mail_reader_get_enable_show_folder (reader); + gtk_action_set_label (action, label); + gtk_action_set_visible (action, TRUE); + gtk_action_set_sensitive (action, sensitive); g_free (label); } diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h index 187d7a4399..f1e609bbfa 100644 --- a/mail/e-mail-reader.h +++ b/mail/e-mail-reader.h @@ -148,7 +148,7 @@ void e_mail_reader_create_charset_menu void e_mail_reader_show_search_bar (EMailReader *reader); gboolean e_mail_reader_get_enable_show_folder (EMailReader *reader); -void e_mail_reader_enable_show_folder(EMailReader *reader); +void e_mail_reader_enable_show_folder(EMailReader *reader); G_END_DECLS |