Check that the colors aren't NULL before calling gdk_color_free
2004-09-22 Rodney Dawes <dobey@novell.com> * gnome-wp-item.c (gnome_wp_item_free): Check that the colors aren't NULL before calling gdk_color_free * gnome-wp-xml.c (gnome_wp_xml_load_xml): Check that the item isn't already listed, before we try to add the wallpaper to the list (gnome_wp_xml_load_list): Load XML files from the correct directory
This commit is contained in:
parent
9cb21bffd5
commit
1be7aa7de7
3 changed files with 25 additions and 3 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2004-09-22 Rodney Dawes <dobey@novell.com>
|
||||||
|
|
||||||
|
* gnome-wp-item.c (gnome_wp_item_free):
|
||||||
|
Check that the colors aren't NULL before calling gdk_color_free
|
||||||
|
|
||||||
|
* gnome-wp-xml.c (gnome_wp_xml_load_xml):
|
||||||
|
Check that the item isn't already listed, before we try to add
|
||||||
|
the wallpaper to the list
|
||||||
|
(gnome_wp_xml_load_list): Load XML files from the correct directory
|
||||||
|
|
||||||
2004-08-20 Frederic Crozat <fcrozat@mandrakesoft.com>
|
2004-08-20 Frederic Crozat <fcrozat@mandrakesoft.com>
|
||||||
|
|
||||||
* gnome-wp-capplet.c: (gnome_wp_icon_theme_changed),
|
* gnome-wp-capplet.c: (gnome_wp_icon_theme_changed),
|
||||||
|
|
|
@ -89,8 +89,11 @@ void gnome_wp_item_free (GnomeWPItem * item) {
|
||||||
g_free (item->pri_color);
|
g_free (item->pri_color);
|
||||||
g_free (item->sec_color);
|
g_free (item->sec_color);
|
||||||
|
|
||||||
gdk_color_free (item->pcolor);
|
if (item->pcolor != NULL)
|
||||||
gdk_color_free (item->scolor);
|
gdk_color_free (item->pcolor);
|
||||||
|
|
||||||
|
if (item->scolor != NULL)
|
||||||
|
gdk_color_free (item->scolor);
|
||||||
|
|
||||||
gnome_wp_info_free (item->fileinfo);
|
gnome_wp_info_free (item->fileinfo);
|
||||||
gnome_wp_info_free (item->uriinfo);
|
gnome_wp_info_free (item->uriinfo);
|
||||||
|
|
|
@ -95,6 +95,7 @@ static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
||||||
xmlDoc * wplist;
|
xmlDoc * wplist;
|
||||||
xmlNode * root, * list, * wpa;
|
xmlNode * root, * list, * wpa;
|
||||||
GdkColor color1, color2;
|
GdkColor color1, color2;
|
||||||
|
GnomeWPItem * item;
|
||||||
|
|
||||||
wplist = xmlParseFile (filename);
|
wplist = xmlParseFile (filename);
|
||||||
|
|
||||||
|
@ -151,6 +152,14 @@ static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure we don't already have this one */
|
||||||
|
item = g_hash_table_lookup (capplet->wphash, wp->filename);
|
||||||
|
|
||||||
|
if (item != NULL) {
|
||||||
|
gnome_wp_item_free (wp);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Verify the colors and alloc some GdkColors here */
|
/* Verify the colors and alloc some GdkColors here */
|
||||||
if (wp->shade_type == NULL) {
|
if (wp->shade_type == NULL) {
|
||||||
wp->shade_type = gconf_client_get_string (capplet->client,
|
wp->shade_type = gconf_client_get_string (capplet->client,
|
||||||
|
@ -240,7 +249,7 @@ void gnome_wp_xml_load_list (GnomeWPCapplet * capplet) {
|
||||||
for (i = 0; xdgdirs && xdgdirs[i]; i++) {
|
for (i = 0; xdgdirs && xdgdirs[i]; i++) {
|
||||||
gchar * datadir;
|
gchar * datadir;
|
||||||
|
|
||||||
datadir = g_build_filename (xdgdirs[i], "gnome-wallpaper-properties",
|
datadir = g_build_filename (xdgdirs[i], "gnome-background-properties",
|
||||||
NULL);
|
NULL);
|
||||||
if (g_file_test (datadir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
|
if (g_file_test (datadir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
|
||||||
gnome_vfs_directory_list_load (&list, datadir,
|
gnome_vfs_directory_list_load (&list, datadir,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue