[devhelp] App: better implement ::handle_local_options



commit abf8acf0528ecf41b5dba76e628569dc3e8c92c9
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Dec 17 19:47:38 2017 +0100

    App: better implement ::handle_local_options
    
    "return 0" will exit the process.

 src/dh-app.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/dh-app.c b/src/dh-app.c
index 3ff90b5..5f231f3 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -21,7 +21,6 @@
 
 #include "config.h"
 #include "dh-app.h"
-#include <stdlib.h>
 #include <glib/gi18n-lib.h>
 #include "dh-assistant.h"
 #include "dh-preferences.h"
@@ -344,13 +343,12 @@ static gint
 dh_app_handle_local_options (GApplication *app,
                              GVariantDict *local_options)
 {
-  if (option_version)
-    {
-      g_print ("%s %s\n", g_get_application_name (), PACKAGE_VERSION);
-      exit (0);
-    }
+        if (option_version) {
+                g_print ("%s %s\n", g_get_application_name (), PACKAGE_VERSION);
+                return 0;
+        }
 
-  return -1;
+        return -1;
 }
 
 static gint


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