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)
This commit is contained in:
Giovanni Campagna 2013-05-20 00:18:40 +02:00
parent f3d1653f13
commit 1fdb161f54

View File

@ -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");
meta_ui_set_current_theme ("Adwaita");
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);
}
}
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 ();