[gnome-software/1649-support-appstream-merging: 103/103] gs-flatpak: Use gs_appstream_add_data_merge_fixup()




commit c0fb2b29f7e02f7a8691b91428d815fd67e7e3db
Author: Milan Crha <mcrha redhat com>
Date:   Thu Mar 31 14:59:06 2022 +0200

    gs-flatpak: Use gs_appstream_add_data_merge_fixup()
    
    This will merge information from the .desktop files and system merge components
    into the corresponding appstream data.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1649

 plugins/flatpak/gs-flatpak.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 3f0e6e592..0b03eaf8d 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -909,6 +909,7 @@ gs_flatpak_rescan_appstream_store (GsFlatpak *self,
        g_autofree gchar *blobfn = NULL;
        g_autoptr(GFile) file = NULL;
        g_autoptr(GPtrArray) xremotes = NULL;
+       g_autoptr(GPtrArray) desktop_paths = NULL;
        g_autoptr(GRWLockReaderLocker) reader_locker = NULL;
        g_autoptr(GRWLockWriterLocker) writer_locker = NULL;
        g_autoptr(XbBuilder) builder = NULL;
@@ -975,6 +976,12 @@ gs_flatpak_rescan_appstream_store (GsFlatpak *self,
        /* regenerate with each minor release */
        xb_builder_append_guid (builder, PACKAGE_VERSION);
 
+       /* Merge data from the installed files and the system appstream data,
+          which is always checked, even when the 'appstream_paths' is NULL. */
+       desktop_paths = g_ptr_array_new_with_free_func (g_free);
+       g_ptr_array_add (desktop_paths, gs_flatpak_get_desktop_files_dir (self));
+       gs_appstream_add_data_merge_fixup (builder, NULL, desktop_paths, cancellable);
+
        /* create per-user cache */
        blobfn = gs_utils_get_cache_filename (gs_flatpak_get_id (self),
                                              "components.xmlb",


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