[gnome-terminal] client: legacy: Abort when passed --disable-factory



commit aef122c916719763f6d0d404b4131456d84c482f
Author: Christian Persch <chpe gnome org>
Date:   Thu Sep 12 19:42:08 2013 +0200

    client: legacy: Abort when passed --disable-factory
    
    This option isn't working anymore, and shouldn't silently use the
    server instead of a new process.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707899

 src/terminal-options.c |   38 +++++++++++++++++++-------------------
 src/terminal-options.h |    1 -
 2 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/src/terminal-options.c b/src/terminal-options.c
index 95b33c4..4967d44 100644
--- a/src/terminal-options.c
+++ b/src/terminal-options.c
@@ -223,9 +223,23 @@ unsupported_option_callback (const gchar *option_name,
 {
   g_printerr (_("Option \"%s\" is no longer supported in this version of gnome-terminal."),
               option_name);
+  g_printerr ("\n");
   return TRUE; /* we do not want to bail out here but continue */
 }
 
+static gboolean
+unsupported_option_fatal_callback (const gchar *option_name,
+                                   const gchar *value,
+                                   gpointer     data,
+                                   GError     **error)
+{
+  g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_UNKNOWN_OPTION,
+               _("Option \"%s\" is no longer supported in this version of gnome-terminal."),
+               option_name);
+  return FALSE;
+}
+
+
 static gboolean G_GNUC_NORETURN
 option_version_cb (const gchar *option_name,
                    const gchar *value,
@@ -555,19 +569,6 @@ option_geometry_callback (const gchar *option_name,
 }
 
 static gboolean
-option_disable_factory_callback (const gchar *option_name,
-                                 const gchar *value,
-                                 gpointer     data,
-                                 GError     **error)
-{
-  TerminalOptions *options = data;
-
-  options->use_factory = FALSE;
-
-  return TRUE;
-}
-
-static gboolean
 option_load_config_cb (const gchar *option_name,
                        const gchar *value,
                        gpointer     data,
@@ -782,7 +783,6 @@ terminal_options_parse (const char *working_directory,
   options->default_fullscreen = FALSE;
   options->default_maximize = FALSE;
   options->execute = FALSE;
-  options->use_factory = TRUE;
 
   options->startup_id = g_strdup (startup_id && startup_id[0] ? startup_id : NULL);
   options->display_name = NULL;
@@ -1018,9 +1018,9 @@ get_goption_context (TerminalOptions *options)
     {
       "disable-factory",
       0,
-      G_OPTION_FLAG_NO_ARG,
+      G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN,
       G_OPTION_ARG_CALLBACK,
-      option_disable_factory_callback,
+      unsupported_option_fatal_callback,
       N_("Do not register with the activation nameserver, do not re-use an active terminal"),
       NULL
     },
@@ -1235,9 +1235,9 @@ get_goption_context (TerminalOptions *options)
     {
       "use-factory",
       0,
-      G_OPTION_FLAG_HIDDEN,
-      G_OPTION_ARG_NONE,
-      &options->use_factory,
+      G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN,
+      G_OPTION_ARG_CALLBACK,
+      unsupported_option_callback,
       NULL, NULL
     },
     {
diff --git a/src/terminal-options.h b/src/terminal-options.h
index 709c6d3..a1e645b 100644
--- a/src/terminal-options.h
+++ b/src/terminal-options.h
@@ -81,7 +81,6 @@ typedef struct
   gboolean default_profile_is_id;
 
   gboolean  execute;
-  gboolean  use_factory;
   double    zoom;
 
   gboolean sm_client_disable;


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