From 54f1919cae74d3551c23eef9d00975344d1c78a9 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 6 Aug 2004 14:34:43 +0000 Subject: Fix dragging of urls which gnome-vfs can't handle. Fix new tab positioning 2004-08-06 Christian Persch * lib/ephy-string.c: (ephy_string_parse_uri_list): * lib/ephy-string.h: * lib/widgets/ephy-node-view.c: (drag_data_received_cb), (ephy_node_view_class_init): * src/bookmarks/ephy-bookmarks-editor.c: * src/ephy-notebook.c: (notebook_drag_data_received_cb): * src/ephy-notebook.h: * src/ephy-session.c: * src/ephy-shell.c: (ephy_shell_new_tab): * src/ephy-tab.c: (ephy_tab_new_window_cb): * src/ephy-window.c: (ephy_window_load_in_tabs): Fix dragging of urls which gnome-vfs can't handle. Fix new tab positioning when opening tabs from drags. --- src/ephy-notebook.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/ephy-notebook.c') diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index e55fdc03f..38c8a8c07 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -606,33 +606,32 @@ notebook_drag_data_received_cb (GtkWidget* widget, GdkDragContext *context, { /* URL_TYPE has format: url \n title */ tmp = g_strsplit (selection_data->data, "\n", 2); - if (tmp) + if (tmp != NULL && tmp[0] != NULL) { - uri = gnome_vfs_uri_new (tmp[0]); - if (uri) - { - uri_list = g_list_append (uri_list, uri); - } - g_strfreev (tmp); + uri_list = g_list_prepend (uri_list, g_strdup (tmp[0])); } + + g_strfreev (tmp); } else if (selection_data->target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE)) { - uri_list = gnome_vfs_uri_list_parse (selection_data->data); + uri_list = ephy_string_parse_uri_list (selection_data->data); } else { - g_assert_not_reached (); + g_return_if_reached (); } - if (uri_list) + if (uri_list != NULL) { EphyWindow *window; window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (widget))); ephy_window_load_in_tabs (window, tab, uri_list); - gnome_vfs_uri_list_free (uri_list); + + g_list_foreach (uri_list, (GFunc) g_free, NULL); + g_list_free (uri_list); } } -- cgit v1.2.3