[gnome-software/eos-updater-upstream: 1/7] Make gs_app_get_cancellable public



commit ad242561aaccb52edc473a0505e1f5f8127639f1
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Mon Mar 19 16:32:04 2018 +0100

    Make gs_app_get_cancellable public
    
    The GsApp's cancellable is not supposed to be exposed to plugins, as the
    way to cancel operations is by using the cancellable object passed in
    every overridden plugin method. However, in the EOS plugin we have to
    deal with the OS upgrades in an asynchronous way (by using the
    eos-updater's DBus API), to reflect whatever state an upgrade has, and
    thus cannot simply perform the whole upgrade in one method.
    
    The initial solution of keeping a ref to the cancellable passed in the
    gs_plugin_app_upgrade_download method also doesn't work because the
    plugin loader uses its own GCancellable on its methods (for managing a
    time-out for each action  -- and cancels the caller's GCancellable when
    the former signals that it's been canceled). In any case, even if it
    used the passed cancellable directly, due to having the EOS Updater's
    state changing at any moment, we could never be sure that the mentioned
    download method would happen before a state change.
    
    Hence, in order to be able to be notified when the user clicks the
    "Cancel" button of an upgrade banner -- especially when it's done while
    outside of the gs_plugin_app_upgrade_download method -- we need to be
    able to get the upgrade GsApp's cancellable object.
    
    https://phabricator.endlessm.com/T21133

 lib/gs-app-private.h | 1 -
 lib/gs-app.h         | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/gs-app-private.h b/lib/gs-app-private.h
index 95025e65..c026c5f8 100644
--- a/lib/gs-app-private.h
+++ b/lib/gs-app-private.h
@@ -19,7 +19,6 @@ void           gs_app_set_unique_id           (GsApp          *app,
                                                 const gchar    *unique_id);
 void            gs_app_remove_addon            (GsApp          *app,
                                                 GsApp          *addon);
-GCancellable   *gs_app_get_cancellable         (GsApp          *app);
 GsPluginAction  gs_app_get_pending_action      (GsApp          *app);
 void            gs_app_set_pending_action      (GsApp          *app,
                                                 GsPluginAction  action);
diff --git a/lib/gs-app.h b/lib/gs-app.h
index f6421f0b..9539caed 100644
--- a/lib/gs-app.h
+++ b/lib/gs-app.h
@@ -381,5 +381,6 @@ void                 gs_app_set_permissions         (GsApp          *app,
 GsAppPermissions gs_app_get_update_permissions (GsApp          *app);
 void            gs_app_set_update_permissions  (GsApp          *app,
                                                 GsAppPermissions update_permissions);
+GCancellable   *gs_app_get_cancellable         (GsApp          *app);
 
 G_END_DECLS


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