diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-24 05:34:32 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-24 05:34:32 +0800 |
commit | 90823e758b76bbaed17a45975a3b577c13ad97bc (patch) | |
tree | e9382369c851aad01a1a91ea78b697843dd061d7 | |
parent | 94326a9ac80ea9e3227d4df8e29441eaedbda22a (diff) | |
download | gsoc2013-evolution-90823e758b76bbaed17a45975a3b577c13ad97bc.tar.gz gsoc2013-evolution-90823e758b76bbaed17a45975a3b577c13ad97bc.tar.zst gsoc2013-evolution-90823e758b76bbaed17a45975a3b577c13ad97bc.zip |
Check to make sure we actually have drag data.
2001-08-23 Jeffrey Stedfast <fejj@ximian.com>
* component-factory.c (destination_folder_handle_drop): Check to
make sure we actually have drag data.
* folder-browser.c (message_list_drag_data_received): Check to
make sure we have valid data.
svn path=/trunk/; revision=12424
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/component-factory.c | 4 | ||||
-rw-r--r-- | mail/folder-browser.c | 6 | ||||
-rw-r--r-- | mail/message-list.c | 10 |
4 files changed, 22 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index e2ffb41ad6..0785f68098 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2001-08-23 Jeffrey Stedfast <fejj@ximian.com> + + * component-factory.c (destination_folder_handle_drop): Check to + make sure we actually have drag data. + + * folder-browser.c (message_list_drag_data_received): Check to + make sure we have valid data. + 2001-08-21 Christopher James Lahey <clahey@ximian.com> * Revert fix for Ximian bug #6995. diff --git a/mail/component-factory.c b/mail/component-factory.c index c8652721e2..c197827fc1 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -451,6 +451,10 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des if (action == GNOME_Evolution_ShellComponentDnd_ACTION_LINK) return FALSE; /* we can't create links */ + /* this means the drag was cancelled */ + if (!data->bytes._buffer || data->bytes._length == -1) + return FALSE; + uri = camel_url_new (physical_uri, NULL); noselect = uri ? camel_url_get_param (uri, "noselect") : NULL; if (noselect && !g_strcasecmp (noselect, "yes")) { diff --git a/mail/folder-browser.c b/mail/folder-browser.c index bc0dd26175..d54c658450 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -443,6 +443,10 @@ message_list_drag_data_received (ETree *tree, int row, ETreePath path, int col, CamelURL *uri; int i, fd; + /* this means we are receiving no data */ + if (!selection_data->data || selection_data->length == -1) + return; + camel_exception_init (&ex); switch (info) { @@ -599,7 +603,7 @@ selection_received (GtkWidget *widget, GtkSelectionData *selection_data, CamelFolder *source = NULL; GPtrArray *uids = NULL; - if (selection_data == NULL) + if (selection_data == NULL || selection_data->length == -1) return; source = x_evolution_message_parse (selection_data->data, selection_data->length, &uids); diff --git a/mail/message-list.c b/mail/message-list.c index 12deb78495..16b1ec0fc5 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1279,9 +1279,9 @@ clear_tree (MessageList *ml) /* we also reset the uid_rowmap since it is no longer useful/valid anyway */ if (ml->folder) - g_hash_table_foreach(ml->uid_nodemap, (GHFunc)clear_info, ml); + g_hash_table_foreach (ml->uid_nodemap, (GHFunc)clear_info, ml); g_hash_table_destroy (ml->uid_nodemap); - ml->uid_nodemap = g_hash_table_new(g_str_hash, g_str_equal); + ml->uid_nodemap = g_hash_table_new (g_str_hash, g_str_equal); if (ml->tree_root) { /* we should be frozen already */ @@ -2083,12 +2083,12 @@ message_list_foreach (MessageList *message_list, /* set whether we are in threaded view or flat view */ void -message_list_set_threaded(MessageList *ml, gboolean threaded) +message_list_set_threaded (MessageList *ml, gboolean threaded) { if (ml->threaded != threaded) { ml->threaded = threaded; - - mail_regen_list(ml, ml->search, NULL, NULL); + + mail_regen_list (ml, ml->search, NULL, NULL); } } |