aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-11-10 03:36:03 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-11-10 03:36:03 +0800
commit056f54ee2814a37f40294c45fc78e49bfb40c358 (patch)
treedf663422f31f329fb5213f8d75cf4482d3598fc8 /mail/folder-browser.c
parentf47013c7c1b957703016880140f2fff4c1a9583c (diff)
downloadgsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.gz
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.bz2
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.lz
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.xz
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.zst
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.zip
Was x_evolution_message_parse from folder-browser.c. A space char is no
2001-11-08 Jeffrey Stedfast <fejj@ximian.com> * 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
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c47
1 files changed, 5 insertions, 42 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 0a06090adf..85e1bcd4fb 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -384,12 +384,12 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col,
{
GByteArray *array;
- /* format: "uri uid1\0uid2\0uid3\0...\0uidn" */
+ /* format: "uri\0uid1\0uid2\0uid3\0...\0uidn" */
/* write the uri portion */
array = g_byte_array_new ();
g_byte_array_append (array, fb->uri, strlen (fb->uri));
- g_byte_array_append (array, " ", 1);
+ g_byte_array_append (array, "", 1);
/* write the uids */
for (i = 0; i < uids->len; i++) {
@@ -451,43 +451,6 @@ message_rfc822_dnd (CamelFolder *dest, CamelStream *stream, CamelException *ex)
camel_object_unref (CAMEL_OBJECT (mp));
}
-static CamelFolder *
-x_evolution_message_parse (char *in, unsigned int inlen, GPtrArray **uids)
-{
- /* format: "uri uid1\0uid2\0uid3\0...\0uidn" */
- char *inptr, *inend, *uri;
- CamelFolder *folder;
-
- if (in == NULL)
- return NULL;
-
- inend = in + inlen;
-
- inptr = strchr (in, ' ');
- uri = g_strndup (in, inptr - in);
-
- folder = mail_tool_uri_to_folder (uri, 0, NULL);
- g_free (uri);
-
- if (!folder)
- return NULL;
-
- /* 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++;
- }
-
- return folder;
-}
-
static void
message_list_drag_data_received (ETree *tree, int row, ETreePath path, int col,
GdkDragContext *context, gint x, gint y,
@@ -554,7 +517,7 @@ message_list_drag_data_received (ETree *tree, int row, ETreePath path, int col,
camel_object_unref (CAMEL_OBJECT (stream));
break;
case DND_TARGET_TYPE_X_EVOLUTION_MESSAGE:
- folder = x_evolution_message_parse (selection_data->data, selection_data->length, &uids);
+ folder = mail_tools_x_evolution_message_parse (selection_data->data, selection_data->length, &uids);
if (folder == NULL)
goto fail;
@@ -601,7 +564,7 @@ selection_get (GtkWidget *widget, GtkSelectionData *selection_data,
bytes = fb->clipboard_selection;
/* Note: source should == fb->folder, but we might as well use `source' instead of fb->folder */
- source = x_evolution_message_parse (bytes->data, bytes->len, &uids);
+ source = mail_tools_x_evolution_message_parse (bytes->data, bytes->len, &uids);
if (source == NULL)
return;
@@ -666,7 +629,7 @@ selection_received (GtkWidget *widget, GtkSelectionData *selection_data,
if (selection_data == NULL || selection_data->length == -1)
return;
- source = x_evolution_message_parse (selection_data->data, selection_data->length, &uids);
+ source = mail_tools_x_evolution_message_parse (selection_data->data, selection_data->length, &uids);
if (source == NULL)
return;