Commit acf919c4 authored by Allison Karlitskaya's avatar Allison Karlitskaya

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
parent 751165fb
......@@ -919,7 +919,6 @@ main (int argc,
GApplication *app;
gint retval;
GError *error = NULL;
GOptionContext *ctx;
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);
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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment