[gnome-software/gnome-3-22] trivial: Use the new features in appstream-glib to correctly get the desktop file



commit d849a3e60dc770a9cd5f0dfe6f7afa598501dc42
Author: Richard Hughes <richard hughsie com>
Date:   Mon Feb 27 10:09:53 2017 +0000

    trivial: Use the new features in appstream-glib to correctly get the desktop file

 src/plugins/gs-appstream.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index ee8f815..2949dde 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -605,8 +605,16 @@ gs_appstream_refine_app (GsPlugin *plugin,
 
        /* set source */
        if (gs_app_get_metadata_item (app, "appstream::source-file") == NULL) {
+#if AS_CHECK_VERSION(0,6,9)
+               AsFormat *format = as_app_get_format_by_kind (item, AS_FORMAT_KIND_DESKTOP);
+               if (format != NULL) {
+                       gs_app_set_metadata (app, "appstream::source-file",
+                                            as_format_get_filename (format));
+               }
+#else
                gs_app_set_metadata (app, "appstream::source-file",
                                     as_app_get_source_file (item));
+#endif
        }
 
        /* scope */


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