Bug 403583 - Backup on save prefix/suffix as contextually determined string, e.g. a timestamp
Summary: Backup on save prefix/suffix as contextually determined string, e.g. a timestamp
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 18.12.1
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-25 10:09 UTC by Michael D
Modified: 2019-09-11 12:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.63


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael D 2019-01-25 10:09:33 UTC
At the moment, the "backup on save" feature allows a fixed prefix/suffix string. But it would be nice if it allowed for contextually determined strings such as timestamps that would allow for automatic versioning of documents.

The idea was proposed on reddit: https://www.reddit.com/r/kde/comments/aiywqi/is_it_possible_to_save_kate_backups_with/
Comment 1 Michael D 2019-01-25 10:11:53 UTC
Very sorry, this was meant to be a wish, not a bug. I can't see that I can change it though.
Comment 2 Kåre Särs 2019-01-25 19:38:58 UTC
Thanks! I think it is a good wish :)
Comment 3 Dominik Haumann 2019-02-02 08:14:18 UTC
I already have a proof of concept patch for this here that supports %{hh}, %{mm}, %{ss}, and also YYYY, MM and DD. Since I have some other plans for such kind of macro expansion, this will wait a bit more.
Comment 4 Michael D 2019-02-03 17:10:07 UTC
Great! Looking forward to the patch!
Comment 5 Dominik Haumann 2019-09-10 13:40:28 UTC
Pending patch: https://phabricator.kde.org/D23832 which supports:

- %{Date:Locale}
- %{Date:ISO}
- %{Date:<value>} - see https://doc.qt.io/qt-5/qdate.html#toString
- %{Time:Locale}
- %{Time:ISO}
- %{Time:<value>} - see https://doc.qt.io/qt-5/qtime.html#toString
- %{ENV:<value>}
- %{JS:<expression>}
- %{UUID}
Comment 6 Dominik Haumann 2019-09-11 12:11:36 UTC
Git commit a32b79d9394a72f19c4da5c210227472c8e00630 by Dominik Haumann.
Committed on 11/09/2019 at 12:11.
Pushed by dhaumann into branch 'master'.

Backup on save: Support time and date string replacements

Summary:
Supported variables are:
- %{Date:Locale}
- %{Date:ISO}
- %{Date:<value>} - see https://doc.qt.io/qt-5/qdate.html#toString
- %{Time:Locale}
- %{Time:ISO}
- %{Time:<value>} - see https://doc.qt.io/qt-5/qtime.html#toString
- %{ENV:<value>}
- %{JS:<expression>}
- %{UUID}

Screenshot:
{F7337486}
FIXED-IN: 5.63

Reviewers: cullmann

Reviewed By: cullmann

Subscribers: ngraham, kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D23832

M  +16   -0    src/dialogs/katedialogs.cpp
M  +11   -3    src/document/katedocument.cpp

https://commits.kde.org/ktexteditor/a32b79d9394a72f19c4da5c210227472c8e00630