Harold Aling wrote:
> Nope... No error (except for the missing ; on line 7;-)) and the broken
> link gets deleted correctly...
Ok, I think I know whats wrong. Please try the attached patch.
> -H-
Benedikt
Index: thunar-vfs/thunar-vfs-unlink-job.c
===================================================================
--- thunar-vfs/thunar-vfs-unlink-job.c (revision 19876)
+++ thunar-vfs/thunar-vfs-unlink-job.c (working copy)
@@ -216,6 +216,7 @@
{
ThunarVfsInfo *info;
gchar *message;
+ gchar *display_name;
gchar *absolute_path;
gchar *thumbnail_path;
@@ -226,43 +227,48 @@
info = _thunar_vfs_info_new_internal (path, absolute_path, NULL);
if (G_LIKELY (info != NULL))
{
- /* update the progress message */
- thunar_vfs_interactive_job_info_message (THUNAR_VFS_INTERACTIVE_JOB (unlink_job), info->display_name);
+ /* use the display name from the file info */
+ display_name = g_strdup (info->display_name);
- /* try to unlink the file */
- if (G_UNLIKELY (g_remove (absolute_path) < 0 && errno != ENOENT))
- {
- message = g_strdup_printf (_("Failed to remove \"%s\".\n\nDo you want to skip it?"), info->display_name);
- thunar_vfs_interactive_job_skip (THUNAR_VFS_INTERACTIVE_JOB (unlink_job), message);
- g_free (message);
- }
- else
- {
- /* feed a delete event to the vfs monitor */
- thunar_vfs_monitor_feed (THUNAR_VFS_INTERACTIVE_JOB (unlink_job)->monitor,
- THUNAR_VFS_MONITOR_EVENT_DELETED, info->path);
+ /* release the info */
+ thunar_vfs_info_unref (info);
+ }
+ else
+ {
+ /* determine the display name from the absolute path */
+ display_name = g_filename_display_basename (absolute_path);
+ }
- /* delete thumbnails for regular files */
- if (G_LIKELY (info->type == THUNAR_VFS_FILE_TYPE_REGULAR))
- {
- /* ditch the normal thumbnail (if any) */
- thumbnail_path = thunar_vfs_thumbnail_for_path (path, THUNAR_VFS_THUMB_SIZE_NORMAL);
- g_unlink (thumbnail_path);
- g_free (thumbnail_path);
+ /* update the progress message */
+ thunar_vfs_interactive_job_info_message (THUNAR_VFS_INTERACTIVE_JOB (unlink_job), display_name);
- /* ditch the large thumbnail (if any) */
- thumbnail_path = thunar_vfs_thumbnail_for_path (path, THUNAR_VFS_THUMB_SIZE_LARGE);
- g_unlink (thumbnail_path);
- g_free (thumbnail_path);
- }
- }
+ /* try to unlink the file */
+ if (G_UNLIKELY (g_remove (absolute_path) < 0 && errno != ENOENT))
+ {
+ message = g_strdup_printf (_("Failed to remove \"%s\".\n\nDo you want to skip it?"), display_name);
+ thunar_vfs_interactive_job_skip (THUNAR_VFS_INTERACTIVE_JOB (unlink_job), message);
+ g_free (message);
+ }
+ else
+ {
+ /* feed a delete event to the vfs monitor */
+ thunar_vfs_monitor_feed (THUNAR_VFS_INTERACTIVE_JOB (unlink_job)->monitor,
+ THUNAR_VFS_MONITOR_EVENT_DELETED, path);
- /* release the info */
- thunar_vfs_info_unref (info);
+ /* ditch the normal thumbnail (if any) */
+ thumbnail_path = thunar_vfs_thumbnail_for_path (path, THUNAR_VFS_THUMB_SIZE_NORMAL);
+ g_unlink (thumbnail_path);
+ g_free (thumbnail_path);
+
+ /* ditch the large thumbnail (if any) */
+ thumbnail_path = thunar_vfs_thumbnail_for_path (path, THUNAR_VFS_THUMB_SIZE_LARGE);
+ g_unlink (thumbnail_path);
+ g_free (thumbnail_path);
}
- /* release the absolute path */
+ /* cleanup */
g_free (absolute_path);
+ g_free (display_name);
}
_______________________________________________
Thunar-dev mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/thunar-dev