Move code to delete selected item from button handler into separate function

This commit is contained in:
Enrico Tröger 2009-12-30 22:55:26 +01:00 committed by Christian Dywan
parent b98064d0b6
commit c91cc72505

View file

@ -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; GtkTreeIter iter, iter_store, child;
GtkTreeModel *model; 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) 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 && ! if (event->keyval == GDK_Delete && !
(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK))) (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 TRUE;
} }
return FALSE; return FALSE;