From 056f54ee2814a37f40294c45fc78e49bfb40c358 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 9 Nov 2001 19:36:03 +0000 Subject: Was x_evolution_message_parse from folder-browser.c. A space char is no 2001-11-08 Jeffrey Stedfast * mail-tools.c (mail_tools_x_evolution_message_parse): Was x_evolution_message_parse from folder-browser.c. A space char is no longer used to separate the folder URI and the first uid, instead this is now done with a nul-char so update to parse the newer/better format. * component-factory.c (destination_folder_handle_drop): Update to parse the new/better format. * folder-browser.c (x_evolution_message_parse): Moved to mail-tools.c (message_list_drag_data_get): Instead of placing a space char after the folder URI, instead use a nul-char. svn path=/trunk/; revision=14645 --- mail/component-factory.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'mail/component-factory.c') diff --git a/mail/component-factory.c b/mail/component-factory.c index 9d501ba815..f77f76fa1b 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -623,34 +623,12 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des camel_object_unref (CAMEL_OBJECT (folder)); break; case ACCEPTED_DND_TYPE_X_EVOLUTION_MESSAGE: - /* format: "uri uid1\0uid2\0uid3\0...\0uidn" */ + folder = mail_tools_x_evolution_message_parse (data->bytes._buffer, + data->bytes._length, + &uids); - in = data->bytes._buffer; - inend = in + data->bytes._length; - - inptr = strchr (in, ' '); - url = g_strndup (in, inptr - in); - - folder = mail_tool_uri_to_folder (url, 0, &ex); - g_free (url); - - if (!folder) { - camel_exception_clear (&ex); + if (!folder) return FALSE; - } - - /* split the uids */ - inptr++; - uids = g_ptr_array_new (); - while (inptr < inend) { - char *start = inptr; - - while (inptr < inend && *inptr) - inptr++; - - g_ptr_array_add (uids, g_strndup (start, inptr - start)); - inptr++; - } mail_transfer_messages (folder, uids, action == GNOME_Evolution_ShellComponentDnd_ACTION_MOVE, -- cgit