[shotwell/wip/gtk4: 28/94] Fix commandline arguments




commit db2145b105042aa6e26b41a37f6d7b923575b199
Author: Jens Georg <mail jensge org>
Date:   Mon Apr 4 17:23:15 2022 +0200

    Fix commandline arguments

 src/main.vala | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/main.vala b/src/main.vala
index 74a10f01..9c25cf34 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -382,11 +382,12 @@ void main(string[] args) {
             "/data/gsettings", true);
     }
 
-    // init GTK (valac has already called g_threads_init())
+    Gtk.init();
     try {
-        Gtk.init (); //_with_args(ref args, _("[FILE]"), CommandlineOptions.entries,
-            // TODO Resources.APP_GETTEXT_PACKAGE);
-
+        // TODO: Let GApplication handle the arguments
+        var context = new GLib.OptionContext("");
+        context.add_main_entries (CommandlineOptions.entries, Resources.APP_GETTEXT_PACKAGE);
+        context.parse(ref args);
     } catch (Error e) {
         print(e.message + "\n");
         print(_("Run “%s --help” to see a full list of available command line options.\n"), args[0]);


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