[gnome-software/wip/kalev/3-30-f29-ci: 1/2] flatpak: Drop the X-Flatpak key fallback and rely on new appstream-glib instead



commit 4f41aeb94b5532ef261d2c4a2fe80868b3c198e2
Author: Kalev Lember <klember redhat com>
Date:   Thu Nov 29 15:42:59 2018 +0100

    flatpak: Drop the X-Flatpak key fallback and rely on new appstream-glib instead
    
    I got the fallback wrong in commit af05c3e and it broke the self tests
    with older appstream-glib. Let's just do what hughsie suggested in the
    first place and depend on new enough appstream-glib instead.

 meson.build                  |  2 +-
 plugins/flatpak/gs-flatpak.c | 20 --------------------
 2 files changed, 1 insertion(+), 21 deletions(-)
---
diff --git a/meson.build b/meson.build
index 797da522..0e092254 100644
--- a/meson.build
+++ b/meson.build
@@ -96,7 +96,7 @@ add_project_arguments('-D_GNU_SOURCE', language : 'c')
 
 conf.set('HAVE_LINUX_UNISTD_H', cc.has_header('linux/unistd.h'))
 
-appstream_glib = dependency('appstream-glib', version : '>= 0.7.3')
+appstream_glib = dependency('appstream-glib', version : '>= 0.7.14')
 gdk_pixbuf = dependency('gdk-pixbuf-2.0', version : '>= 2.32.0')
 gio_unix = dependency('gio-unix-2.0', version : '>= 2.56.0')
 gmodule = dependency('gmodule-2.0')
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 5c7457b3..ffd8927a 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -393,19 +393,6 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
        return TRUE;
 }
 
-static gchar *
-gs_flatpak_discard_desktop_suffix (const gchar *app_id)
-{
-       const gchar *desktop_suffix = ".desktop";
-       guint app_prefix_len;
-
-       if (!g_str_has_suffix (app_id, desktop_suffix))
-               return g_strdup (app_id);
-
-       app_prefix_len = strlen (app_id) - strlen (desktop_suffix);
-       return g_strndup (app_id, app_prefix_len);
-}
-
 static void
 gs_flatpak_rescan_installed (GsFlatpak *self,
                             GCancellable *cancellable,
@@ -447,13 +434,6 @@ gs_flatpak_rescan_installed (GsFlatpak *self,
                        continue;
                }
 
-               /* fall back to guessing app ID */
-               if (as_app_get_id (app) == NULL) {
-                       g_autofree gchar *app_id = gs_flatpak_discard_desktop_suffix (fn);
-                       g_debug ("failed to get app ID from X-Flatpak; falling back to %s", app_id);
-                       as_app_set_id (app, app_id);
-               }
-
                /* fix up icons */
                icons = as_app_get_icons (app);
                for (guint i = 0; i < icons->len; i++) {


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