[gnome-software/wip/mak/limba: 2/2] limba: Allow refreshing the software cache



commit c69d3f2d7ae06e2abc635d8847ba46e088dfba09
Author: Matthias Klumpp <matthias tenstral net>
Date:   Sat Jan 23 20:52:50 2016 +0100

    limba: Allow refreshing the software cache

 src/plugins/gs-plugin-limba.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-limba.c b/src/plugins/gs-plugin-limba.c
index a36f2a4..8debf11 100644
--- a/src/plugins/gs-plugin-limba.c
+++ b/src/plugins/gs-plugin-limba.c
@@ -278,3 +278,34 @@ gs_plugin_app_install (GsPlugin *plugin,
 
        return TRUE;
 }
+/**
+ * gs_plugin_refresh:
+ */
+gboolean
+gs_plugin_refresh (GsPlugin *plugin,
+                  guint cache_age,
+                  GsPluginRefreshFlags flags,
+                  GCancellable *cancellable,
+                  GError **error)
+{
+       g_autoptr(LiManager) mgr = NULL;
+       GError *error_local = NULL;
+
+       /* not us */
+       if ((flags & GS_PLUGIN_REFRESH_FLAGS_UPDATES) == 0)
+               return TRUE;
+
+       mgr = li_manager_new ();
+       li_manager_refresh_cache (mgr, &error_local);
+       if (error_local != NULL) {
+               g_set_error (error,
+                               GS_PLUGIN_ERROR,
+                               GS_PLUGIN_ERROR_FAILED,
+                               "Failed to refresh Limba metadata: %s",
+                                    error_local->message);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+


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