aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-23 05:43:02 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-23 05:43:02 +0800
commit64ff5c590db02cddccc6088162747c2b69ccd87d (patch)
tree7977055823b9348f83fd663d9e9f24b595f9b488 /src/ephy-notebook.c
parent2fca0657c1b30df95f4c7cc4d7d8801f4c6ff703 (diff)
downloadgsoc2013-epiphany-64ff5c590db02cddccc6088162747c2b69ccd87d.tar
gsoc2013-epiphany-64ff5c590db02cddccc6088162747c2b69ccd87d.tar.gz
gsoc2013-epiphany-64ff5c590db02cddccc6088162747c2b69ccd87d.tar.bz2
gsoc2013-epiphany-64ff5c590db02cddccc6088162747c2b69ccd87d.tar.lz
gsoc2013-epiphany-64ff5c590db02cddccc6088162747c2b69ccd87d.tar.xz
gsoc2013-epiphany-64ff5c590db02cddccc6088162747c2b69ccd87d.tar.zst
gsoc2013-epiphany-64ff5c590db02cddccc6088162747c2b69ccd87d.zip
Remove ephy_string_parse_uri_list, and use new glib function
2004-10-22 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-string.c: (ephy_string_double_underscores): * lib/ephy-string.h: * lib/widgets/ephy-node-view.c: (drag_data_received_cb): * src/bookmarks/ephy-bookmarks-editor.c: (node_dropped_cb): * src/ephy-notebook.c: (notebook_drag_data_received_cb): * src/ephy-window.c: (ephy_window_load_in_tabs): * src/ephy-window.h: Remove ephy_string_parse_uri_list, and use new glib function g_uri_list_extract_uris() instead.
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 00fa0cd35..fef660489 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -593,8 +593,7 @@ notebook_drag_data_received_cb (GtkWidget* widget, GdkDragContext *context,
gint x, gint y, GtkSelectionData *selection_data,
guint info, guint time, EphyTab *tab)
{
- GList *uri_list = NULL;
- gchar **tmp;
+ EphyWindow *window;
g_signal_stop_emission_by_name (widget, "drag_data_received");
@@ -602,37 +601,39 @@ notebook_drag_data_received_cb (GtkWidget* widget, GdkDragContext *context,
if (selection_data->length <= 0 || selection_data->data == NULL) return;
+ window = EPHY_WINDOW (gtk_widget_get_toplevel (widget));
+
if (selection_data->target == gdk_atom_intern (EPHY_DND_URL_TYPE, FALSE))
{
+ char *uris[2] = { NULL, NULL };
+ char **split;
+
/* URL_TYPE has format: url \n title */
- tmp = g_strsplit (selection_data->data, "\n", 2);
- if (tmp != NULL && tmp[0] != NULL)
+ split = g_strsplit (selection_data->data, "\n", 2);
+ if (split != NULL && split[0] != NULL)
{
- uri_list = g_list_prepend (uri_list, g_strdup (tmp[0]));
+ uris[0] = split[0];
+ ephy_window_load_in_tabs (window, tab, uris);
}
-
- g_strfreev (tmp);
+ g_strfreev (split);
}
else if (selection_data->target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE))
{
- uri_list = ephy_string_parse_uri_list (selection_data->data);
+ char **uris;
+
+ uris = g_uri_list_extract_uris (selection_data->data);
+
+ if (uris != NULL)
+ {
+ ephy_window_load_in_tabs (window, tab, uris);
+
+ g_strfreev (uris);
+ }
}
else
{
g_return_if_reached ();
}
-
- 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);
-
- g_list_foreach (uri_list, (GFunc) g_free, NULL);
- g_list_free (uri_list);
- }
}
/*