## gs-plugin-job-update-apps

gs-plugin-job-update-apps — A plugin job to update apps or the OS

## Functions

GsPluginJob * | gs_plugin_job_update_apps_new ()
GsAppList * | gs_plugin_job_update_apps_get_apps ()
GsPluginUpdateAppsFlags | gs_plugin_job_update_apps_get_flags ()

## Types and Values

#define | GS_TYPE_PLUGIN_JOB_UPDATE_APPS
| GsPluginJobUpdateApps

## Description

GsPluginJobUpdateApps is a GsPluginJob representing an operation to download and/or apply updates to apps or the OS.

This class is a wrapper around `GsPluginClass.update_apps_async()`, calling it for all loaded plugins.

Unless `GS_PLUGIN_UPDATE_APPS_FLAGS_NO_DOWNLOAD` is specified, the first step of this job downloads the app and any dependencies, ready to be installed or updated.

Plugins are expected to schedule downloads using the system download scheduler if appropriate (if the download is not guaranteed to be under a few hundred kilobytes, for example), so that the user’s metered data preferences are honoured.

Plugins are expected to send progress notifications to the UI by calling the provided GsPluginProgressCallback function. Plugins may also call `gs_app_set_progress()` on apps as they are updated, but this method will eventually be removed as it cannot represent progress in multiple ongoing operations.

Callbacks from this job will be executed in the GMainContext which was thread-default at the time when `GsPlugin.run_async()` was called on the GsPluginJobUpdateApps. For plugins, this means that callbacks must be executed in the same GMainContext which called `GsPlugin.update_apps_async()`.

If the app is already downloaded, the first step of this job is a no-op.

Unless `GS_PLUGIN_UPDATE_APPS_FLAGS_NO_APPLY` is specified, the second step of this job applies the app and any dependencies (updating the app, and updating dependencies or installing missing dependencies).

Once that is completed, the apps will typically be set to the state `GS_APP_STATE_INSTALLED`, or `GS_APP_STATE_UNKNOWN`.

On failure the error message returned will usually only be shown on the console, but they can also be retrieved using `gs_plugin_loader_get_events()`.

See also: GsPluginClass.update_apps_async

## Functions

### gs_plugin_job_update_apps_new ()

    GsPluginJob *
    gs_plugin_job_update_apps_new (GsAppList *apps,
                                   GsPluginUpdateAppsFlags flags);

Create a new GsPluginJobUpdateApps for updating apps, or pre-downloading updates to apps.

#### Parameters

apps | list of apps to update. | [transfer none][not nullable]
flags | flags to affect the update |

#### Returns

a new GsPluginJobUpdateApps.

[transfer full]

Since: 44

### gs_plugin_job_update_apps_get_apps ()

    GsAppList *
    gs_plugin_job_update_apps_get_apps (GsPluginJobUpdateApps *self);

Get the set of apps being updated by this GsPluginJobUpdateApps.

#### Parameters

self | a GsPluginJobUpdateApps |

#### Returns

apps being updated

Since: 44

### gs_plugin_job_update_apps_get_flags ()

    GsPluginUpdateAppsFlags
    gs_plugin_job_update_apps_get_flags (GsPluginJobUpdateApps *self);

Get the flags affecting the behaviour of this GsPluginJobUpdateApps.

#### Parameters

self | a GsPluginJobUpdateApps |

#### Returns

flags for the job

Since: 44

## Types and Values

### GS_TYPE_PLUGIN_JOB_UPDATE_APPS

    #define GS_TYPE_PLUGIN_JOB_UPDATE_APPS (gs_plugin_job_update_apps_get_type ())

### GsPluginJobUpdateApps

    typedef struct _GsPluginJobUpdateApps GsPluginJobUpdateApps;