Escape the path for thumbnails and fileinfo (#135089)
2004-02-24 Rodney Dawes <dobey@ximian.com> * gnome-wp-info.c (gnome_wp_info_new): * gnome-wp-item.c (gnome_wp_item_get_thumbnail): Escape the path for thumbnails and fileinfo (#135089) Fixes #135089
This commit is contained in:
parent
19c8dc6001
commit
55a2057d87
3 changed files with 23 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-02-24 Rodney Dawes <dobey@ximian.com>
|
||||||
|
|
||||||
|
* gnome-wp-info.c (gnome_wp_info_new):
|
||||||
|
* gnome-wp-item.c (gnome_wp_item_get_thumbnail): Escape the path for
|
||||||
|
thumbnails and fileinfo (#135089)
|
||||||
|
|
||||||
|
Fixes #135089
|
||||||
|
|
||||||
2004-02-24 Rodney Dawes <dobey@ximian.com>
|
2004-02-24 Rodney Dawes <dobey@ximian.com>
|
||||||
|
|
||||||
* gnome-wp-xml.c (gnome_wp_oad_legacy): Check that the file exists,
|
* gnome-wp-xml.c (gnome_wp_oad_legacy): Check that the file exists,
|
||||||
|
|
|
@ -29,7 +29,7 @@ GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
|
||||||
GnomeVFSResult result;
|
GnomeVFSResult result;
|
||||||
|
|
||||||
info = gnome_vfs_file_info_new ();
|
info = gnome_vfs_file_info_new ();
|
||||||
result = gnome_vfs_get_file_info (uri, info,
|
result = gnome_vfs_get_file_info (gnome_vfs_escape_path_string (uri), info,
|
||||||
GNOME_VFS_FILE_INFO_DEFAULT |
|
GNOME_VFS_FILE_INFO_DEFAULT |
|
||||||
GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
|
GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
|
||||||
GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
@ -40,8 +40,11 @@ GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
|
||||||
new->mime_type = g_strdup ("image/x-no-data");
|
new->mime_type = g_strdup ("image/x-no-data");
|
||||||
new->uri = g_strdup (uri);
|
new->uri = g_strdup (uri);
|
||||||
|
|
||||||
new->thumburi = g_strconcat (g_get_home_dir (), "/.thumbnails/normal/",
|
new->thumburi = g_strconcat (g_get_home_dir (),
|
||||||
gnome_thumbnail_md5 (uri), ".png", NULL);
|
"/.thumbnails/normal/",
|
||||||
|
gnome_thumbnail_md5 (gnome_vfs_escape_path_string (uri)),
|
||||||
|
".png",
|
||||||
|
NULL);
|
||||||
|
|
||||||
new->name = g_strdup (_("No Wallpaper"));
|
new->name = g_strdup (_("No Wallpaper"));
|
||||||
|
|
||||||
|
@ -55,10 +58,14 @@ GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
|
||||||
new->uri = g_strdup (uri);
|
new->uri = g_strdup (uri);
|
||||||
|
|
||||||
new->thumburi = gnome_thumbnail_factory_lookup (thumbs,
|
new->thumburi = gnome_thumbnail_factory_lookup (thumbs,
|
||||||
new->uri, info->mtime);
|
gnome_vfs_escape_path_string (new->uri),
|
||||||
|
info->mtime);
|
||||||
if (new->thumburi == NULL) {
|
if (new->thumburi == NULL) {
|
||||||
new->thumburi = g_strconcat (g_get_home_dir (), "/.thumbnails/normal/",
|
new->thumburi = g_strconcat (g_get_home_dir (),
|
||||||
gnome_thumbnail_md5 (uri), ".png", NULL);
|
"/.thumbnails/normal/",
|
||||||
|
gnome_thumbnail_md5 (gnome_vfs_escape_path_string (uri)),
|
||||||
|
".png",
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
new->name = g_strdup (info->name);
|
new->name = g_strdup (info->name);
|
||||||
new->mime_type = g_strdup (info->mime_type);
|
new->mime_type = g_strdup (info->mime_type);
|
||||||
|
|
|
@ -95,10 +95,10 @@ GdkPixbuf * gnome_wp_item_get_thumbnail (GnomeWPItem * item,
|
||||||
pixbuf = gdk_pixbuf_copy (bgpixbuf);
|
pixbuf = gdk_pixbuf_copy (bgpixbuf);
|
||||||
} else {
|
} else {
|
||||||
pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbs,
|
pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbs,
|
||||||
item->filename,
|
gnome_vfs_escape_path_string (item->filename),
|
||||||
item->fileinfo->mime_type);
|
item->fileinfo->mime_type);
|
||||||
gnome_thumbnail_factory_save_thumbnail (thumbs, pixbuf,
|
gnome_thumbnail_factory_save_thumbnail (thumbs, pixbuf,
|
||||||
item->filename,
|
gnome_vfs_escape_path_string (item->filename),
|
||||||
item->fileinfo->mtime);
|
item->fileinfo->mtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue