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




commit d96c382d93cd46d9053b4f162a6ae79226e6f341
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 41cfb2660..861ab8671 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -881,6 +881,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;
@@ -943,6 +944,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]