[gnome-software/wip/hughsie/symlinks: 2/2] Ensure apps show up straight away when a new flatpak remote is added



commit 82e811cd71d5130a02ed50d560d4b5b6eefdd1ef
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jun 8 10:35:21 2016 +0100

    Ensure apps show up straight away when a new flatpak remote is added
    
    We just check for metadata of any age.

 src/plugins/gs-flatpak.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 61b845c..387cccd 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -45,6 +45,10 @@ struct _GsFlatpak {
 
 G_DEFINE_TYPE (GsFlatpak, gs_flatpak, G_TYPE_OBJECT)
 
+static gboolean
+gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
+                             GCancellable *cancellable, GError **error);
+
 static void
 gs_plugin_flatpak_changed_cb (GFileMonitor *monitor,
                              GFile *child,
@@ -53,9 +57,16 @@ gs_plugin_flatpak_changed_cb (GFileMonitor *monitor,
                              GsFlatpak *self)
 {
        g_autoptr(GError) error = NULL;
+       g_autoptr(GError) error_md = NULL;
 
        gs_plugin_updates_changed (self->plugin);
 
+       /* if this is a new remote, get the AppStream data */
+       if (!gs_flatpak_refresh_appstream (self, G_MAXUINT, NULL, &error_md)) {
+               g_warning ("failed to get initial available data: %s",
+                          error_md->message);
+       }
+
        /* ensure the AppStream symlink cache is up to date */
        if (!gs_flatpak_symlinks_rebuild (self->installation, NULL, &error))
                g_warning ("failed to check symlinks: %s", error->message);


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