[gnome-software/fix-flatpak-related-progress: 3/6] flatpak: Rename an internal function argument



commit 81d370b760e85bfc04fd28b599c74ad9dac3b969
Author: Matthew Leeds <matthew leeds endlessm com>
Date:   Tue Jul 7 16:21:48 2020 -0700

    flatpak: Rename an internal function argument
    
    Currently in update_progress_for_op_recurse_up() we call
    update_progress_for_op() with root_op as the second-to-last argument,
    but the implementation has the last argument called root_op, which is
    pretty confusing. So rename that variable to current_op which is
    accurate: it is always the operation in progress which triggered
    _transaction_progress_changed_cb(). Also rename op to root_op so it
    matches the variable name in update_progress_for_op(). The root_op is
    the op for which we are updating progress and it is always related to
    current_op, directly or indirectly.
    
    This introduces no functional changes.

 plugins/flatpak/gs-flatpak-transaction.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak-transaction.c b/plugins/flatpak/gs-flatpak-transaction.c
index 68f7b004..a2cfdfb9 100644
--- a/plugins/flatpak/gs-flatpak-transaction.c
+++ b/plugins/flatpak/gs-flatpak-transaction.c
@@ -331,17 +331,17 @@ static void
 update_progress_for_op_recurse_up (GsFlatpakTransaction        *self,
                                   FlatpakTransactionProgress  *progress,
                                   GList                       *ops,
-                                  FlatpakTransactionOperation *root_op,
-                                  FlatpakTransactionOperation *op)
+                                  FlatpakTransactionOperation *current_op,
+                                  FlatpakTransactionOperation *root_op)
 {
-       GPtrArray *related_to_ops = flatpak_transaction_operation_get_related_to_ops (op);
+       GPtrArray *related_to_ops = flatpak_transaction_operation_get_related_to_ops (root_op);
 
-       if (!flatpak_transaction_operation_get_is_skipped (op))
-               update_progress_for_op (self, progress, ops, root_op, op);
+       if (!flatpak_transaction_operation_get_is_skipped (root_op))
+               update_progress_for_op (self, progress, ops, current_op, root_op);
 
        for (gsize i = 0; related_to_ops != NULL && i < related_to_ops->len; i++) {
                FlatpakTransactionOperation *related_to_op = g_ptr_array_index (related_to_ops, i);
-               update_progress_for_op_recurse_up (self, progress, ops, root_op, related_to_op);
+               update_progress_for_op_recurse_up (self, progress, ops, current_op, related_to_op);
        }
 }
 #endif  /* flatpak 1.7.3 */


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