From 0bbee36d1c080b247d14c5131666c7436761ece6 Mon Sep 17 00:00:00 2001 From: Sense Hofstede Date: Thu, 22 Jul 2010 16:51:10 +0200 Subject: Clean-up and renaming variables and functions everywhere to use icon_theme_path for the sake of consistency. Doesn't seem to do antyhing, though. --- src/app-indicator.c | 63 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 24 deletions(-) (limited to 'src/app-indicator.c') diff --git a/src/app-indicator.c b/src/app-indicator.c index 137c4c4..91b0ecd 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -69,7 +69,7 @@ struct _AppIndicatorPrivate { AppIndicatorStatus status; gchar *icon_name; gchar *attention_icon_name; - gchar * icon_path; + gchar *icon_theme_path; DbusmenuServer *menuservice; GtkWidget *menu; @@ -88,7 +88,7 @@ enum { NEW_ATTENTION_ICON, NEW_STATUS, CONNECTION_CHANGED, - NEW_PATH, + NEW_ICON_THEME_PATH, LAST_SIGNAL }; @@ -349,16 +349,16 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_NONE, 1, G_TYPE_BOOLEAN, G_TYPE_NONE); /** - AppIndicator::new-icon: + AppIndicator::new-icon-theme-path: @arg0: The #AppIndicator object Signaled when there is a new icon set for the object. */ - signals[NEW_PATH] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_PATH, + signals[NEW_ICON_THEME_PATH] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH, G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (AppIndicatorClass, new_path), + G_STRUCT_OFFSET (AppIndicatorClass, new_icon_theme_path), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); @@ -381,7 +381,7 @@ app_indicator_init (AppIndicator *self) priv->status = APP_INDICATOR_STATUS_PASSIVE; priv->icon_name = NULL; priv->attention_icon_name = NULL; - priv->icon_path = NULL; + priv->icon_theme_path = NULL; priv->menu = NULL; priv->menuservice = NULL; @@ -503,9 +503,9 @@ app_indicator_finalize (GObject *object) priv->attention_icon_name = NULL; } - if (priv->icon_path != NULL) { - g_free(priv->icon_path); - priv->icon_path = NULL; + if (priv->icon_theme_path != NULL) { + g_free(priv->icon_theme_path); + priv->icon_theme_path = NULL; } G_OBJECT_CLASS (app_indicator_parent_class)->finalize (object); @@ -573,7 +573,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu break; case PROP_ICON_THEME_PATH: - app_indicator_set_icon_path (APP_INDICATOR (object), + app_indicator_set_icon_theme_path (APP_INDICATOR (object), g_value_get_string (value)); check_connect (self); break; @@ -618,7 +618,7 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa break; case PROP_ICON_THEME_PATH: - g_value_set_string (value, priv->icon_path); + g_value_set_string (value, priv->icon_theme_path); break; case PROP_MENU: @@ -1040,12 +1040,12 @@ app_indicator_new (const gchar *id, @id: The unique id of the indicator to create. @icon_name: The icon name for this indicator @category: The category of indicator. - @icon_path: A custom path for finding icons. + @icon_theme_path: A custom path for finding icons. Creates a new #AppIndicator setting the properties: #AppIndicator:id with @id, #AppIndicator:category with @category, #AppIndicator:icon-name with - @icon_name and #AppIndicator:icon-theme-path with @icon_path. + @icon_name and #AppIndicator:icon-theme-path with @icon_theme_path. Return value: A pointer to a new #AppIndicator object. */ @@ -1053,13 +1053,13 @@ AppIndicator * app_indicator_new_with_path (const gchar *id, const gchar *icon_name, AppIndicatorCategory category, - const gchar *icon_path) + const gchar *icon_theme_path) { AppIndicator *indicator = g_object_new (APP_INDICATOR_TYPE, PROP_ID_S, id, PROP_CATEGORY_S, category_from_enum (category), PROP_ICON_NAME_S, icon_name, - PROP_ICON_THEME_PATH_S, icon_path, + PROP_ICON_THEME_PATH_S, icon_theme_path, NULL); return indicator; @@ -1150,26 +1150,25 @@ app_indicator_set_icon (AppIndicator *self, const gchar *icon_name) } /** - app_indicator_set_icon_theme: + app_indicator_set_icon_theme_path: @self: The #AppIndicator object to use - @icon_path: The icon theme path to set. + @icon_theme_path: The icon theme path to set. Sets the path to use when searching for icons. **/ void -app_indicator_set_icon_path (AppIndicator *self, const gchar *icon_path) +app_indicator_set_icon_theme_path (AppIndicator *self, const gchar *icon_theme_path) { g_return_if_fail (IS_APP_INDICATOR (self)); - g_return_if_fail (icon_path != NULL); - if (g_strcmp0 (self->priv->icon_path, icon_path) != 0) + if (g_strcmp0 (self->priv->icon_theme_path, icon_theme_path) != 0) { - if (self->priv->icon_path != NULL) - g_free(self->priv->icon_path); + if (self->priv->icon_theme_path != NULL) + g_free(self->priv->icon_theme_path); - self->priv->icon_path = g_strdup(icon_path); + self->priv->icon_theme_path = g_strdup(icon_theme_path); - g_signal_emit (self, signals[NEW_PATH], 0, TRUE); + g_signal_emit (self, signals[NEW_ICON_THEME_PATH], 0, TRUE); } return; @@ -1666,6 +1665,22 @@ app_indicator_get_icon (AppIndicator *self) return self->priv->icon_name; } +/** + app_indicator_get_icon_theme_path: + @self: The #AppIndicator object to use + + Wrapper function for property #AppIndicator:icon-theme-path. + + Return value: The current icon theme path. +*/ +const gchar * +app_indicator_get_icon_theme_path (AppIndicator *self) +{ + g_return_val_if_fail (IS_APP_INDICATOR (self), NULL); + + return self->priv->icon_theme_path; +} + /** app_indicator_get_attention_icon: @self: The #AppIndicator object to use -- cgit v1.2.3