[easytag] Remove unneccesary key-press-event signal handlers



commit e0442b607de8bc5c67357a8ad7137920201313a8
Author: David King <amigadave amigadave com>
Date:   Tue Jun 11 19:00:37 2013 +0100

    Remove unneccesary key-press-event signal handlers
    
    GtkDialog handles the Escape key being pressed without the need for a
    custom handler.

 src/cddb.c |   21 ---------------------
 src/misc.c |   21 ---------------------
 2 files changed, 0 insertions(+), 42 deletions(-)
---
diff --git a/src/cddb.c b/src/cddb.c
index 4ae54fd..0ae4aed 100644
--- a/src/cddb.c
+++ b/src/cddb.c
@@ -143,7 +143,6 @@ static gboolean CddbStopSearch = FALSE;
  **************/
 static gboolean Cddb_Destroy_Window (GtkWidget *widget, GdkEvent *event,
                                      gpointer data);
-static gboolean Cddb_Window_Key_Press (GtkWidget *window, GdkEvent *event);
 static void Cddb_Show_Album_Info (GtkTreeSelection *selection, gpointer data);
 
 static gboolean Cddb_Free_Album_List (void);
@@ -243,7 +242,6 @@ void Open_Cddb_Window (void)
     gtk_window_set_default_size(GTK_WINDOW(CddbWindow),CDDB_WINDOW_WIDTH,CDDB_WINDOW_HEIGHT);
 
     g_signal_connect(G_OBJECT(CddbWindow),"delete_event", G_CALLBACK(Cddb_Destroy_Window),NULL);
-    g_signal_connect(G_OBJECT(CddbWindow),"key_press_event", G_CALLBACK(Cddb_Window_Key_Press),NULL);
 
     VBox = gtk_dialog_get_content_area (GTK_DIALOG (CddbWindow));
     gtk_container_set_border_width (GTK_CONTAINER (CddbWindow), BOX_SPACING);
@@ -909,25 +907,6 @@ void Cddb_Window_Apply_Changes (void)
 }
 
 
-static gboolean
-Cddb_Window_Key_Press (GtkWidget *window, GdkEvent *event)
-{
-    GdkEventKey *kevent;
-
-    if (event && event->type == GDK_KEY_PRESS)
-    {
-        kevent = (GdkEventKey *)event;
-        switch(kevent->keyval)
-        {
-            case GDK_KEY_Escape:
-                Cddb_Destroy_Window(window, event, NULL);
-                break;
-        }
-    }
-    return FALSE;
-}
-
-
 static void
 Cddb_Search_In_All_Fields_Check_Button_Toggled (void)
 {
diff --git a/src/misc.c b/src/misc.c
index 8cf0fdb..f666cf4 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -156,8 +156,6 @@ static void Playlist_Convert_Forwardslash_Into_Backslash (const gchar *string);
 
 void Open_Search_File_Window          (void);
 static void Destroy_Search_File_Window (void);
-static gboolean Search_File_Window_Key_Press (GtkWidget *window,
-                                              GdkEvent *event);
 static void Search_File (GtkWidget *search_button);
 static void Add_Row_To_Search_Result_List (ET_File *ETFile,
                                            const gchar *string_to_search);
@@ -1942,7 +1940,6 @@ void Open_Search_File_Window (void)
     gtk_window_set_title (GTK_WINDOW (SearchFileWindow), _("Find Files"));
     g_signal_connect(G_OBJECT(SearchFileWindow),"destroy", G_CALLBACK(Destroy_Search_File_Window),NULL);
     g_signal_connect(G_OBJECT(SearchFileWindow),"delete_event", G_CALLBACK(Destroy_Search_File_Window),NULL);
-    g_signal_connect(G_OBJECT(SearchFileWindow),"key_press_event", 
G_CALLBACK(Search_File_Window_Key_Press),NULL);
     gtk_window_set_default_size(GTK_WINDOW(SearchFileWindow),SEARCH_WINDOW_WIDTH,SEARCH_WINDOW_HEIGHT);
 
     VBox = gtk_dialog_get_content_area (GTK_DIALOG (SearchFileWindow));
@@ -2279,24 +2276,6 @@ void Search_File_Window_Apply_Changes (void)
     }
 }
 
-static gboolean
-Search_File_Window_Key_Press (GtkWidget *window, GdkEvent *event)
-{
-    GdkEventKey *kevent;
-
-    if (event && event->type == GDK_KEY_PRESS)
-    {
-        kevent = (GdkEventKey *)event;
-        switch(kevent->keyval)
-        {
-            case GDK_KEY_Escape:
-                Destroy_Search_File_Window();
-                break;
-        }
-    }
-    return FALSE;
-}
-
 /*
  * This function and the one below could do with improving
  * as we are looking up tag data twice (once when searching, once when adding to list)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]