diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-06-15 17:12:25 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-06-15 17:12:25 +0800 |
commit | 53471bc2f89c2844c7bb81b41575ee253c1f6516 (patch) | |
tree | c0cd77ac84fa5513084550b099692a8728483a5f /src | |
parent | 47945195e7761d3bea395205b397cce2934c5f93 (diff) | |
download | gsoc2013-epiphany-53471bc2f89c2844c7bb81b41575ee253c1f6516.tar gsoc2013-epiphany-53471bc2f89c2844c7bb81b41575ee253c1f6516.tar.gz gsoc2013-epiphany-53471bc2f89c2844c7bb81b41575ee253c1f6516.tar.bz2 gsoc2013-epiphany-53471bc2f89c2844c7bb81b41575ee253c1f6516.tar.lz gsoc2013-epiphany-53471bc2f89c2844c7bb81b41575ee253c1f6516.tar.xz gsoc2013-epiphany-53471bc2f89c2844c7bb81b41575ee253c1f6516.tar.zst gsoc2013-epiphany-53471bc2f89c2844c7bb81b41575ee253c1f6516.zip |
Rewritten, fixing mem leaks.
2003-06-15 Christian Persch <chpe@cvs.gnome.org>
* src/window-commands.c: (window_cmd_tabs_next),
(window_cmd_tabs_previous):
Rewritten, fixing mem leaks.
Diffstat (limited to 'src')
-rw-r--r-- | src/window-commands.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/window-commands.c b/src/window-commands.c index e870716a1..54bf1d55b 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -814,21 +814,18 @@ void window_cmd_tabs_next (EggAction *action, EphyWindow *window) { - GList *tabs; - EphyTab *tab; + GtkNotebook *nb; + gint page; - tab = ephy_window_get_active_tab (window); - tabs = ephy_window_get_tabs (window); - g_return_if_fail (tab != NULL); + nb = GTK_NOTEBOOK (ephy_window_get_notebook (window)); + g_return_if_fail (nb != NULL); - tabs = g_list_find (tabs, (gpointer)tab); - tabs = tabs->next; + page = gtk_notebook_get_current_page (nb); + g_return_if_fail (page != -1); - if (tabs) + if (page < gtk_notebook_get_n_pages (nb) - 1) { - tab = EPHY_TAB (tabs->data); - ephy_window_jump_to_tab (window, tab); - g_list_free (tabs); + gtk_notebook_set_current_page (nb, page + 1); } } @@ -836,21 +833,18 @@ void window_cmd_tabs_previous (EggAction *action, EphyWindow *window) { - GList *tabs; - EphyTab *tab; + GtkNotebook *nb; + gint page; - tab = ephy_window_get_active_tab (window); - tabs = ephy_window_get_tabs (window); - g_return_if_fail (tab != NULL); + nb = GTK_NOTEBOOK (ephy_window_get_notebook (window)); + g_return_if_fail (nb != NULL); - tabs = g_list_find (tabs, (gpointer)tab); - tabs = tabs->prev; + page = gtk_notebook_get_current_page (nb); + g_return_if_fail (page != -1); - if (tabs) + if (page > 0) { - tab = EPHY_TAB (tabs->data); - ephy_window_jump_to_tab (window, tab); - g_list_free (tabs); + gtk_notebook_set_current_page (nb, page - 1); } } |