diff options
| author | Allison Ryan Lortie <desrt@desrt.ca> | 2016-04-25 07:44:35 (GMT) |
|---|---|---|
| committer | Allison Ryan Lortie <desrt@desrt.ca> | 2016-04-25 07:48:55 (GMT) |
| commit | acf919c43cf0e7700aaf05931f424843ce4b29dd (patch) | |
| tree | 5e007d8254bf2cd221479175152e3e15460aad3c | |
| parent | 751165fb7b1172718523ec2b536087c4c1d99179 (diff) | |
| download | gnome-font-viewer-acf919c43cf0e7700aaf05931f424843ce4b29dd.zip gnome-font-viewer-acf919c43cf0e7700aaf05931f424843ce4b29dd.tar.xz | |
font-view: use GApplication commandline handling
Use GApplication's internal handling of commandline arguments. This
means that --gapplication-service (which we depend on for DBus
activation) will be properly supported.
The only reason this was working before is because we were not actually
being D-Bus activated due to having a '-' in our app id. With the fix
of bug 764754 this is no longer the case, and gnome-font-viewer will be
broken.
https://bugzilla.gnome.org/show_bug.cgi?id=765518
| -rw-r--r-- | src/font-view.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/font-view.c b/src/font-view.c index 97fdc90..8a30f2d 100644 --- a/src/font-view.c +++ b/src/font-view.c @@ -919,7 +919,6 @@ main (int argc, GApplication *app; gint retval; GError *error = NULL; - GOptionContext *ctx; bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -928,27 +927,8 @@ main (int argc, if (!FcInit ()) g_critical ("Can't initialize fontconfig library"); - ctx = g_option_context_new (_("[FILE...]")); - g_option_context_add_main_entries (ctx, goption_options, PACKAGE); - g_option_context_add_group (ctx, gtk_get_option_group (FALSE)); - - if (!g_option_context_parse (ctx, &argc, &argv, &error)) { - gchar *help_msg; - - /* I18N: The '%s' is replaced with the command name. */ - help_msg = g_strdup_printf (_("Run '%s --help' to see a full " - "list of available command line " - "options."), argv[0]); - g_printerr ("%s\n%s\n", error->message, help_msg); - g_error_free (error); - g_free (help_msg); - g_option_context_free (ctx); - - return EXIT_FAILURE; - } - g_option_context_free (ctx); - app = font_view_application_new (); + g_application_add_main_option_entries (app, goption_options); retval = g_application_run (app, argc, argv); g_object_unref (app); |