Project

General

Profile

Bug #11745

Selected Images > delete/trash, unexpectedly removes parent directory

Added by Tom Brossman over 1 year ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
Lighttable
Target version:
Start date:
09/21/2017
Due date:
% Done:

100%

Affected Version:
2.2.5
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

At present, if I select all the images in a collection (and if this collection represents all files in a directory) and choose "trash", all the files are deleted which is the expected outcome. My issue is that the parent directory is also deleted, even though the operation I performed was limited to files, not directories. This is not the expected outcome, I want the parent directory to remain even though it is empty.

I cannot find anything in the settings to control this, or any similar bug reports. Can this behavior be changed? As a workaround I can use "remove" and then manually delete the files in Nautilus, but I would prefer to do this from within Darktable.

To reproduce this, import a test folder of images, select all in the lighttable, click "trash", and all images plus the test folder are deleted.

Associated revisions

Revision 93152937
Added by Tobias Ellinghaus over 1 year ago

Add option to ask before removing empty dirs

Fixes #11745

History

#1 Updated by Tobias Ellinghaus over 1 year ago

  • System changed from Ubuntu to all
  • Status changed from New to Confirmed
  • % Done changed from 0 to 10

This is happening on purpose, see https://github.com/darktable-org/darktable/blob/master/src/common/film.c#L312 but I can understand that it might be unexpected. I'll discuss with the others if we want to make that configurable.

#2 Updated by Roman Lebedev over 1 year ago

Tom Brossman wrote:

At present, if I select all the images in a collection (and if this collection represents all files in a directory) and choose "trash", all the files are deleted which is the expected outcome. My issue is that the parent directory is also deleted, even though the operation I performed was limited to files, not directories. This is not the expected outcome, I want the parent directory to remain even though it is empty.

You are talking about the filesystem directory, or a directory/flim in the collect module?

I cannot find anything in the settings to control this, or any similar bug reports. Can this behavior be changed? As a workaround I can use "remove" and then manually delete the files in Nautilus, but I would prefer to do this from within Darktable.

To reproduce this, import a test folder of images, select all in the lighttable, click "trash", and all images plus the test folder are deleted.

#3 Updated by Tom Brossman over 1 year ago

Roman Lebedev wrote:

You are talking about the filesystem directory, or a directory/flim in the collect module?

The filesystem directory is removed, nothing to do with the collections module (though it's probably also removed from there but that's expected).

My workflow on the Darktable computer is to import raw images to a specific directory, import them for editing in Darktable then export to JPEG, then remove the raw images. The raw images are backed up elsewhere if I need to edit them again. Darktable keeps deleting this directory and I would prefer to leave it in place.

If I browse to a directory full of files using my OS file manager and "select all > delete", the parent directory is never removed. Only the files are removed. Darktable's default behaviour is different.

#4 Updated by Tobias Ellinghaus over 1 year ago

  • Status changed from Confirmed to Fixed
  • % Done changed from 10 to 100

#5 Updated by Roman Lebedev over 1 year ago

  • Target version set to 2.4.0

Also available in: Atom PDF