diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-09-09 00:52:48 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-09-09 00:52:48 +0800 |
commit | bbb5bf71555a351bce1ab8353ee0d961d5523d65 (patch) | |
tree | 1037edde01f5193285366538089d4a609862f519 | |
parent | 48c3fcd45d757f8e60e7ed37ca96fd843e690d0b (diff) | |
download | gsoc2013-evolution-bbb5bf71555a351bce1ab8353ee0d961d5523d65.tar.gz gsoc2013-evolution-bbb5bf71555a351bce1ab8353ee0d961d5523d65.tar.zst gsoc2013-evolution-bbb5bf71555a351bce1ab8353ee0d961d5523d65.zip |
Fixed some warnings.
2000-09-08 Christopher James Lahey <clahey@helixcode.com>
* folder-browser.c, mail-config-gui.c, mail-ops.c: Fixed some
warnings.
* message-list.c: Added base ETableModel functions.
svn path=/trunk/; revision=5268
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/folder-browser.c | 2 | ||||
-rw-r--r-- | mail/mail-config-gui.c | 4 | ||||
-rw-r--r-- | mail/mail-ops.c | 4 | ||||
-rw-r--r-- | mail/message-list.c | 159 |
5 files changed, 171 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 7b06fce78c..78a1665e17 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2000-09-08 Christopher James Lahey <clahey@helixcode.com> + + * folder-browser.c, mail-config-gui.c, mail-ops.c: Fixed some + warnings. + + * message-list.c: Added base ETableModel functions. + 2000-09-08 Jeffrey Stedfast <fejj@helixcode.com> * mail-ops.c (do_fetch_mail): Updated to pass a CamelMessageInfo diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 75cf0f06ac..c3e4db16f0 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -205,7 +205,7 @@ create_option_menu (char **menu_list, int item, void *data) while (*menu_list){ GtkWidget *entry; - entry = e_utf8_gtk_menu_item_new_with_label ((GtkWidget *) menu, *menu_list); + entry = e_utf8_gtk_menu_item_new_with_label (GTK_MENU(menu), *menu_list); gtk_widget_show (entry); gtk_object_set_data((GtkObject *)entry, "search_option", (void *)i); gtk_menu_append (GTK_MENU (menu), entry); diff --git a/mail/mail-config-gui.c b/mail/mail-config-gui.c index 1cb972dc6b..70a3f0326b 100644 --- a/mail/mail-config-gui.c +++ b/mail/mail-config-gui.c @@ -184,7 +184,9 @@ static void config_do_query_authtypes (MailDialogServicePage *page, const char * static void html_size_req (GtkWidget *widget, GtkRequisition *requisition); static GtkWidget *html_new (gboolean white); static void put_html (GtkHTML *html, char *text); +#if 0 static void error_dialog (GtkWidget *parent_finder, const char *fmt, ...); +#endif static GdkImlibImage *load_image (const char *name); static void service_page_menuitem_activate (GtkWidget *item, MailDialogServicePage *page); @@ -255,6 +257,7 @@ put_html (GtkHTML *html, char *text) } +#if 0 /* Standard Dialog Helpers */ static void error_dialog (GtkWidget *parent_finder, const char *fmt, ...) @@ -274,7 +277,6 @@ error_dialog (GtkWidget *parent_finder, const char *fmt, ...) g_free (msg); } -#if 0 static void info_dialog (GtkWidget *parent_finder, const char *fmt, ...) { diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 5c3ab58eac..8a507e01fc 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -176,8 +176,8 @@ do_fetch_mail (gpointer in_data, gpointer op_data, CamelException *ex) free_info = TRUE; } - filter_driver_run (filter, message, input->destination, - info, FILTER_SOURCE_INCOMING, + filter_driver_run (filter, message, info, + input->destination, FILTER_SOURCE_INCOMING, input->hook_func, input->hook_data, TRUE, ex); diff --git a/mail/message-list.c b/mail/message-list.c index 6b4ce3de9b..65f035fe5b 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -211,6 +211,157 @@ select_msg (MessageList *message_list, gint row) } +/* + * SimpleTableModel::col_count + */ +static int +ml_col_count (ETableModel *etm, void *data) +{ + return COL_LAST; +} + +static void * +ml_duplicate_value (ETableModel *etm, int col, const void *value, void *data) +{ + switch (col){ + case COL_ONLINE_STATUS: + case COL_MESSAGE_STATUS: + case COL_PRIORITY: + case COL_ATTACHMENT: + case COL_DELETED: + case COL_UNREAD: + case COL_SENT: + case COL_RECEIVED: + return (void *) value; + + case COL_FROM: + case COL_SUBJECT: + case COL_TO: + case COL_SIZE: + return g_strdup (value); + default: + g_assert_not_reached (); + } + return NULL; +} + +static void +ml_free_value (ETableModel *etm, int col, void *value, void *data) +{ + switch (col){ + case COL_ONLINE_STATUS: + case COL_MESSAGE_STATUS: + case COL_PRIORITY: + case COL_ATTACHMENT: + case COL_DELETED: + case COL_UNREAD: + case COL_SENT: + case COL_RECEIVED: + break; + + case COL_FROM: + case COL_SUBJECT: + case COL_TO: + case COL_SIZE: + g_free (value); + break; + default: + g_assert_not_reached (); + } +} + +static void * +ml_initialize_value (ETableModel *etm, int col, void *data) +{ + switch (col){ + case COL_ONLINE_STATUS: + case COL_MESSAGE_STATUS: + case COL_PRIORITY: + case COL_ATTACHMENT: + case COL_DELETED: + case COL_UNREAD: + case COL_SENT: + case COL_RECEIVED: + return NULL; + + case COL_FROM: + case COL_SUBJECT: + case COL_TO: + case COL_SIZE: + return g_strdup(""); + default: + g_assert_not_reached (); + } + + return NULL; +} + +static gboolean +ml_value_is_empty (ETableModel *etm, int col, const void *value, void *data) +{ + switch (col){ + case COL_ONLINE_STATUS: + case COL_MESSAGE_STATUS: + case COL_PRIORITY: + case COL_ATTACHMENT: + case COL_DELETED: + case COL_UNREAD: + case COL_SENT: + case COL_RECEIVED: + return value == NULL; + + case COL_FROM: + case COL_SUBJECT: + case COL_TO: + case COL_SIZE: + return !(value && *(char *)value); + default: + g_assert_not_reached (); + return FALSE; + } +} + +static char * +ml_value_to_string (ETableModel *etm, int col, const void *value, void *data) +{ + switch (col){ + case COL_MESSAGE_STATUS: + switch ((int) value) { + case 0: + return g_strdup("Unseen"); + break; + case 1: + return g_strdup("Seen"); + break; + case 2: + return g_strdup("Answered"); + break; + default: + return g_strdup(""); + break; + } + break; + case COL_ONLINE_STATUS: + case COL_PRIORITY: + case COL_ATTACHMENT: + case COL_DELETED: + case COL_UNREAD: + return g_strdup_printf("%d", (int) value); + case COL_SENT: + case COL_RECEIVED: + return filter_date(value); + + case COL_FROM: + case COL_SUBJECT: + case COL_TO: + case COL_SIZE: + return g_strdup(value); + default: + g_assert_not_reached (); + return NULL; + } +} + static GdkPixbuf * ml_tree_icon_at (ETreeModel *etm, ETreePath *path, void *model_data) { @@ -587,7 +738,13 @@ message_list_init (GtkObject *object) char *spec; message_list->table_model = (ETableModel *) - e_tree_simple_new (ml_tree_icon_at, ml_tree_value_at, + e_tree_simple_new (ml_col_count, + ml_duplicate_value, + ml_free_value, + ml_initialize_value, + ml_value_is_empty, + ml_value_to_string, + ml_tree_icon_at, ml_tree_value_at, ml_tree_set_value_at, ml_tree_is_cell_editable, message_list); |