aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2012-03-21 18:07:38 -0400
committerKen VanDine <ken.vandine@canonical.com>2012-03-21 18:07:38 -0400
commit5e759910a41ff6d82b1175c8a9da694960013c27 (patch)
treeba9ae0a538892b0c578bf584bda526df58d68af8 /src
parentb907100b21b0993e0adf3e76c8be57891e1cbc74 (diff)
parent86bfcf3079b88e25a9978bd5077c5b34d3fdeeb2 (diff)
downloadayatana-indicator-application-5e759910a41ff6d82b1175c8a9da694960013c27.tar.gz
ayatana-indicator-application-5e759910a41ff6d82b1175c8a9da694960013c27.tar.bz2
ayatana-indicator-application-5e759910a41ff6d82b1175c8a9da694960013c27.zip
Merging shared upstream rev into target branch.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in7
-rw-r--r--src/indicator-application.c40
2 files changed, 23 insertions, 24 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index e2fcae6..310a47c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -56,11 +56,8 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
libexec_PROGRAMS = indicator-application-service$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/m4/gcov.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/m4/gcov.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/src/indicator-application.c b/src/indicator-application.c
index 2c4f232..a1f547e 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -122,6 +122,7 @@ static void get_applications (GObject * obj, GAsyncResult * res, gpointer user_d
static void get_applications_helper (IndicatorApplication * self, GVariant * variant);
static void theme_dir_unref(IndicatorApplication * ia, const gchar * dir);
static void theme_dir_ref(IndicatorApplication * ia, const gchar * dir);
+static void icon_theme_remove_dir_from_search_path (const char * dir);
static void service_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data);
static void receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, GVariant * parameters, gpointer user_data);
@@ -207,9 +208,11 @@ indicator_application_dispose (GObject *object)
}
if (priv->theme_dirs != NULL) {
- while (g_hash_table_size(priv->theme_dirs)) {
- GList * keys = g_hash_table_get_keys(priv->theme_dirs);
- theme_dir_unref(INDICATOR_APPLICATION(object), (gchar *)keys->data);
+ gpointer directory;
+ GHashTableIter iter;
+ g_hash_table_iter_init (&iter, priv->theme_dirs);
+ while (g_hash_table_iter_next (&iter, &directory, NULL)) {
+ icon_theme_remove_dir_from_search_path (directory);
}
g_hash_table_destroy(priv->theme_dirs);
priv->theme_dirs = NULL;
@@ -951,24 +954,23 @@ theme_dir_unref(IndicatorApplication * ia, const gchar * dir)
{
IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(ia);
- /* Grab the count for this dir */
- int count = GPOINTER_TO_INT(g_hash_table_lookup(priv->theme_dirs, dir));
-
- /* Is this a simple deprecation, if so, we can just lower the
- number and move on. */
- if (count > 1) {
- count--;
- g_hash_table_insert(priv->theme_dirs, g_strdup(dir), GINT_TO_POINTER(count));
- return;
- }
-
- /* Try to remove it from the hash table, this makes sure
- that it existed */
- if (!g_hash_table_remove(priv->theme_dirs, dir)) {
- g_warning("Unref'd a directory that wasn't in the theme dir hash table.");
- return;
+ if (!g_hash_table_contains (priv->theme_dirs, dir)) {
+ g_warning("Unref'd a directory '%s' that wasn't in the theme dir hash table.", dir);
+ } else {
+ int count = GPOINTER_TO_INT(g_hash_table_lookup(priv->theme_dirs, dir));
+ if (count > 1) {
+ count--;
+ g_hash_table_insert(priv->theme_dirs, g_strdup(dir), GINT_TO_POINTER(count));
+ } else {
+ icon_theme_remove_dir_from_search_path (dir);
+ g_hash_table_remove (priv->theme_dirs, dir);
+ }
}
+}
+static void
+icon_theme_remove_dir_from_search_path (const char * dir)
+{
GtkIconTheme * icon_theme = gtk_icon_theme_get_default();
gchar ** paths;
gint path_count;