[gnome-software/wip/hughsie/vnd.flatpak.ref: 6/12] trivial: Remove some dead code now the appstream-glib dep is raised



commit 7d6956d7d8d9b2fa3d42071505fe90b28c7b82af
Author: Richard Hughes <richard hughsie com>
Date:   Fri Sep 16 14:09:07 2016 +0100

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

 src/gs-app-list.c      |   18 ------------------
 src/gs-app.h           |    8 --------
 src/gs-plugin-loader.c |    8 --------
 src/gs-plugin.c        |    7 -------
 4 files changed, 0 insertions(+), 41 deletions(-)
---
diff --git a/src/gs-app-list.c b/src/gs-app-list.c
index f75c969..1c71782 100644
--- a/src/gs-app-list.c
+++ b/src/gs-app-list.c
@@ -116,20 +116,6 @@ gs_app_list_add_safe (GsAppList *list, GsApp *app)
        if (!gs_app_list_check_for_duplicate (list, app))
                return;
 
-#if !AS_CHECK_VERSION(0,6,2)
-       /* check for duplicate using globs (slower) */
-       for (i = 0; i < list->array->len; i++) {
-               GsApp *app_tmp = g_ptr_array_index (list->array, i);
-               if (as_utils_unique_id_equal (gs_app_get_unique_id (app),
-                                             gs_app_get_unique_id (app_tmp))) {
-                       g_debug ("not adding duplicate %s as %s exists",
-                                gs_app_get_unique_id (app),
-                                gs_app_get_unique_id (app_tmp));
-                       return;
-               }
-       }
-#endif
-
        /* just use the ref */
        g_ptr_array_add (list->array, g_object_ref (app));
        g_hash_table_insert (list->hash_by_id, (gpointer) id, (gpointer) app);
@@ -463,12 +449,8 @@ gs_app_list_init (GsAppList *list)
 {
        g_mutex_init (&list->mutex);
        list->array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
-#if AS_CHECK_VERSION(0,6,2)
        list->hash_by_id = g_hash_table_new ((GHashFunc) as_utils_unique_id_hash,
                                             (GEqualFunc) as_utils_unique_id_equal);
-#else
-       list->hash_by_id = g_hash_table_new (g_str_hash, g_str_equal);
-#endif
 }
 
 /**
diff --git a/src/gs-app.h b/src/gs-app.h
index 173cca1..d7bc7ef 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -97,14 +97,6 @@ typedef enum {
        GS_APP_QUALITY_LAST
 } GsAppQuality;
 
-#if !AS_CHECK_VERSION(0,6,2)
-#define AS_APP_QUIRK_NEEDS_USER_ACTION         (1 << 8)
-#endif
-
-#if !AS_CHECK_VERSION(0,6,3)
-#define AS_APP_KIND_DRIVER                     (AS_APP_KIND_LOCALIZATION+1)
-#endif
-
 GsApp          *gs_app_new                     (const gchar    *id);
 GsApp          *gs_app_new_from_unique_id      (const gchar    *unique_id);
 gchar          *gs_app_to_string               (GsApp          *app);
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 76c466c..eeeebfa 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -4238,18 +4238,10 @@ gs_plugin_loader_init (GsPluginLoader *plugin_loader)
        priv->auth_array = g_ptr_array_new_with_free_func ((GFreeFunc) g_object_unref);
        priv->profile = as_profile_new ();
        priv->settings = g_settings_new ("org.gnome.software");
-
-#if AS_CHECK_VERSION(0,6,2)
        priv->events_by_id = g_hash_table_new_full ((GHashFunc) as_utils_unique_id_hash,
                                                    (GEqualFunc) as_utils_unique_id_equal,
                                                    NULL,
                                                    (GDestroyNotify) g_object_unref);
-#else
-       priv->events_by_id = g_hash_table_new_full (g_str_hash,
-                                                   g_str_equal,
-                                                   NULL,
-                                                   (GDestroyNotify) g_object_unref);
-#endif
 
        /* share a soup session (also disable the double-compression) */
        priv->soup_session = soup_session_new_with_options (SOUP_SESSION_USER_AGENT, gs_user_agent (),
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index 43b0c1b..57af366 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -1483,17 +1483,10 @@ gs_plugin_init (GsPlugin *plugin)
        priv->enabled = TRUE;
        priv->scale = 1;
        priv->profile = as_profile_new ();
-#if AS_CHECK_VERSION(0,6,2)
        priv->cache = g_hash_table_new_full ((GHashFunc) as_utils_unique_id_hash,
                                             (GEqualFunc) as_utils_unique_id_equal,
                                             g_free,
                                             (GDestroyNotify) g_object_unref);
-#else
-       priv->cache = g_hash_table_new_full (g_str_hash,
-                                            g_str_equal,
-                                            g_free,
-                                            (GDestroyNotify) g_object_unref);
-#endif
        g_mutex_init (&priv->cache_mutex);
        g_mutex_init (&priv->timer_mutex);
        g_rw_lock_init (&priv->rwlock);


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