[gnome-software] flatpak: Drop some dead progress handling code



commit 7fe1311573bde075c1c8d9f77d2ebbaa5e5a99b9
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Apr 15 17:21:48 2020 +0100

    flatpak: Drop some dead progress handling code
    
    job_now and job_max were never set, so remained at their default value
    of 0, and weren’t effectively part of the progress computation. The code
    which did set them was dropped in 1113bf5a0468d267153710e3ba.
    
    This introduces no functional changes.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 plugins/flatpak/gs-flatpak.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 20afb5ac..a98ca934 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -788,8 +788,6 @@ gs_flatpak_setup (GsFlatpak *self, GCancellable *cancellable, GError **error)
 typedef struct {
        GsPlugin        *plugin;
        GsApp           *app;
-       guint            job_max;
-       guint            job_now;
 } GsFlatpakProgressHelper;
 
 static void
@@ -823,14 +821,8 @@ gs_flatpak_progress_cb (const gchar *status,
        GsFlatpakProgressHelper *phelper = (GsFlatpakProgressHelper *) user_data;
        GsPluginStatus plugin_status = GS_PLUGIN_STATUS_DOWNLOADING;
 
-       /* fix up */
-       if (phelper->job_max == 0)
-               phelper->job_max = 1;
-
        if (phelper->app != NULL) {
-               gdouble job_factor = 1.f / phelper->job_max;
-               gdouble offset = 100.f * job_factor * phelper->job_now;
-               gs_app_set_progress (phelper->app, offset + (progress * job_factor));
+               gs_app_set_progress (phelper->app, progress);
 
                switch (gs_app_get_state (phelper->app)) {
                case AS_APP_STATE_INSTALLING:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]