Make sure the data we produce is actually a list of uris, not a list of

Sat May 31 02:05:32 2008  Søren Sandmann  <sandmann@redhat.com>

	* appearance-desktop.c (wp_drag_get_data): Make sure the data we
	produce is actually a list of uris, not a list of paths. (Prevents
	crash when someone drags a thumbnail back into the list).
	
	* appearance-desktop.c (wp_add_image): Be robust against NULL
	filenames; this can happen if someone drops an http url on the
	dialog.


svn path=/trunk/; revision=8736
This commit is contained in:
Søren Sandmann 2008-05-31 06:07:40 +00:00 committed by Søren Sandmann Pedersen
parent 1917d0261b
commit 1cf5fbe409
2 changed files with 24 additions and 3 deletions

View file

@ -1,3 +1,13 @@
Sat May 31 02:05:32 2008 Søren Sandmann <sandmann@redhat.com>
* appearance-desktop.c (wp_drag_get_data): Make sure the data we
produce is actually a list of uris, not a list of paths. (Prevents
crash when someone drags a thumbnail back into the list).
* appearance-desktop.c (wp_add_image): Be robust against NULL
filenames; this can happen if someone drops an http url on the
dialog.
Sat May 31 00:41:20 2008 Søren Sandmann <sandmann@redhat.com>
* gnome-wp-item.c (options_lookup): The gconf string is "zoom",

View file

@ -177,6 +177,9 @@ wp_add_image (AppearanceData *data,
{
GnomeWPItem *item;
if (!filename)
return NULL;
item = g_hash_table_lookup (data->wp_hash, filename);
if (item != NULL)
@ -422,7 +425,8 @@ wp_uri_changed (const gchar *uri,
if (item == NULL)
item = wp_add_image (data, uri);
select_item (data, item, TRUE);
if (item)
select_item (data, item, TRUE);
}
}
@ -684,8 +688,14 @@ wp_drag_get_data (GtkWidget *widget,
GnomeWPItem *item = get_selected_item (data, NULL);
if (item != NULL) {
gchar *uris[] = { item->filename, NULL };
char *uris[2];
uris[0] = g_filename_to_uri (item->filename, NULL, NULL);
uris[1] = NULL;
gtk_selection_data_set_uris (selection_data, uris);
g_free (uris[0]);
}
}
}
@ -858,7 +868,8 @@ wp_load_stuffs (void *user_data)
else if (strcmp (style, "none") != 0)
{
item = wp_add_image (data, imagepath);
select_item (data, item, FALSE);
if (item)
select_item (data, item, FALSE);
}
item = g_hash_table_lookup (data->wp_hash, "(none)");