Blame SOURCES/0002-throbgress-update-for-api-change.patch

09aee3
From b9faf90fe5939fedfd710e1e8385f4d5c12e1df7 Mon Sep 17 00:00:00 2001
09aee3
From: Ray Strode <rstrode@redhat.com>
09aee3
Date: Mon, 15 Jun 2020 10:35:45 -0400
09aee3
Subject: [PATCH 2/2] throbgress: update for api change
09aee3
09aee3
---
09aee3
 src/plugins/splash/throbgress/plugin.c | 4 ++--
09aee3
 1 file changed, 2 insertions(+), 2 deletions(-)
09aee3
09aee3
diff --git a/src/plugins/splash/throbgress/plugin.c b/src/plugins/splash/throbgress/plugin.c
09aee3
index 86be064..68cca70 100644
09aee3
--- a/src/plugins/splash/throbgress/plugin.c
09aee3
+++ b/src/plugins/splash/throbgress/plugin.c
09aee3
@@ -715,61 +715,61 @@ update_status (ply_boot_splash_plugin_t *plugin,
09aee3
 }
09aee3
 
09aee3
 static void
09aee3
 on_boot_progress (ply_boot_splash_plugin_t *plugin,
09aee3
                   double                    duration,
09aee3
                   double                    percent_done)
09aee3
 {
09aee3
         ply_list_node_t *node;
09aee3
         double total_duration;
09aee3
 
09aee3
         if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES ||
09aee3
             plugin->mode == PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE ||
09aee3
             plugin->mode == PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE)
09aee3
                 return;
09aee3
 
09aee3
         total_duration = duration / percent_done;
09aee3
 
09aee3
         /* Fun made-up smoothing function to make the growth asymptotic:
09aee3
          * fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */
09aee3
         percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done);
09aee3
 
09aee3
         node = ply_list_get_first_node (plugin->views);
09aee3
 
09aee3
         while (node != NULL) {
09aee3
                 ply_list_node_t *next_node;
09aee3
                 view_t *view;
09aee3
 
09aee3
                 view = ply_list_node_get_data (node);
09aee3
                 next_node = ply_list_get_next_node (plugin->views, node);
09aee3
 
09aee3
-                ply_progress_bar_set_percent_done (view->progress_bar, percent_done);
09aee3
+                ply_progress_bar_set_fraction_done (view->progress_bar, percent_done);
09aee3
 
09aee3
                 node = next_node;
09aee3
         }
09aee3
 }
09aee3
 
09aee3
 static void
09aee3
 hide_splash_screen (ply_boot_splash_plugin_t *plugin,
09aee3
                     ply_event_loop_t         *loop)
09aee3
 {
09aee3
         assert (plugin != NULL);
09aee3
 
09aee3
         ply_trace ("hiding splash");
09aee3
         if (plugin->loop != NULL) {
09aee3
                 stop_animation (plugin, NULL);
09aee3
 
09aee3
                 ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
09aee3
                                                        detach_from_event_loop,
09aee3
                                                        plugin);
09aee3
                 detach_from_event_loop (plugin);
09aee3
         }
09aee3
 
09aee3
         plugin->is_visible = false;
09aee3
 }
09aee3
 
09aee3
 static void
09aee3
 show_password_prompt (ply_boot_splash_plugin_t *plugin,
09aee3
                       const char               *text,
09aee3
                       int                       number_of_bullets)
09aee3
 {
09aee3
         ply_list_node_t *node;
09aee3
@@ -920,61 +920,61 @@ display_question (ply_boot_splash_plugin_t *plugin,
09aee3
         show_prompt (plugin, prompt, entry_text);
09aee3
         redraw_views (plugin);
09aee3
         unpause_views (plugin);
09aee3
 }
09aee3
 
09aee3
 static void
09aee3
 display_message (ply_boot_splash_plugin_t *plugin,
09aee3
                  const char               *message)
09aee3
 {
09aee3
         show_message (plugin, message);
09aee3
 }
09aee3
 
09aee3
 static void
09aee3
 system_update (ply_boot_splash_plugin_t *plugin,
09aee3
                int                       progress)
09aee3
 {
09aee3
         ply_list_node_t *node;
09aee3
 
09aee3
         if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES &&
09aee3
             plugin->mode != PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE &&
09aee3
             plugin->mode != PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE)
09aee3
                 return;
09aee3
 
09aee3
         node = ply_list_get_first_node (plugin->views);
09aee3
         while (node != NULL) {
09aee3
                 ply_list_node_t *next_node;
09aee3
                 view_t *view;
09aee3
 
09aee3
                 view = ply_list_node_get_data (node);
09aee3
                 next_node = ply_list_get_next_node (plugin->views, node);
09aee3
-                ply_progress_bar_set_percent_done (view->progress_bar, (double) progress / 100.f);
09aee3
+                ply_progress_bar_set_fraction_done (view->progress_bar, (double) progress / 100.f);
09aee3
                 node = next_node;
09aee3
         }
09aee3
 }
09aee3
 
09aee3
 ply_boot_splash_plugin_interface_t *
09aee3
 ply_boot_splash_plugin_get_interface (void)
09aee3
 {
09aee3
         static ply_boot_splash_plugin_interface_t plugin_interface =
09aee3
         {
09aee3
                 .create_plugin        = create_plugin,
09aee3
                 .destroy_plugin       = destroy_plugin,
09aee3
                 .add_pixel_display    = add_pixel_display,
09aee3
                 .remove_pixel_display = remove_pixel_display,
09aee3
                 .show_splash_screen   = show_splash_screen,
09aee3
                 .update_status        = update_status,
09aee3
                 .on_boot_progress     = on_boot_progress,
09aee3
                 .hide_splash_screen   = hide_splash_screen,
09aee3
                 .on_root_mounted      = on_root_mounted,
09aee3
                 .become_idle          = become_idle,
09aee3
                 .display_normal       = display_normal,
09aee3
                 .display_password     = display_password,
09aee3
                 .display_question     = display_question,
09aee3
                 .display_message      = display_message,
09aee3
                 .system_update        = system_update,
09aee3
         };
09aee3
 
09aee3
         return &plugin_interface;
09aee3
 }
09aee3
 
09aee3
 /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
09aee3
-- 
09aee3
2.21.0
09aee3