[gtk+] filechooser: In testfilechooser, be strict about the --action option



commit 8d4741042672cfa57ee5050ccb4fe06fa75289c0
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Jun 21 10:19:54 2013 -0500

    filechooser: In testfilechooser, be strict about the --action option
    
    It would default to GTK_FILE_CHOOSER_ACTION_OPEN if the user's specified --action could not be
    parsed.  I can never remember what the right options are, so make the program bail out
    if the user specifies an unrecognized option.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 tests/testfilechooser.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c
index 7959411..90cacfb 100644
--- a/tests/testfilechooser.c
+++ b/tests/testfilechooser.c
@@ -566,6 +566,11 @@ main (int argc, char **argv)
        action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
       else if (! strcmp ("create_folder", action_arg))
        action = GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER;
+      else
+       {
+         g_print ("--action must be one of \"open\", \"save\", \"select_folder\", \"create_folder\"\n");
+         return 1;
+       }
 
       g_free (action_arg);
     }


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