simplify some more code, and fix a crash when the cursor theme in GConf is
2007-10-29 Jens Granseuer <jensgr@gmx.net> * appearance-style.c: (gtk_theme_changed), (window_theme_changed), (icon_theme_changed), (update_cursor_size_scale), (cursor_theme_changed): * appearance-themes.c: (theme_selection_changed_cb): * theme-util.c: (theme_is_writable): * theme-util.h: simplify some more code, and fix a crash when the cursor theme in GConf is unset that I introduced in r8212 svn path=/trunk/; revision=8228
This commit is contained in:
parent
194de56db9
commit
286cdd1fcd
5 changed files with 18 additions and 9 deletions
|
@ -1,3 +1,13 @@
|
|||
2007-10-29 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* appearance-style.c: (gtk_theme_changed), (window_theme_changed),
|
||||
(icon_theme_changed), (update_cursor_size_scale),
|
||||
(cursor_theme_changed):
|
||||
* appearance-themes.c: (theme_selection_changed_cb):
|
||||
* theme-util.c: (theme_is_writable):
|
||||
* theme-util.h: simplify some more code, and fix a crash when the
|
||||
cursor theme in GConf is unset that I introduced in r8212
|
||||
|
||||
2007-10-28 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* appearance-style.c: (prepare_list):
|
||||
|
|
|
@ -328,7 +328,7 @@ gtk_theme_changed (GConfPropertyEditor *peditor,
|
|||
}
|
||||
|
||||
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "gtk_themes_delete"),
|
||||
theme_is_writable (theme, THEME_TYPE_GTK));
|
||||
theme_is_writable (theme));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -344,7 +344,7 @@ window_theme_changed (GConfPropertyEditor *peditor,
|
|||
theme = gnome_theme_info_find (name);
|
||||
|
||||
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "window_themes_delete"),
|
||||
theme_is_writable (theme, THEME_TYPE_WINDOW));
|
||||
theme_is_writable (theme));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -360,7 +360,7 @@ icon_theme_changed (GConfPropertyEditor *peditor,
|
|||
theme = gnome_theme_icon_info_find (name);
|
||||
|
||||
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "icon_themes_delete"),
|
||||
theme_is_writable (theme, THEME_TYPE_ICON));
|
||||
theme_is_writable (theme));
|
||||
}
|
||||
|
||||
#ifdef HAVE_XCURSOR
|
||||
|
@ -456,7 +456,7 @@ update_cursor_size_scale (GnomeThemeCursorInfo *theme,
|
|||
|
||||
size = g_array_index (theme->sizes, gint, index);
|
||||
} else {
|
||||
if (theme->sizes->len > 0)
|
||||
if (theme && theme->sizes->len > 0)
|
||||
size = g_array_index (theme->sizes, gint, 0);
|
||||
else
|
||||
size = 18;
|
||||
|
@ -482,7 +482,7 @@ cursor_theme_changed (GConfPropertyEditor *peditor,
|
|||
update_cursor_size_scale (theme, data);
|
||||
|
||||
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "cursor_themes_delete"),
|
||||
theme_is_writable (theme, THEME_TYPE_CURSOR));
|
||||
theme_is_writable (theme));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -594,7 +594,7 @@ theme_selection_changed_cb (GtkWidget *icon_view, AppearanceData *data)
|
|||
}
|
||||
|
||||
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "theme_delete"),
|
||||
theme_is_writable (theme, THEME_TYPE_META));
|
||||
theme_is_writable (theme));
|
||||
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "theme_save"), is_custom);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,12 +26,11 @@
|
|||
#include <string.h>
|
||||
|
||||
gboolean
|
||||
theme_is_writable (const gpointer theme, ThemeType type)
|
||||
theme_is_writable (const gpointer theme)
|
||||
{
|
||||
GnomeThemeCommonInfo *info = theme;
|
||||
GnomeVFSResult vfs_result;
|
||||
GnomeVFSFileInfo *vfs_info;
|
||||
const gchar *theme_path;
|
||||
gboolean writable;
|
||||
|
||||
if (info == NULL || info->path == NULL)
|
||||
|
|
|
@ -50,7 +50,7 @@ typedef enum {
|
|||
THEME_TYPE_CURSOR
|
||||
} ThemeType;
|
||||
|
||||
gboolean theme_is_writable (const gpointer theme, ThemeType type);
|
||||
gboolean theme_is_writable (const gpointer theme);
|
||||
gboolean theme_delete (const gchar *name, ThemeType type);
|
||||
|
||||
gboolean theme_model_iter_last (GtkTreeModel *model, GtkTreeIter *iter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue