From: Hans de Goede Date: Sat, 28 Sep 2019 09:59:47 +0000 (+0200) Subject: two-step: Cleanup stop_animation function X-Git-Tag: 0.9.5~36^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48de9e64ee9b225da9eafa96aae79dd60907348f;p=thirdparty%2Fplymouth.git two-step: Cleanup stop_animation function Cleanup the stop_animation function: - Remove the trigger argument as all callers pass NULL - Remove the logging of "hiding progress animation" we already log a generic "stopping animation" message and we do not log such a message for the other animated controls, so remove this one for consistency - Add a NULL pointer check for view->end_animation, as this can actually be NULL when view_load_end_animation fails Signed-off-by: Hans de Goede --- diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index a03fdaff..80f0a11a 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -188,9 +188,7 @@ struct _ply_boot_splash_plugin ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void); -static void stop_animation (ply_boot_splash_plugin_t *plugin, - ply_trigger_t *idle_trigger); - +static void stop_animation (ply_boot_splash_plugin_t *plugin); static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin); static void display_message (ply_boot_splash_plugin_t *plugin, const char *message); @@ -1204,7 +1202,7 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin) ply_trace ("destroying plugin"); if (plugin->loop != NULL) { - stop_animation (plugin, NULL); + stop_animation (plugin); ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t) detach_from_event_loop, @@ -1321,8 +1319,7 @@ start_progress_animation (ply_boot_splash_plugin_t *plugin) } static void -stop_animation (ply_boot_splash_plugin_t *plugin, - ply_trigger_t *trigger) +stop_animation (ply_boot_splash_plugin_t *plugin) { ply_list_node_t *node; @@ -1332,9 +1329,7 @@ stop_animation (ply_boot_splash_plugin_t *plugin, if (!plugin->is_animating) return; - ply_trace ("stopping animation%s", - trigger != NULL ? " with trigger" : ""); - + ply_trace ("stopping animation"); plugin->is_animating = false; node = ply_list_get_first_node (plugin->views); @@ -1346,21 +1341,15 @@ stop_animation (ply_boot_splash_plugin_t *plugin, next_node = ply_list_get_next_node (plugin->views, node); ply_progress_bar_hide (view->progress_bar); - if (view->progress_animation != NULL) { - ply_trace ("hiding progress animation"); + if (view->progress_animation != NULL) ply_progress_animation_hide (view->progress_animation); - } - if (trigger != NULL) - ply_trigger_ignore_next_pull (trigger); if (view->throbber != NULL) - ply_throbber_stop (view->throbber, trigger); - ply_animation_stop (view->end_animation); + ply_throbber_stop (view->throbber, NULL); + if (view->end_animation != NULL) + ply_animation_stop (view->end_animation); node = next_node; } - - if (trigger != NULL) - ply_trigger_pull (trigger, NULL); } static void @@ -1776,7 +1765,7 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin, ply_trace ("hiding splash"); if (plugin->loop != NULL) { - stop_animation (plugin, NULL); + stop_animation (plugin); ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t) detach_from_event_loop, @@ -1959,7 +1948,7 @@ display_password (ply_boot_splash_plugin_t *plugin, { pause_views (plugin); if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) - stop_animation (plugin, NULL); + stop_animation (plugin); plugin->state = PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY; show_password_prompt (plugin, prompt, bullets); @@ -1974,7 +1963,7 @@ display_question (ply_boot_splash_plugin_t *plugin, { pause_views (plugin); if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) - stop_animation (plugin, NULL); + stop_animation (plugin); plugin->state = PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY; show_prompt (plugin, prompt, entry_text);