]> spindle.queued.net Git - midori/commitdiff
Move code to delete selected item from button handler into separate function
authorEnrico Tröger <enrico.troeger@uvena.de>
Wed, 30 Dec 2009 21:55:26 +0000 (22:55 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 30 Dec 2009 22:52:20 +0000 (23:52 +0100)
extensions/cookie-manager/cookie-manager-page.c

index b5e40e6772f527518d35e24e26c0eabbf46b7872..c953caed3902f7d1b280051b9fa4551a679026e5 100644 (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;
        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;