[gnome-software/gnome-3-20] Allow the dummy backend to handle the distro upgrade
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-20] Allow the dummy backend to handle the distro upgrade
- Date: Thu, 14 Apr 2016 17:31:16 +0000 (UTC)
commit 1e622612489680c24ed6428e3f23dd8c2e6f61bf
Author: Richard Hughes <richard hughsie com>
Date: Thu Apr 14 18:11:09 2016 +0100
Allow the dummy backend to handle the distro upgrade
src/plugins/gs-plugin-dummy.c | 44 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-dummy.c b/src/plugins/gs-plugin-dummy.c
index d6897e9..c4aee38 100644
--- a/src/plugins/gs-plugin-dummy.c
+++ b/src/plugins/gs-plugin-dummy.c
@@ -251,6 +251,7 @@ gs_plugin_add_distro_upgrades (GsPlugin *plugin,
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
gs_app_set_name (app, GS_APP_QUALITY_LOWEST, "Fedora");
gs_app_set_version (app, "24");
+ gs_app_set_management_plugin (app, plugin->name);
gs_plugin_add_app (list, app);
return TRUE;
}
@@ -351,6 +352,49 @@ gs_plugin_refresh (GsPlugin *plugin,
}
/**
+ * gs_plugin_app_upgrade_download:
+ */
+gboolean
+gs_plugin_app_upgrade_download (GsPlugin *plugin, GsApp *app,
+ GCancellable *cancellable, GError **error)
+{
+ /* only process this app if was created by this plugin */
+ if (g_strcmp0 (gs_app_get_management_plugin (app), plugin->name) != 0)
+ return TRUE;
+
+ g_debug ("starting download");
+ gs_app_set_state (app, AS_APP_STATE_INSTALLING);
+ if (!gs_plugin_dummy_delay (plugin, app, 5000, cancellable, error))
+ return FALSE;
+ return TRUE;
+}
+
+/**
+ * gs_plugin_app_upgrade_trigger:
+ */
+gboolean
+gs_plugin_app_upgrade_trigger (GsPlugin *plugin, GsApp *app,
+ GCancellable *cancellable, GError **error)
+{
+ /* only process this app if was created by this plugin */
+ if (g_strcmp0 (gs_app_get_management_plugin (app), plugin->name) != 0)
+ return TRUE;
+
+ /* NOP */
+ return TRUE;
+}
+
+/**
+ * gs_plugin_offline_update_cancel:
+ */
+gboolean
+gs_plugin_offline_update_cancel (GsPlugin *plugin, GsApp *app,
+ GCancellable *cancellable, GError **error)
+{
+ return TRUE;
+}
+
+/**
* gs_plugin_review_submit:
*/
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]