diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-07-17 06:04:14 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-07-17 06:04:14 +0800 |
commit | 6bebd14b92660bd0c95eac2d003764b71e9253d1 (patch) | |
tree | a517df285b5dbaf54fa1c7e1a20e14ee69004657 /mail | |
parent | 29672fc78d4142c6666f8546f055278f485b83c2 (diff) | |
download | gsoc2013-evolution-6bebd14b92660bd0c95eac2d003764b71e9253d1.tar.gz gsoc2013-evolution-6bebd14b92660bd0c95eac2d003764b71e9253d1.tar.zst gsoc2013-evolution-6bebd14b92660bd0c95eac2d003764b71e9253d1.zip |
Use g_strcasecmp() when looking for a Trash folder - it may be lowercase
2001-07-16 Jeffrey Stedfast <fejj@ximian.com>
* mail-ops.c (add_vtrash_info): Use g_strcasecmp() when looking
for a Trash folder - it may be lowercase or something funky.
* mail-local.c (init_trash): No need to specify the vfolder
expression here. This code was moved into camel-vtrash-folder.c
ages ago.
* component-factory.c: Let VTrash folders accept/export the same
dnd types as normal folders.
svn path=/trunk/; revision=11140
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/component-factory.c | 33 | ||||
-rw-r--r-- | mail/mail-local.c | 10 | ||||
-rw-r--r-- | mail/mail-ops.c | 17 |
4 files changed, 39 insertions, 28 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 1e4437b8f9..0231256e99 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,12 @@ 2001-07-16 Jeffrey Stedfast <fejj@ximian.com> + * mail-ops.c (add_vtrash_info): Use g_strcasecmp() when looking + for a Trash folder - it may be lowercase or something funky. + + * mail-local.c (init_trash): No need to specify the vfolder + expression here. This code was moved into camel-vtrash-folder.c + ages ago. + * component-factory.c: Let VTrash folders accept/export the same dnd types as normal folders. diff --git a/mail/component-factory.c b/mail/component-factory.c index 294506b670..5610ddc8c7 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -52,6 +52,8 @@ #include "mail-send-recv.h" +#include <camel/camel-vtrash-folder.h> + char *default_drafts_folder_uri; CamelFolder *drafts_folder = NULL; char *default_sent_folder_uri; @@ -273,7 +275,8 @@ xfer_folder (EvolutionShellComponent *shell_component, do_xfer_folder, CORBA_Object_duplicate (listener, &ev)); - GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_OK, &ev); + GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_OK, + &ev); } else GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_INVALID_URI, &ev); CORBA_exception_free (&ev); @@ -361,7 +364,7 @@ message_rfc822_dnd (CamelFolder *dest, CamelStream *stream, CamelException *ex) } static CORBA_boolean -destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *folder, +destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *dest_folder, const char *physical_uri, const GNOME_Evolution_ShellComponentDnd_DestinationFolder_Context *destination_context, const GNOME_Evolution_ShellComponentDnd_Action action, @@ -370,7 +373,7 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol { char *url, *in, *inptr, *inend; gboolean retval = FALSE; - CamelFolder *source; + CamelFolder *folder; CamelStream *stream; CamelException ex; GPtrArray *uids; @@ -390,8 +393,8 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol switch (type) { case ACCEPTED_DND_TYPE_TEXT_URI_LIST: - source = mail_tool_uri_to_folder (physical_uri, NULL); - if (!source) + folder = mail_tool_uri_to_folder (physical_uri, NULL); + if (!folder) return FALSE; url = g_strndup (data->bytes._buffer, data->bytes._length); @@ -414,9 +417,9 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol } stream = camel_stream_fs_new_with_fd (fd); - message_rfc822_dnd (source, stream, &ex); + message_rfc822_dnd (folder, stream, &ex); camel_object_unref (CAMEL_OBJECT (stream)); - camel_object_unref (CAMEL_OBJECT (source)); + camel_object_unref (CAMEL_OBJECT (folder)); retval = !camel_exception_is_set (&ex); @@ -426,8 +429,8 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol g_free (url); break; case ACCEPTED_DND_TYPE_MESSAGE_RFC822: - source = mail_tool_uri_to_folder (physical_uri, &ex); - if (!source) { + folder = mail_tool_uri_to_folder (physical_uri, &ex); + if (!folder) { camel_exception_clear (&ex); return FALSE; } @@ -437,9 +440,9 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol camel_stream_write (stream, data->bytes._buffer, data->bytes._length); camel_stream_reset (stream); - message_rfc822_dnd (source, stream, &ex); + message_rfc822_dnd (folder, stream, &ex); camel_object_unref (CAMEL_OBJECT (stream)); - camel_object_unref (CAMEL_OBJECT (source)); + camel_object_unref (CAMEL_OBJECT (folder)); break; case ACCEPTED_DND_TYPE_X_EVOLUTION_MESSAGE: /* format: "uri uid1\0uid2\0uid3\0...\0uidn" */ @@ -450,10 +453,10 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol inptr = strchr (in, ' '); url = g_strndup (in, inptr - in); - source = mail_tool_uri_to_folder (url, &ex); + folder = mail_tool_uri_to_folder (url, &ex); g_free (url); - if (!source) { + if (!folder) { camel_exception_clear (&ex); return FALSE; } @@ -471,11 +474,11 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol inptr++; } - mail_transfer_messages (source, uids, + mail_transfer_messages (folder, uids, action == GNOME_Evolution_ShellComponentDnd_ACTION_MOVE, physical_uri, NULL, NULL); - camel_object_unref (CAMEL_OBJECT (source)); + camel_object_unref (CAMEL_OBJECT (folder)); break; default: break; diff --git a/mail/mail-local.c b/mail/mail-local.c index 56b68344e0..5f77db80d4 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -350,13 +350,8 @@ static void init_trash (CamelStore *store) { MailLocalStore *local_store = MAIL_LOCAL_STORE (store); - char *name; - name = g_strdup_printf ("%s?(match-all (system-flag \"Deleted\"))", "vTrash"); - - store->vtrash = camel_vtrash_folder_new (store, name); - - g_free (name); + store->vtrash = camel_vtrash_folder_new (store, _("Trash")); if (store->vtrash) { /* attach to the finalize event of the vtrash */ @@ -446,7 +441,8 @@ struct _register_msg { MailLocalFolder *local_folder; }; -static char *register_folder_desc(struct _mail_msg *mm, int done) +static char * +register_folder_desc(struct _mail_msg *mm, int done) { struct _register_msg *m = (struct _register_msg *)mm; diff --git a/mail/mail-ops.c b/mail/mail-ops.c index bcb171db80..3c8818020d 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -983,7 +983,8 @@ struct _get_folderinfo_msg { void *data; }; -static char *get_folderinfo_desc(struct _mail_msg *mm, int done) +static char * +get_folderinfo_desc (struct _mail_msg *mm, int done) { struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; char *ret, *name; @@ -1004,7 +1005,7 @@ add_vtrash_info (CamelFolderInfo *info) g_return_if_fail (info != NULL); for (fi = info; fi->sibling; fi = fi->sibling) { - if (!strcmp (fi->name, _("Trash"))) + if (!g_strcasecmp (fi->name, _("Trash"))) break; } @@ -1036,7 +1037,8 @@ add_vtrash_info (CamelFolderInfo *info) g_free (uri); } -static void get_folderinfo_get(struct _mail_msg *mm) +static void +get_folderinfo_get (struct _mail_msg *mm) { struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE; @@ -1051,7 +1053,8 @@ static void get_folderinfo_get(struct _mail_msg *mm) camel_operation_unregister(mm->cancel); } -static void get_folderinfo_got(struct _mail_msg *mm) +static void +get_folderinfo_got (struct _mail_msg *mm) { struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; @@ -1066,7 +1069,8 @@ static void get_folderinfo_got(struct _mail_msg *mm) m->done(m->store, m->info, m->data); } -static void get_folderinfo_free(struct _mail_msg *mm) +static void +get_folderinfo_free (struct _mail_msg *mm) { struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; @@ -1082,7 +1086,8 @@ static struct _mail_msg_op get_folderinfo_op = { get_folderinfo_free, }; -int mail_get_folderinfo(CamelStore *store, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data) +int +mail_get_folderinfo (CamelStore *store, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data) { struct _get_folderinfo_msg *m; int id; |