Skip to content

jobs: do not try to delete duplicate XMP if it does not exist - #22228

Merged
TurboGit merged 2 commits into
darktable-org:masterfrom
masterpiga:fix_22160
Sep 10, 2026
Merged

jobs: do not try to delete duplicate XMP if it does not exist#22228
TurboGit merged 2 commits into
darktable-org:masterfrom
masterpiga:fix_22160

Conversation

@masterpiga

Copy link
Copy Markdown
Collaborator

When deleting a duplicate image whose sidecar file does not exist on
disk (such as a virgin duplicate when XMP writing is set to "after
edit"), darktable still attempted to send the non-existent XMP file
to trash. On Windows, dt_win_file_trash() failed with G_IO_ERROR_FAILED
rather than G_IO_ERROR_NOT_FOUND, prompting the user with an error
dialog.

Check for file existence before attempting to delete the duplicate's
sidecar, and guard delete_file_from_disk() to treat absent files as
already deleted.

UNTESTED, as I do not have access to a windows machine.

Fixes #22160

@masterpiga masterpiga added this to the 5.8 milestone Sep 10, 2026
@masterpiga masterpiga added bugfix pull request fixing a bug priority: low core features work as expected, only secondary/optional features don't difficulty: trivial some changes in a couple of functions scope: UI user interface and interactions labels Sep 10, 2026
@Thanatomanic

Copy link
Copy Markdown

I tested this and the trashing error is done. Thanks!

Comment thread src/control/jobs/control_jobs.c Outdated

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit
TurboGit merged commit 64b08ef into darktable-org:master Sep 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug difficulty: trivial some changes in a couple of functions priority: low core features work as expected, only secondary/optional features don't scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleting a virgin duplicate with XMP creation 'after edit' triggers trashing error

3 participants