Bug 455852

Summary: Spectacle %Nd file format string not working
Product: [Applications] Spectacle Reporter: cbarrabes <xarlieb>
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: RESOLVED NOT A BUG    
Severity: minor CC: kde, yerrey
Priority: NOR    
Version First Reported In: 22.04.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: not even the pattern preview works
screenshot filename do not follow the defined pattern
screenshot filename do not follow the defined pattern v2

Description cbarrabes 2022-06-23 15:22:49 UTC
Created attachment 150098 [details]
not even the pattern preview works

I found that the %Nd substitution when saving a screenshot from Spectacle is not working. 


STEPS TO REPRODUCE
1. Configure the following filename pattern  Screenshot_%Y%M%D_%3d
2. Take screenshot


OBSERVED RESULT
The filename of the saved screenshot adds a sequentially increasing random number. Not even the filename preview works.

EXPECTED RESULT
The string Screenshot_%Y%M%D_%3d should create files like "Screenshot_20220623_001, Screenshot_20220623_002" etc but it does not. See attached screenshot.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.1
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.5-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
While I am using Wayland, this behavior is present also in an X11 session but in X11you can make it work with %4d instead of %3d. It has also been happening for several releases of the desktop.
Comment 1 cbarrabes 2022-06-23 15:23:25 UTC
Created attachment 150099 [details]
screenshot filename do not follow the defined pattern
Comment 2 cbarrabes 2022-06-23 15:24:22 UTC
Created attachment 150100 [details]
screenshot filename do not follow the defined pattern v2
Comment 3 Yerrey Dev 2022-06-23 20:58:40 UTC
You already have a file with the exact same date, appended with a timestamp which causes the following sequential ordering to think that's the highest number sequential ordering you have, and it uses that to increase it by one. Remove all screenshots in your folder starting with "Screenshot_20220623_" and it should work as intended.