diff options
author | Shaun McCance <shaunm@gnome.org> | 2011-04-10 19:26:32 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2011-04-10 19:26:32 -0400 |
commit | 5184bc6d60044599d7e468156c5a31b6153dba64 (patch) | |
tree | e287893e30142307fd8744d698d67294b92bc0f7 /libyelp/yelp-settings.c | |
parent | 286300edec254e2bc3c722b6d47ff4f2a1b69ea4 (diff) | |
download | yelp-5184bc6d60044599d7e468156c5a31b6153dba64.tar.gz |
Don't crash when g-i-t-symbolic not installed, use symbolic properly
Diffstat (limited to 'libyelp/yelp-settings.c')
-rw-r--r-- | libyelp/yelp-settings.c | 129 |
1 files changed, 7 insertions, 122 deletions
diff --git a/libyelp/yelp-settings.c b/libyelp/yelp-settings.c index 17ce819a..af911af7 100644 --- a/libyelp/yelp-settings.c +++ b/libyelp/yelp-settings.c @@ -40,8 +40,6 @@ struct _YelpSettingsPriv { gchar *icons[YELP_SETTINGS_NUM_ICONS]; gint icon_size; - GHashTable *pixbufs; - GtkSettings *gtk_settings; GtkIconTheme *gtk_icon_theme; @@ -229,9 +227,6 @@ yelp_settings_init (YelpSettings *settings) settings->priv->mutex = g_mutex_new (); settings->priv->icon_size = 24; - settings->priv->pixbufs = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, g_object_unref); - for (i = 0; i < YELP_SETTINGS_NUM_ICONS; i++) settings->priv->icons[i] = NULL; for (i = 0; i < YELP_SETTINGS_NUM_FONTS; i++) { @@ -248,11 +243,6 @@ yelp_settings_dispose (GObject *object) { YelpSettings *settings = YELP_SETTINGS (object); - if (settings->priv->pixbufs != NULL) { - g_hash_table_destroy (settings->priv->pixbufs); - settings->priv->pixbufs; - } - G_OBJECT_CLASS (yelp_settings_parent_class)->dispose (object); } @@ -690,20 +680,6 @@ yelp_settings_get_icon_param (YelpSettingsIcon icon) /******************************************************************************/ -GdkPixbuf * -yelp_settings_get_icon_pixbuf (YelpSettings *settings, - const gchar *icon_name) -{ - GdkPixbuf *pixbuf; - - pixbuf = g_hash_table_lookup (settings->priv->pixbufs, icon_name); - if (pixbuf != NULL) - return g_object_ref (pixbuf); - - return gtk_icon_theme_load_icon (settings->priv->gtk_icon_theme, - icon_name, 16, 0, NULL); -} - gboolean yelp_settings_get_show_text_cursor (YelpSettings *settings) { @@ -944,12 +920,9 @@ icon_theme_changed (GtkIconTheme *theme, { GtkIconInfo *info; gint i; - GdkPixbuf *pixbuf; - GdkRGBA color, base; g_mutex_lock (settings->priv->mutex); - /* Set Yelp's note icons */ for (i = 0; i < YELP_SETTINGS_NUM_ICONS; i++) { if (settings->priv->icons[i] != NULL) g_free (settings->priv->icons[i]); @@ -967,94 +940,6 @@ icon_theme_changed (GtkIconTheme *theme, } } - /* Set pixbufs for named icons */ - gdk_rgba_parse (&color, settings->priv->colors[YELP_SETTINGS_COLOR_TEXT_LIGHT]); - gdk_rgba_parse (&base, settings->priv->colors[YELP_SETTINGS_COLOR_BASE]); - - info = gtk_icon_theme_lookup_icon (theme, "edit-clear-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("edit-clear"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "edit-find-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("system-search"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-bookmark-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, - &color, &base, - NULL, NULL, NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-bookmark-add"), pixbuf); - pixbuf = gtk_icon_info_load_symbolic (info, - &color, &color, - NULL, NULL, NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-bookmark-remove"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-page-task-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-task"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-page-tip-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-tip"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-page-video-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-video"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-page-ui-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-ui"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-page-problem-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-problem"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-page-search-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-search"), pixbuf); - gtk_icon_info_free (info); - - info = gtk_icon_theme_lookup_icon (theme, "yelp-page-symbolic", 16, - GTK_ICON_LOOKUP_FORCE_SVG); - pixbuf = gtk_icon_info_load_symbolic (info, &color, - NULL, NULL, NULL, - NULL, NULL); - g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page"), pixbuf); - gtk_icon_info_free (info); - g_mutex_unlock (settings->priv->mutex); g_signal_emit (settings, settings_signals[ICONS_CHANGED], 0); @@ -1065,13 +950,13 @@ yelp_settings_cmp_icons (const gchar *icon1, const gchar *icon2) { static const gchar *icons[] = { - "yelp-page-search", - "yelp-page-video", - "yelp-page-task", - "yelp-page-tip", - "yelp-page-problem", - "yelp-page-ui", - "yelp-page", + "yelp-page-search-symbolic", + "yelp-page-video-symbolic", + "yelp-page-task-symbolic", + "yelp-page-tip-symbolic", + "yelp-page-problem-symbolic", + "yelp-page-ui-symbolic", + "yelp-page-symbolic", NULL }; gint i; |