[gnome-software] trivial: Drop ifdefs for older libappstream-glib



commit 2fe625d10fc62d17608a4756dccc1c8dda2fd63d
Author: Kalev Lember <klember redhat com>
Date:   Tue Sep 8 14:15:24 2015 +0200

    trivial: Drop ifdefs for older libappstream-glib
    
    Now that the previous commit bumped libappstream-glib dep to 0.5.1,
    there's no need to keep the ifdefs for 0.4.x support any more.

 src/plugins/gs-plugin-appstream.c |   12 ------------
 src/plugins/gs-plugin-fwupd.c     |   19 -------------------
 2 files changed, 0 insertions(+), 31 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 2be8108..f561d71 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -239,11 +239,7 @@ gs_plugin_startup (GsPlugin *plugin, GError **error)
                if (*perc < 10) {
                        g_debug ("Adding keyword '%s' to %s",
                                 origin, as_app_get_id (app));
-#if AS_CHECK_VERSION(0,5,0)
                        as_app_add_keyword (app, NULL, origin);
-#else
-                       as_app_add_keyword (app, NULL, origin, -1);
-#endif
                }
        }
 
@@ -562,11 +558,7 @@ gs_plugin_refine_item (GsPlugin *plugin,
        tmp = as_app_get_description (item, NULL);
        if (tmp != NULL) {
                g_autofree gchar *from_xml = NULL;
-#if AS_CHECK_VERSION(0,5,0)
                from_xml = as_markup_convert_simple (tmp, error);
-#else
-               from_xml = as_markup_convert_simple (tmp, -1, error);
-#endif
                if (from_xml == NULL) {
                        g_prefix_error (error, "trying to parse '%s': ", tmp);
                        return FALSE;
@@ -1053,11 +1045,7 @@ gs_plugin_add_categories_for_app (GList *list, AsApp *app)
                                gs_category_add_subcategory (parent, category);
                                g_object_unref (category);
                        }
-#if AS_CHECK_VERSION(0,5,0)
                        as_app_add_category (app, gs_category_get_id (category));
-#else
-                       as_app_add_category (app, gs_category_get_id (category), -1);
-#endif
                        gs_category_increment_size (category);
                }
        }
diff --git a/src/plugins/gs-plugin-fwupd.c b/src/plugins/gs-plugin-fwupd.c
index 3e69778..3fbfbdb 100644
--- a/src/plugins/gs-plugin-fwupd.c
+++ b/src/plugins/gs-plugin-fwupd.c
@@ -350,15 +350,9 @@ gs_plugin_add_update_app (GsPlugin *plugin,
        gs_app_set_metadata (app, "DataDir::desktop-icon", "application-x-firmware");
        if (update_desc != NULL) {
                g_autofree gchar *md = NULL;
-#if AS_CHECK_VERSION(0,5,0)
                md = as_markup_convert (update_desc,
                                        AS_MARKUP_CONVERT_FORMAT_MARKDOWN,
                                        NULL);
-#else
-               md = as_markup_convert (update_desc, -1,
-                                       AS_MARKUP_CONVERT_FORMAT_MARKDOWN,
-                                       NULL);
-#endif
                gs_app_set_update_details (app, md);
        }
        gs_plugin_add_app (list, app);
@@ -366,11 +360,7 @@ gs_plugin_add_update_app (GsPlugin *plugin,
        /* create icon */
        icon = as_icon_new ();
        as_icon_set_kind (icon, AS_ICON_KIND_STOCK);
-#if AS_CHECK_VERSION(0,5,0)
        as_icon_set_name (icon, "application-x-firmware");
-#else
-       as_icon_set_name (icon, "application-x-firmware", -1);
-#endif
        gs_app_set_icon (app, icon);
 
        return TRUE;
@@ -1080,13 +1070,8 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
                                            g_variant_get_string (variant, NULL));
                } else if (g_strcmp0 (key, "Description") == 0) {
                        g_autofree gchar *tmp = NULL;
-#if AS_CHECK_VERSION(0,5,0)
                        tmp = as_markup_convert (g_variant_get_string (variant, NULL),
                                                 AS_MARKUP_CONVERT_FORMAT_SIMPLE, NULL);
-#else
-                       tmp = as_markup_convert (g_variant_get_string (variant, NULL), -1,
-                                                AS_MARKUP_CONVERT_FORMAT_SIMPLE, NULL);
-#endif
                        if (tmp != NULL)
                                gs_app_set_description (app, GS_APP_QUALITY_HIGHEST, tmp);
                } else if (g_strcmp0 (key, "UrlHomepage") == 0) {
@@ -1103,11 +1088,7 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
        /* create icon */
        icon = as_icon_new ();
        as_icon_set_kind (icon, AS_ICON_KIND_STOCK);
-#if AS_CHECK_VERSION(0,5,0)
        as_icon_set_name (icon, "application-x-firmware");
-#else
-       as_icon_set_name (icon, "application-x-firmware", -1);
-#endif
        gs_app_set_icon (app, icon);
 
        gs_plugin_add_app (list, app);


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