diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-08-06 22:34:43 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-08-06 22:34:43 +0800 |
commit | 54f1919cae74d3551c23eef9d00975344d1c78a9 (patch) | |
tree | 817546aea8161746bcf5f1eb4aabfec0d4d0ec18 /src | |
parent | 394409d0ccca365dd8d9e8a29752d2fb27cb7bbe (diff) | |
download | gsoc2013-epiphany-54f1919cae74d3551c23eef9d00975344d1c78a9.tar gsoc2013-epiphany-54f1919cae74d3551c23eef9d00975344d1c78a9.tar.gz gsoc2013-epiphany-54f1919cae74d3551c23eef9d00975344d1c78a9.tar.bz2 gsoc2013-epiphany-54f1919cae74d3551c23eef9d00975344d1c78a9.tar.lz gsoc2013-epiphany-54f1919cae74d3551c23eef9d00975344d1c78a9.tar.xz gsoc2013-epiphany-54f1919cae74d3551c23eef9d00975344d1c78a9.tar.zst gsoc2013-epiphany-54f1919cae74d3551c23eef9d00975344d1c78a9.zip |
Fix dragging of urls which gnome-vfs can't handle. Fix new tab positioning
2004-08-06 Christian Persch <chpe@cvs.gnome.org>
* 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.
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 1 | ||||
-rw-r--r-- | src/ephy-notebook.c | 21 | ||||
-rw-r--r-- | src/ephy-notebook.h | 5 | ||||
-rw-r--r-- | src/ephy-session.c | 4 | ||||
-rw-r--r-- | src/ephy-shell.c | 20 | ||||
-rw-r--r-- | src/ephy-tab.c | 2 | ||||
-rw-r--r-- | src/ephy-window.c | 12 |
7 files changed, 24 insertions, 41 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 98b6adf63..74de22a34 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -44,7 +44,6 @@ #include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> #include <libgnomeui/gnome-stock-icons.h> -#include <libgnomevfs/gnome-vfs-uri.h> #include <string.h> #include "ephy-bookmarks-editor.h" 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); } } diff --git a/src/ephy-notebook.h b/src/ephy-notebook.h index 5094dd842..60ede5616 100644 --- a/src/ephy-notebook.h +++ b/src/ephy-notebook.h @@ -41,11 +41,6 @@ typedef struct EphyNotebookClass EphyNotebookClass; typedef struct EphyNotebook EphyNotebook; typedef struct EphyNotebookPrivate EphyNotebookPrivate; -enum -{ - EPHY_NOTEBOOK_ADD_LAST = -1 -}; - struct EphyNotebook { GtkNotebook parent; diff --git a/src/ephy-session.c b/src/ephy-session.c index 78f4142bb..c82dccb96 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2002 Jorn Baayen - * Copyright (C) 2003 Marco Pesenti Gritti - * Copyright (C) 2003 Christian Persch + * Copyright (C) 2003, 2004 Marco Pesenti Gritti + * Copyright (C) 2003, 2004 Christian Persch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 1d709d9eb..85edfaf21 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -549,7 +549,7 @@ ephy_shell_new_tab (EphyShell *shell, gboolean jump_to; EphyEmbed *previous_embed = NULL; GtkWidget *nb; - gint position; + int position = -1; Toolbar *toolbar; if (flags & EPHY_NEW_TAB_IN_NEW_WINDOW) in_new_window = TRUE; @@ -557,7 +557,7 @@ ephy_shell_new_tab (EphyShell *shell, in_new_window = in_new_window && !eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN); - jump_to = (flags & EPHY_NEW_TAB_JUMP); + jump_to = (flags & EPHY_NEW_TAB_JUMP) != 0; if (!in_new_window && parent_window != NULL) { @@ -570,30 +570,24 @@ ephy_shell_new_tab (EphyShell *shell, toolbar = EPHY_TOOLBAR (ephy_window_get_toolbar (window)); - if (previous_tab) + if (previous_tab != NULL) { previous_embed = ephy_tab_get_embed (previous_tab); } - if ((flags & EPHY_NEW_TAB_APPEND_AFTER) && previous_embed != NULL) + if ((flags & EPHY_NEW_TAB_APPEND_AFTER) && previous_tab != NULL) { nb = ephy_window_get_notebook (window); position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), - GTK_WIDGET (previous_embed)) + 1; - } - else - { - position = EPHY_NOTEBOOK_ADD_LAST; + GTK_WIDGET (previous_tab)) + 1; } tab = ephy_tab_new (); gtk_widget_show (GTK_WIDGET (tab)); embed = ephy_tab_get_embed (tab); - ephy_window_add_tab (window, tab, - position, - jump_to); - gtk_widget_show (GTK_WIDGET(window)); + ephy_window_add_tab (window, tab, position, jump_to); + gtk_window_present (GTK_WINDOW (window)); if (flags & EPHY_NEW_TAB_HOME_PAGE || flags & EPHY_NEW_TAB_NEW_PAGE) diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 078c7c9d7..82b80eab8 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -1262,7 +1262,7 @@ ephy_tab_new_window_cb (EphyEmbed *embed, EphyEmbed **new_embed, new_tab = ephy_tab_new (); gtk_widget_show (GTK_WIDGET (new_tab)); - ephy_window_add_tab (window, new_tab, EPHY_NOTEBOOK_ADD_LAST, FALSE); + ephy_window_add_tab (window, new_tab, -1, FALSE); *new_embed = ephy_tab_get_embed (new_tab); diff --git a/src/ephy-window.c b/src/ephy-window.c index 7ec311d48..d24f13800 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2793,12 +2793,13 @@ ephy_window_set_zoom (EphyWindow *window, } void -ephy_window_load_in_tabs (EphyWindow *window, EphyTab *tab, GList *uri_list) +ephy_window_load_in_tabs (EphyWindow *window, + EphyTab *tab, + GList *uri_list) { EphyEmbed *embed = NULL; GList *l; guint num = 0; - GnomeVFSURI *uri; if (tab != NULL) { @@ -2809,10 +2810,7 @@ ephy_window_load_in_tabs (EphyWindow *window, EphyTab *tab, GList *uri_list) l = uri_list; while (l != NULL && num < INSANE_NUMBER_OF_URLS) { - gchar *url = NULL; - - uri = (GnomeVFSURI*) l->data; - url = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE); + const char *url = l->data; if (num == 0 && embed != NULL) { @@ -2832,8 +2830,6 @@ ephy_window_load_in_tabs (EphyWindow *window, EphyTab *tab, GList *uri_list) EPHY_NEW_TAB_APPEND_LAST)); } - g_free (url); - url = NULL; l = l->next; ++num; } |