From: Enrico Tröger Date: Wed, 30 Dec 2009 21:55:26 +0000 (+0100) Subject: Move code to delete selected item from button handler into separate function X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c91cc72505ace55aa9e0c0b0e729bfb758a9e97c;p=midori Move code to delete selected item from button handler into separate function --- 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;