diff options
author | Not Zed <NotZed@Ximian.com> | 2002-06-03 10:52:32 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-06-03 10:52:32 +0800 |
commit | aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8 (patch) | |
tree | e5e16e67b4fdf2e67aad5ebc04dbbc328d0eb5bc /mail | |
parent | 81ae35a505ec589bc5c59f5e5ae8d034c2aa9169 (diff) | |
download | gsoc2013-evolution-aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8.tar gsoc2013-evolution-aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8.tar.gz gsoc2013-evolution-aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8.tar.bz2 gsoc2013-evolution-aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8.tar.lz gsoc2013-evolution-aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8.tar.xz gsoc2013-evolution-aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8.tar.zst gsoc2013-evolution-aa3bfbe4224ff1c99d358aeac464ce7e9f0963a8.zip |
Implement, return a text description of the localfolder.
2002-06-01 Not Zed <NotZed@Ximian.com>
* mail-local.c (mlf_getv): Implement, return a text description of
the localfolder.
* message-list.c (ml_duplicate_value):
(ml_free_value):
(ml_initialize_value):
(ml_value_is_empty):
(ml_value_to_string):
(ml_tree_value_at): Implement COL_LOCATION, original location of
message (useful for vfolder).
svn path=/trunk/; revision=17072
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 13 | ||||
-rw-r--r-- | mail/mail-local.c | 45 | ||||
-rw-r--r-- | mail/message-list.c | 20 | ||||
-rw-r--r-- | mail/message-list.etspec | 2 | ||||
-rw-r--r-- | mail/message-list.h | 3 |
5 files changed, 81 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 4281030bd3..1cfa0ca1da 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,16 @@ +2002-06-01 Not Zed <NotZed@Ximian.com> + + * mail-local.c (mlf_getv): Implement, return a text description of + the localfolder. + + * message-list.c (ml_duplicate_value): + (ml_free_value): + (ml_initialize_value): + (ml_value_is_empty): + (ml_value_to_string): + (ml_tree_value_at): Implement COL_LOCATION, original location of + message (useful for vfolder). + 2002-06-02 Larry Ewing <lewing@ximian.com> * mail-tools.c (mail_tool_quote_message): make these citations as diff --git a/mail/mail-local.c b/mail/mail-local.c index 5e1c4ee579..bf28a8defe 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -111,6 +111,7 @@ typedef struct { CamelFolder *real_folder; CamelStore *real_store; + char *description; char *real_path; struct _local_meta *meta; @@ -512,6 +513,48 @@ mlf_set_folder(MailLocalFolder *mlf, guint32 flags, CamelException *ex) return TRUE; } +static int +mlf_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + CamelFolder *folder = (CamelFolder *)object; + MailLocalFolder *mlf = (MailLocalFolder *)object; + int i, count=args->argc; + guint32 tag; + + for (i=0;i<args->argc;i++) { + CamelArgGet *arg = &args->argv[i]; + + tag = arg->tag; + + switch (tag & CAMEL_ARG_TAG) { + /* CamelObject args */ + case CAMEL_OBJECT_ARG_DESCRIPTION: + if (mlf->description == NULL) { + int pathlen; + + /* string to describe a local folder as the location of a message */ + pathlen = strlen(evolution_dir) + strlen("local") + 1; + if (strlen(folder->full_name) > pathlen) + mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->full_name+pathlen); + else + mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->name); + } + *arg->ca_str = mlf->description; + break; + default: + count--; + continue; + } + + arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE; + } + + if (count) + return ((CamelObjectClass *)mlf_parent_class)->getv(object, ex, args); + + return 0; +} + static void mlf_class_init (CamelObjectClass *camel_object_class) { @@ -533,6 +576,8 @@ mlf_class_init (CamelObjectClass *camel_object_class) camel_folder_class->set_message_user_tag = mlf_set_message_user_tag; camel_folder_class->rename = mlf_rename; + + camel_object_class->getv = mlf_getv; } static void diff --git a/mail/message-list.c b/mail/message-list.c index f7a363b9f1..93dffcfdfb 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -575,6 +575,7 @@ ml_duplicate_value (ETreeModel *etm, int col, const void *value, void *data) case COL_SUBJECT: case COL_TO: case COL_FOLLOWUP_FLAG: + case COL_LOCATION: return g_strdup (value); default: @@ -604,6 +605,7 @@ ml_free_value (ETreeModel *etm, int col, void *value, void *data) case COL_SUBJECT: case COL_TO: case COL_FOLLOWUP_FLAG: + case COL_LOCATION: g_free (value); break; default: @@ -632,6 +634,7 @@ ml_initialize_value (ETreeModel *etm, int col, void *data) case COL_SUBJECT: case COL_TO: case COL_FOLLOWUP_FLAG: + case COL_LOCATION: return g_strdup (""); default: g_assert_not_reached (); @@ -661,6 +664,7 @@ ml_value_is_empty (ETreeModel *etm, int col, const void *value, void *data) case COL_SUBJECT: case COL_TO: case COL_FOLLOWUP_FLAG: + case COL_LOCATION: return !(value && *(char *)value); default: g_assert_not_reached (); @@ -724,6 +728,7 @@ ml_value_to_string (ETreeModel *etm, int col, const void *value, void *data) case COL_SUBJECT: case COL_TO: case COL_FOLLOWUP_FLAG: + case COL_LOCATION: return g_strdup (value); default: g_assert_not_reached (); @@ -950,6 +955,19 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) } return (void *)colour; } + case COL_LOCATION: { + CamelFolder *folder; + char *name; + + if (CAMEL_IS_VEE_FOLDER(message_list->folder)) { + folder = camel_vee_folder_get_location((CamelVeeFolder *)message_list->folder, (CamelVeeMessageInfo *)msg_info, NULL); + } else { + folder = message_list->folder; + } + + camel_object_get(folder, NULL, CAMEL_OBJECT_DESCRIPTION, &name, 0); + return name; + } default: g_assert_not_reached (); return NULL; @@ -1114,7 +1132,7 @@ message_list_create_extras (void) "color_column", COL_COLOUR, NULL); e_table_extras_add_cell (extras, "render_size", cell); - + return extras; } diff --git a/mail/message-list.etspec b/mail/message-list.etspec index c91b386319..23149dd8e8 100644 --- a/mail/message-list.etspec +++ b/mail/message-list.etspec @@ -25,6 +25,8 @@ <ETableColumn model_col= "12" _title="Due By" expansion="0.2" minimum_width="32" resizable="true" cell="render_date" compare="integer"/> + <ETableColumn model_col= "13" _title="Original Location" expansion="0.2" minimum_width="32" resizable="true" cell="render_text" compare="string"/> + <ETableState> <column source="0"/> <column source="3"/> <column source="1"/> <column source="4"/> <column source="5" expansion="1.60"/> <column source="6" expansion="0.40"/> diff --git a/mail/message-list.h b/mail/message-list.h index bf5eb92308..fc02c668eb 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -29,7 +29,8 @@ enum { COL_FOLLOWUP_FLAG_STATUS, COL_FOLLOWUP_FLAG, COL_FOLLOWUP_DUE_BY, - + COL_LOCATION, /* vfolder location? */ + COL_LAST, /* Invisible columns */ |