]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: don't tank in updates mode when there's no progress animations
authorRay Strode <rstrode@redhat.com>
Mon, 26 Oct 2015 17:20:18 +0000 (13:20 -0400)
committerRay Strode <rstrode@redhat.com>
Fri, 20 May 2016 20:39:24 +0000 (16:39 -0400)
Right now we try to use the progress animation in updates mode, even
if there's not one.  This commit makes the progress animation truely
optional.

src/plugins/splash/two-step/plugin.c

index 510a2087ea966e0bfc0c70353a3fb950bd1fb0d4..bc36cc8c0ba03682ffc878f5974fa3551131eab5 100644 (file)
@@ -267,11 +267,15 @@ view_load (view_t *view)
 
         view_load_end_animation (view);
 
-        ply_trace ("loading progress animation");
-        if (!ply_progress_animation_load (view->progress_animation)) {
-                ply_trace ("optional progress animation wouldn't load");
-                ply_progress_animation_free (view->progress_animation);
-                view->progress_animation = NULL;
+        if (view->progress_animation != NULL) {
+                ply_trace ("loading progress animation");
+                if (!ply_progress_animation_load (view->progress_animation)) {
+                        ply_trace ("optional progress animation wouldn't load");
+                        ply_progress_animation_free (view->progress_animation);
+                        view->progress_animation = NULL;
+                }
+        } else {
+                ply_trace ("this theme has no progress animation");
         }
 
         if (view->throbber != NULL) {
@@ -1334,8 +1338,8 @@ system_update (ply_boot_splash_plugin_t *plugin,
 
                 view = ply_list_node_get_data (node);
                 next_node = ply_list_get_next_node (plugin->views, node);
-                ply_progress_animation_set_percent_done (view->progress_animation,
-                                                         (double) progress / 100.f);
+                if (view->progress_animation != NULL)
+                        ply_progress_animation_set_percent_done (view->progress_animation, (double) progress / 100.f);
                 node = next_node;
         }
 }