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



commit 967bd68f4a53602b553961a2cdb492b4fa0e3e77
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]