]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: drop fall back feature of load_theme
authorRay Strode <rstrode@redhat.com>
Thu, 5 Dec 2013 19:58:19 +0000 (14:58 -0500)
committerRay Strode <rstrode@redhat.com>
Fri, 6 Dec 2013 21:24:30 +0000 (16:24 -0500)
load_theme currently takes a boolean that if true, will
make it load the built-in "details" plugin if the main plugin
fails to load.

Boolean arguments are hard to read, so this commit drops it.

src/main.c

index db5d293b76c4fd64683da28764fca86c40dfb7b2..0f2372f62ad125064d2d43ded6b2e36b180d7483 100644 (file)
@@ -127,8 +127,7 @@ typedef struct
 
 static ply_boot_splash_t *load_built_in_theme (state_t *state);
 static ply_boot_splash_t *load_theme (state_t    *state,
-                                      const char *theme_path,
-                                      bool        fall_back_if_neccessary);
+                                      const char *theme_path);
 static void show_theme (state_t           *state,
                         ply_boot_splash_t *splash);
 static ply_boot_splash_t *start_boot_splash (state_t    *state,
@@ -1708,8 +1707,7 @@ load_built_in_theme (state_t *state)
 
 static ply_boot_splash_t *
 load_theme (state_t    *state,
-            const char *theme_path,
-            bool        fall_back_if_neccessary)
+            const char *theme_path)
 {
   ply_boot_splash_t *splash;
   bool is_loaded;
@@ -1722,13 +1720,6 @@ load_theme (state_t    *state,
                                 state->boot_buffer);
 
   is_loaded = ply_boot_splash_load (splash);
-  if (!is_loaded && fall_back_if_neccessary)
-    {
-      ply_trace ("Splash couldn't be loaded: %m");
-
-      ply_trace ("Loading built in splash");
-      is_loaded = ply_boot_splash_load_built_in (splash);
-    }
 
   if (!is_loaded)
     {
@@ -1786,7 +1777,14 @@ start_boot_splash (state_t    *state,
 {
   ply_boot_splash_t *splash;
 
-  splash = load_theme (state, theme_path, fall_back_if_necessary);
+  splash = load_theme (state, theme_path);
+
+  if (splash == NULL && fall_back_if_neccessary)
+    splash = load_built_in_theme (state);
+
+  if (splash == NULL)
+    return NULL;
+
   add_displays_and_keyboard_to_boot_splash (state, splash);
   show_theme (state, splash);