[totem] browser-plugin: Move options checking to a separate function



commit 0a9071f35d6fa5c9c9a9b4fd620e021d0122afa6
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Mar 22 10:52:24 2013 +0100

    browser-plugin: Move options checking to a separate function
    
    And remove associated FIXME.

 browser-plugin/totem-plugin-viewer.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index a9b392e..84f15d6 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -2107,6 +2107,17 @@ static GOptionEntry option_entries [] =
 
 #include "totem-plugin-viewer-interface.h"
 
+static gboolean
+check_options (void)
+{
+       if (arg_plugin_type == TOTEM_PLUGIN_TYPE_LAST) {
+               g_warning ("Plugin type is required\n");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
 int main (int argc, char **argv)
 {
        GOptionContext *context;
@@ -2217,11 +2228,8 @@ int main (int argc, char **argv)
                g_log_set_always_fatal (fatal_mask);
        }
 
-        // FIXME check that ALL necessary params were given!
-       if (arg_plugin_type == TOTEM_PLUGIN_TYPE_LAST) {
-               g_warning ("Plugin type is required\n");
+       if (!check_options ())
                exit (1);
-       }
 
        dbus_g_object_type_install_info (TOTEM_TYPE_EMBEDDED,
                                         &dbus_glib_totem_embedded_object_info);


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