[gnome-software] Drop unused icon cache
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Drop unused icon cache
- Date: Sun, 10 Aug 2014 14:30:34 +0000 (UTC)
commit b99a6f90a6ae89ed45511befc9e20434eaa779b4
Author: Kalev Lember <kalevlember gmail com>
Date: Sun Aug 10 16:12:55 2014 +0200
Drop unused icon cache
src/gs-plugin-loader.c | 8 --------
src/gs-plugin.h | 1 -
src/plugins/gs-plugin-appstream.c | 14 --------------
3 files changed, 0 insertions(+), 23 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index b88b2dc..3f32521 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -41,7 +41,6 @@ struct GsPluginLoaderPrivate
GMutex app_cache_mutex;
GHashTable *app_cache;
- GHashTable *icon_cache;
GSettings *settings;
gchar **compatible_projects;
@@ -2403,7 +2402,6 @@ gs_plugin_loader_open_plugin (GsPluginLoader *plugin_loader,
plugin->updates_changed_fn = gs_plugin_loader_updates_changed_cb;
plugin->updates_changed_user_data = plugin_loader;
plugin->profile = g_object_ref (plugin_loader->priv->profile);
- plugin->icon_cache = g_hash_table_ref (plugin_loader->priv->icon_cache);
g_debug ("opened plugin %s: %s", filename, plugin->name);
/* add to array */
@@ -2597,7 +2595,6 @@ gs_plugin_loader_plugin_free (GsPlugin *plugin)
g_free (plugin->priv);
g_free (plugin->name);
g_object_unref (plugin->profile);
- g_hash_table_unref (plugin->icon_cache);
g_module_close (plugin->module);
g_slice_free (GsPlugin, plugin);
}
@@ -2653,10 +2650,6 @@ gs_plugin_loader_init (GsPluginLoader *plugin_loader)
g_str_equal,
g_free,
(GFreeFunc) g_object_unref);
- plugin_loader->priv->icon_cache = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_free);
g_mutex_init (&plugin_loader->priv->pending_apps_mutex);
g_mutex_init (&plugin_loader->priv->app_cache_mutex);
@@ -2703,7 +2696,6 @@ gs_plugin_loader_finalize (GObject *object)
g_object_unref (plugin_loader->priv->profile);
g_strfreev (plugin_loader->priv->compatible_projects);
g_hash_table_unref (plugin_loader->priv->app_cache);
- g_hash_table_unref (plugin_loader->priv->icon_cache);
g_ptr_array_unref (plugin_loader->priv->pending_apps);
g_ptr_array_unref (plugin_loader->priv->plugins);
g_free (plugin_loader->priv->location);
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index c09a9ac..bca2b9b 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -72,7 +72,6 @@ struct GsPlugin {
GsPluginUpdatesChanged updates_changed_fn;
gpointer updates_changed_user_data;
GsProfile *profile;
- GHashTable *icon_cache; /* key is the id.desktop */
};
typedef enum {
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index fac6557..335e55a 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -122,11 +122,9 @@ gs_plugin_destroy (GsPlugin *plugin)
static gboolean
gs_plugin_startup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
{
- AsApp *app;
GPtrArray *items;
gboolean ret;
gchar *tmp;
- guint i;
/* get the locale without the UTF-8 suffix */
plugin->priv->locale = g_strdup (setlocale (LC_MESSAGES, NULL));
@@ -160,18 +158,6 @@ gs_plugin_startup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
_("No AppStream data found"));
goto out;
}
-
- /* add icons to the icon name cache */
- for (i = 0; i < items->len; i++) {
- app = g_ptr_array_index (items, i);
- if (as_app_get_icon_kind (app) != AS_ICON_KIND_CACHED)
- continue;
- g_hash_table_insert (plugin->icon_cache,
- g_strdup (as_app_get_id (app)),
- g_build_filename (as_app_get_icon_path (app),
- as_app_get_icon (app),
- NULL));
- }
out:
gs_profile_stop (plugin->profile, "appstream::startup");
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]