[evolution-patches] 65329, more system folder name translations
- From: not zed <notzed ximian com>
- To: evolution-patches lists ximian com
- Subject: [evolution-patches] 65329, more system folder name translations
- Date: Tue, 01 Feb 2005 16:42:19 +0800
against head, for stable though
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v
retrieving revision 1.2422
diff -u -p -r1.2422 ChangeLog
--- camel/ChangeLog 1 Feb 2005 07:40:26 -0000 1.2422
+++ camel/ChangeLog 1 Feb 2005 08:33:38 -0000
@@ -1,5 +1,14 @@
2005-02-01 Not Zed <NotZed Ximian com>
+ ** See bug #65329
+
+ * camel-vtrash-folder.c (camel_vtrash_folder_new): api chagne and
+ translate the short name.
+
+ * camel-vee-folder.c (camel_vee_folder_construct): take full-name
+ argument separately from short-name.
+ (camel_vee_folder_new): calculate short-name.
+
* camel-store.c (camel_store_get_folder_info): set the folder type
hint.
Index: camel/camel-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-store.c,v
retrieving revision 1.159
diff -u -p -r1.159 camel-store.c
--- camel/camel-store.c 1 Feb 2005 07:40:26 -0000 1.159
+++ camel/camel-store.c 1 Feb 2005 08:33:38 -0000
@@ -775,8 +775,10 @@ camel_store_get_folder_info(CamelStore *
if (info && (top == NULL || *top == '\0') && (flags & CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL) == 0) {
if (info->uri && (store->flags & CAMEL_STORE_VTRASH))
+ /* the name of the Trash folder, used for deleted messages */
add_special_info (store, info, CAMEL_VTRASH_NAME, _("Trash"), FALSE, CAMEL_FOLDER_VIRTUAL|CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_VTRASH|CAMEL_FOLDER_TYPE_TRASH);
if (info->uri && (store->flags & CAMEL_STORE_VJUNK))
+ /* the name of the Junk folder, used for spam messages */
add_special_info (store, info, CAMEL_VJUNK_NAME, _("Junk"), TRUE, CAMEL_FOLDER_VIRTUAL|CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_VTRASH|CAMEL_FOLDER_TYPE_JUNK);
}
Index: camel/camel-vee-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-vee-folder.c,v
retrieving revision 1.73
diff -u -p -r1.73 camel-vee-folder.c
--- camel/camel-vee-folder.c 12 Jan 2005 09:57:29 -0000 1.73
+++ camel/camel-vee-folder.c 1 Feb 2005 08:33:39 -0000
@@ -104,18 +104,12 @@ camel_vee_folder_get_type (void)
}
void
-camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags)
+camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *full, const char *name, guint32 flags)
{
CamelFolder *folder = (CamelFolder *)vf;
- const char *tmp;
vf->flags = flags;
- tmp = strrchr(name, '/');
- if (tmp)
- tmp++;
- else
- tmp = name;
- camel_folder_construct(folder, parent_store, name, tmp);
+ camel_folder_construct(folder, parent_store, full, name);
folder->summary = camel_vee_summary_new(folder);
@@ -126,7 +120,7 @@ camel_vee_folder_construct (CamelVeeFold
/**
* camel_vee_folder_new:
* @parent_store: the parent CamelVeeStore
- * @name: the vfolder name
+ * @full: the full path to the vfolder.
* @ex: a CamelException
*
* Create a new CamelVeeFolder object.
@@ -134,22 +128,28 @@ camel_vee_folder_construct (CamelVeeFold
* Return value: A new CamelVeeFolder widget.
**/
CamelFolder *
-camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags)
+camel_vee_folder_new(CamelStore *parent_store, const char *full, guint32 flags)
{
CamelVeeFolder *vf;
char *tmp;
- if (CAMEL_IS_VEE_STORE(parent_store) && strcmp(name, CAMEL_UNMATCHED_NAME) == 0) {
+ if (CAMEL_IS_VEE_STORE(parent_store) && strcmp(full, CAMEL_UNMATCHED_NAME) == 0) {
vf = ((CamelVeeStore *)parent_store)->folder_unmatched;
camel_object_ref(vf);
} else {
+ const char *name = strrchr(full, '/');
+
+ if (name == NULL)
+ name = full;
+ else
+ name++;
vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
- camel_vee_folder_construct(vf, parent_store, name, flags);
+ camel_vee_folder_construct(vf, parent_store, full, name, flags);
}
d(printf("returning folder %s %p, count = %d\n", name, vf, camel_folder_get_message_count((CamelFolder *)vf)));
- tmp = g_strdup_printf("%s/%s.cmeta", ((CamelService *)parent_store)->url->path, name);
+ tmp = g_strdup_printf("%s/%s.cmeta", ((CamelService *)parent_store)->url->path, full);
camel_object_set(vf, NULL, CAMEL_OBJECT_STATE_FILE, tmp, NULL);
g_free(tmp);
if (camel_object_state_read(vf) == -1) {
Index: camel/camel-vee-folder.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-vee-folder.h,v
retrieving revision 1.15
diff -u -p -r1.15 camel-vee-folder.h
--- camel/camel-vee-folder.h 12 Nov 2004 05:53:12 -0000 1.15
+++ camel/camel-vee-folder.h 1 Feb 2005 08:33:39 -0000
@@ -77,7 +77,7 @@ struct _CamelVeeFolderClass {
CamelType camel_vee_folder_get_type (void);
CamelFolder *camel_vee_folder_new (CamelStore *parent_store, const char *name, guint32 flags);
-void camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags);
+void camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *full, const char *name, guint32 flags);
CamelFolder *camel_vee_folder_get_location(CamelVeeFolder *vf, const struct _CamelVeeMessageInfo *vinfo, char **realuid);
Index: camel/camel-vee-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-vee-store.c,v
retrieving revision 1.36
diff -u -p -r1.36 camel-vee-store.c
--- camel/camel-vee-store.c 12 Nov 2004 05:53:12 -0000 1.36
+++ camel/camel-vee-store.c 1 Feb 2005 08:33:39 -0000
@@ -97,7 +97,7 @@ camel_vee_store_init (CamelVeeStore *obj
/* Set up unmatched folder */
obj->unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal);
obj->folder_unmatched = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ());
- camel_vee_folder_construct (obj->folder_unmatched, store, CAMEL_UNMATCHED_NAME, CAMEL_STORE_FOLDER_PRIVATE);
+ camel_vee_folder_construct (obj->folder_unmatched, store, CAMEL_UNMATCHED_NAME, _("Unmatched"), CAMEL_STORE_FOLDER_PRIVATE);
}
static void
Index: camel/camel-vtrash-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-vtrash-folder.c,v
retrieving revision 1.16
diff -u -p -r1.16 camel-vtrash-folder.c
--- camel/camel-vtrash-folder.c 12 Nov 2004 05:53:12 -0000 1.16
+++ camel/camel-vtrash-folder.c 1 Feb 2005 08:33:39 -0000
@@ -37,15 +37,16 @@
#define CF_CLASS(so) ((CamelFolderClass *)((CamelObject *)(so))->klass)
static struct {
+ const char *full_name;
const char *name;
const char *expr;
guint32 bit;
guint32 flags;
const char *error_copy;
} vdata[] = {
- { CAMEL_VTRASH_NAME, "(match-all (system-flag \"Deleted\"))", CAMEL_MESSAGE_DELETED, CAMEL_FOLDER_IS_TRASH,
+ { CAMEL_VTRASH_NAME, N_("Trash"), "(match-all (system-flag \"Deleted\"))", CAMEL_MESSAGE_DELETED, CAMEL_FOLDER_IS_TRASH,
N_("Cannot copy messages to the Trash folder") },
- { CAMEL_VJUNK_NAME, "(match-all (system-flag \"Junk\"))", CAMEL_MESSAGE_JUNK, CAMEL_FOLDER_IS_JUNK,
+ { CAMEL_VJUNK_NAME, N_("Junk"), "(match-all (system-flag \"Junk\"))", CAMEL_MESSAGE_JUNK, CAMEL_FOLDER_IS_JUNK,
N_("Cannot copy messages to the Junk folder") },
};
@@ -96,7 +97,7 @@ camel_vtrash_folder_new (CamelStore *par
g_assert(type < CAMEL_VTRASH_FOLDER_LAST);
vtrash = (CamelVTrashFolder *)camel_object_new(camel_vtrash_folder_get_type());
- camel_vee_folder_construct(CAMEL_VEE_FOLDER (vtrash), parent_store, vdata[type].name,
+ camel_vee_folder_construct(CAMEL_VEE_FOLDER (vtrash), parent_store, vdata[type].full_name, _(vdata[type].name),
CAMEL_STORE_FOLDER_PRIVATE|CAMEL_STORE_FOLDER_CREATE|CAMEL_STORE_VEE_FOLDER_AUTO);
((CamelFolder *)vtrash)->folder_flags |= vdata[type].flags;
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3562
diff -u -p -r1.3562 ChangeLog
--- mail/ChangeLog 1 Feb 2005 07:41:48 -0000 1.3562
+++ mail/ChangeLog 1 Feb 2005 08:34:36 -0000
@@ -1,5 +1,10 @@
2005-02-01 Not Zed <NotZed Ximian com>
+ ** See bug #65329.
+
+ * mail-component.c (view_changed_cb): translate special names on
+ the local store.
+
* em-folder-tree-model.c (sort_cb): use the type hint to sort for
inbox, not the name.
(emft_is_special_local_folder): removed.
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.105
diff -u -p -r1.105 mail-component.c
--- mail/mail-component.c 28 Jan 2005 09:04:28 -0000 1.105
+++ mail/mail-component.c 1 Feb 2005 08:34:37 -0000
@@ -524,7 +524,12 @@ view_changed_cb(EMFolderView *emfv, EInf
message_list_free_uids(emfv->list, selected);
}
- e_info_label_set_info(el, name, tmp->str);
+ if (emfv->folder->parent_store == mail_component_peek_local_store(NULL)
+ && (!strcmp (name, "Drafts") || !strcmp (name, "Inbox")
+ || !strcmp (name, "Outbox") || !strcmp (name, "Sent")))
+ e_info_label_set_info(el, _(name), tmp->str);
+ else
+ e_info_label_set_info(el, name, tmp->str);
g_string_free(tmp, TRUE);
camel_object_free(emfv->folder, CAMEL_FOLDER_NAME, name);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]