Bug 421792 - Save Incremental Version fails with specific file paths
Summary: Save Incremental Version fails with specific file paths
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-19 21:16 UTC by Anna Medonosova
Modified: 2020-05-20 10:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Medonosova 2020-05-19 21:16:29 UTC
SUMMARY
When a directory name resembles incremental version naming scheme, 'Save incremental version' fails. The file path is parsed incorrectly - instead of the file name, Krita increments the number in the directory part of the path. Since such directory does not exist, saving fails.

The behavior is the same in git master, 4.3beta1 and 4.2.9.


STEPS TO REPRODUCE
1. Create a directory test_1.t
2. Create a document, save to test_1.t
3. Make a change
4. Save incremental version with File -> 'Save Incremental Version'

OBSERVED RESULT
"Could not save [...]/test_2.t/test_increments.kra
Reason: Cannot open file for writing. Reason: The file could not be opened."

EXPECTED RESULT
The file name is correctly incremented and saved.
Comment 1 Halla Rempt 2020-05-20 10:26:16 UTC
Git commit ba632d486d6e700b837b3d8039916919e1ae5871 by Boudewijn Rempt.
Committed on 20/05/2020 at 10:25.
Pushed by rempt into branch 'krita/4.3'.

Only regexp the filename, not the whole path for save incremental

And incremental backup, too.

M  +10   -8    libs/ui/KisViewManager.cpp

https://invent.kde.org/graphics/krita/commit/ba632d486d6e700b837b3d8039916919e1ae5871
Comment 2 Halla Rempt 2020-05-20 10:26:22 UTC
Git commit 61d361583c764a0e1f55ff0268836253a985476b by Boudewijn Rempt.
Committed on 20/05/2020 at 10:26.
Pushed by rempt into branch 'master'.

Only regexp the filename, not the whole path for save incremental

And incremental backup, too.
(cherry picked from commit ba632d486d6e700b837b3d8039916919e1ae5871)

M  +10   -8    libs/ui/KisViewManager.cpp

https://invent.kde.org/graphics/krita/commit/61d361583c764a0e1f55ff0268836253a985476b