[gnome-terminal] client: legacy: Fall back to default profile



commit 72fc6c497e583e8ee32c2138be678cef1691096f
Author: Iain Lane <laney ubuntu com>
Date:   Wed Apr 1 20:53:22 2015 +0200

    client: legacy: Fall back to default profile
    
    When using a nonexistent profile name or ID, fall back to the default
    profile, for compatibility with gnome-terminal < 3.8.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747106

 src/terminal-options.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/terminal-options.c b/src/terminal-options.c
index d12b2d7..a3e01df 100644
--- a/src/terminal-options.c
+++ b/src/terminal-options.c
@@ -319,7 +319,16 @@ option_profile_cb (const gchar *option_name,
   profile = terminal_profiles_list_dup_uuid_or_name (terminal_options_ensure_profiles_list (options),
                                                      value, error);
   if (profile == NULL)
-    return FALSE;
+  {
+      g_printerr ("Profile '%s' specified but not found. Attempting to fall back "
+                  "to the default profile.\n", value);
+      g_clear_error (error);
+      profile = terminal_profiles_list_dup_uuid_or_name (terminal_options_ensure_profiles_list (options),
+                                                         NULL, error);
+  }
+
+  if (profile == NULL)
+      return FALSE;
 
   if (options->initial_windows)
     {
@@ -379,6 +388,16 @@ option_window_callback (const gchar *option_name,
 
   profile = terminal_profiles_list_dup_uuid_or_name (terminal_options_ensure_profiles_list (options),
                                                      value, error);
+
+  if (value && profile == NULL)
+  {
+      g_printerr ("Profile '%s' specified but not found. Attempting to fall back "
+                  "to the default profile.\n", value);
+      g_clear_error (error);
+      profile = terminal_profiles_list_dup_uuid_or_name (terminal_options_ensure_profiles_list (options),
+                                                         NULL, error);
+  }
+
   if (profile == NULL)
     return FALSE;
 


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