aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-03-21 16:50:53 -0500
committerTed Gould <ted@gould.cx>2012-03-21 16:50:53 -0500
commit63e76db59850f64c5ef1f5e766258e4c7583e9bd (patch)
tree0126c7afc69d73f16c8727573bbd9d7a038454d2 /src
parentfed02bf9683b491b5db0196495377671594de98b (diff)
parentdaf30a3ca8f5127e383f37d00c5e630033321357 (diff)
downloadayatana-indicator-application-63e76db59850f64c5ef1f5e766258e4c7583e9bd.tar.gz
ayatana-indicator-application-63e76db59850f64c5ef1f5e766258e4c7583e9bd.tar.bz2
ayatana-indicator-application-63e76db59850f64c5ef1f5e766258e4c7583e9bd.zip
Import upstream version 0.4.94
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;