From c91cc72505ace55aa9e0c0b0e729bfb758a9e97c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Enrico=20Tr=C3=B6ger?= Date: Wed, 30 Dec 2009 22:55:26 +0100 Subject: [PATCH] Move code to delete selected item from button handler into separate function --- extensions/cookie-manager/cookie-manager-page.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/cookie-manager/cookie-manager-page.c b/extensions/cookie-manager/cookie-manager-page.c index b5e40e67..c953caed 100644 --- a/extensions/cookie-manager/cookie-manager-page.c +++ b/extensions/cookie-manager/cookie-manager-page.c @@ -343,7 +343,7 @@ static void cm_delete_cookie(CookieManagerPage *cmp, GtkTreeModel *model, GtkTre } -static void cm_button_delete_clicked_cb(GtkToolButton *button, CookieManagerPage *cmp) +static void cm_delete_item(CookieManagerPage *cmp) { GtkTreeIter iter, iter_store, child; GtkTreeModel *model; @@ -411,6 +411,11 @@ static void cm_button_delete_clicked_cb(GtkToolButton *button, CookieManagerPage } } +static void cm_button_delete_clicked_cb(GtkToolButton *button, CookieManagerPage *cmp) +{ + cm_delete_item(cmp); +} + static void cm_delete_all_cookies_real(CookieManagerPage *cmp) { @@ -766,7 +771,7 @@ static gboolean cm_tree_key_press_cb(GtkWidget *widget, GdkEventKey *event, Cook if (event->keyval == GDK_Delete && ! (event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK))) { - cm_button_delete_clicked_cb(NULL, cmp); + cm_delete_item(cmp); return TRUE; } return FALSE; -- 2.39.5