[gnome-commander/gcmd-1-3] GnomeCmdFileSelector: simplify on_list_key_pressed()



commit e3264f5d3d0cdaab5d6a7124b457f7e7cbabcd90
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Mon Jul 27 20:19:19 2009 +0200

    GnomeCmdFileSelector: simplify on_list_key_pressed()

 src/gnome-cmd-file-selector.cc |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index d094608..59d3fc8 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -1090,21 +1090,15 @@ static void on_dir_list_failed (GnomeCmdDir *dir, GnomeVFSResult result, GnomeCm
 // This function should only be called for input made when the file-selector was focused
 static gboolean on_list_key_pressed (GtkCList *clist, GdkEventKey *event, GnomeCmdFileSelector *fs)
 {
-    gboolean ret = FALSE;
-
-    if (fs->file_list()->key_pressed(event))
-        ret = TRUE;
-    else if (fs->key_pressed(event))
-        ret = TRUE;
-    else if (main_win->key_pressed(event))
-        ret = TRUE;
-    else if (gcmd_user_actions.handle_key_event(main_win, fs->file_list(), event))
-        ret = TRUE;
+    if (!fs->file_list()->key_pressed(event) &&
+        !fs->key_pressed(event) &&
+        !main_win->key_pressed(event) &&
+        !gcmd_user_actions.handle_key_event(main_win, fs->file_list(), event))
+        return FALSE;
 
-    if (ret)
-        stop_kp (GTK_OBJECT (clist));
+    stop_kp (GTK_OBJECT (clist));
 
-    return ret;
+    return TRUE;
 }
 
 



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