[gnome-software] trivial: Remove some dead code now the appstream-glib dep is raised



commit 12dc4cd5cf547f1a0fcd7223b6609fdc5c9e45b1
Author: Richard Hughes <richard hughsie com>
Date:   Tue May 16 16:09:34 2017 +0100

    trivial: Remove some dead code now the appstream-glib dep is raised

 plugins/core/gs-appstream.c        |    5 -----
 plugins/core/gs-plugin-appstream.c |    4 ----
 plugins/flatpak/gs-flatpak.c       |   22 +---------------------
 3 files changed, 1 insertions(+), 30 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 033df31..ceda362 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -622,16 +622,11 @@ 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 */
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 8520316..62292f5 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -319,13 +319,9 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
                if (*perc < 10 || all_origin_keywords) {
                        g_debug ("adding keyword '%s' to %s",
                                 tmp, as_app_get_id (app));
-#if AS_CHECK_VERSION(0,6,13)
                        as_app_set_search_match (app,
                                                 as_store_get_search_match (priv->store) |
                                                 AS_APP_SEARCH_MATCH_ORIGIN);
-#else
-                       as_app_add_keyword (app, NULL, tmp);
-#endif
                }
        }
 
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 9d6f910..7dcc87a 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -242,9 +242,7 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
                                   AS_APP_SEARCH_MATCH_COMMENT |
                                   AS_APP_SEARCH_MATCH_NAME |
                                   AS_APP_SEARCH_MATCH_KEYWORD |
-#if AS_CHECK_VERSION(0,6,13)
                                   AS_APP_SEARCH_MATCH_ORIGIN |
-#endif
                                   AS_APP_SEARCH_MATCH_ID);
        if (!as_store_from_file (store, file, NULL, cancellable, error)) {
                gs_utils_error_convert_appstream (error);
@@ -258,17 +256,6 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
                as_app_set_origin (app, flatpak_remote_get_name (xremote));
        }
 
-#if !AS_CHECK_VERSION(0,6,13)
-       /* add the origin as a keyword */
-       for (i = 0; i < apps->len; i++) {
-               AsApp *app = g_ptr_array_index (apps, i);
-               g_debug ("adding keyword '%s' to %s",
-                        flatpak_remote_get_name (xremote),
-                        as_app_get_id (app));
-               as_app_add_keyword (app, NULL, flatpak_remote_get_name (xremote));
-       }
-#endif
-
        /* ensure the token cache */
        as_store_load_search_cache (store);
 
@@ -354,6 +341,7 @@ gs_flatpak_rescan_installed (GsFlatpak *self,
                g_autofree gchar *fn_desktop = NULL;
                g_autoptr(GError) error_local = NULL;
                g_autoptr(AsApp) app = NULL;
+               g_autoptr(AsFormat) format = as_format_new ();
 
                /* ignore */
                if (g_strcmp0 (fn, "mimeinfo.cache") == 0)
@@ -384,17 +372,9 @@ gs_flatpak_rescan_installed (GsFlatpak *self,
                /* add */
                as_app_set_state (app, AS_APP_STATE_INSTALLED);
                as_app_set_scope (app, self->scope);
-#if AS_CHECK_VERSION(0,6,9)
-{
-               g_autoptr(AsFormat) format = as_format_new ();
                as_format_set_kind (format, AS_FORMAT_KIND_DESKTOP);
                as_format_set_filename (format, fn_desktop);
                as_app_add_format (app, format);
-}
-#else
-               as_app_set_source_kind (app, AS_APP_SOURCE_KIND_DESKTOP);
-               as_app_set_source_file (app, fn_desktop);
-#endif
                as_app_set_icon_path (app, path_exports);
                as_app_add_keyword (app, NULL, "flatpak");
                as_store_add_app (self->store, app);


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