[mutter/wip/display-no-wayland: 3/33] main: remove a lot of code to handle wrong theme config



commit 1fdb161f54431a5a852127b30d5e02827738c246
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Mon May 20 00:18:40 2013 +0200

    main: remove a lot of code to handle wrong theme config
    
    mutter has a hard dependency on gnome-themes-standard, which
    provides the Adwaita theme. If that is not satisfied, it is
    a distribution problem, so we can just fail (and let the
    automatic smoketests notice it)

 src/core/main.c |   38 +++++++-------------------------------
 1 files changed, 7 insertions(+), 31 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 567e988..a4e49bc 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -484,43 +484,19 @@ meta_run (void)
 
   meta_ui_set_current_theme (meta_prefs_get_theme ());
 
-  /* Try to find some theme that'll work if the theme preference
-   * doesn't exist.  First try Simple (the default theme) then just
-   * try anything in the themes directory.
+  /* If the theme preference does not exists, fallback to
+   * Adwaita (the default theme), or abort if that doesn't
+   * exists.
    */
   if (!meta_ui_have_a_theme ())
-    meta_ui_set_current_theme ("Simple");
-  
-  if (!meta_ui_have_a_theme ())
-    {
-      const char *dir_entry = NULL;
-      GError *err = NULL;
-      GDir   *themes_dir = NULL;
-      
-      if (!(themes_dir = g_dir_open (MUTTER_DATADIR"/themes", 0, &err)))
-        {
-          meta_fatal (_("Failed to scan themes directory: %s\n"), err->message);
-          g_error_free (err);
-        } 
-      else 
-        {
-          while (((dir_entry = g_dir_read_name (themes_dir)) != NULL) && 
-                 (!meta_ui_have_a_theme ()))
-            {
-              meta_ui_set_current_theme (dir_entry);
-            }
-          
-          g_dir_close (themes_dir);
-        }
-    }
-  
+    meta_ui_set_current_theme ("Adwaita");
+
   if (!meta_ui_have_a_theme ())
-    meta_fatal (_("Could not find a theme! Be sure %s exists and contains the usual themes.\n"),
-                MUTTER_DATADIR"/themes");
+    meta_fatal ("Adwaita theme missing, please install the gnome-themes-standard package");
 
   if (!meta_display_open ())
     meta_exit (META_EXIT_ERROR);
-  
+
   g_main_loop_run (meta_main_loop);
 
   meta_finalize ();


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