[PATCH] make ksnapshot increment the last number

Riccardo Iaconelli riccardo at kde.org
Wed Oct 3 16:50:07 BST 2007


On Wednesday 03 October 2007 11:10:28 Jos Poortvliet wrote:
> On 10/3/07, Riccardo Iaconelli <riccardo at kde.org> wrote:
> > On Wednesday 03 October 2007 08:25:49 Andras Mantia wrote:
> > > On Tuesday 02 October 2007, Matthew Woehlke wrote:
> > > > Hmm... for writing maybe. But DD-MM-YYYY doesn't sort properly, where
> > > > YYYY-MM-DD does ;-).
> > >
> > > And that is official for some countries, like Hungary. :)
> >
> > Shall we check for where the 20?? sequence appears, and increment
> > smartly?
>
> Well, if you're up to doing that, I think it would rock. But as 4.0 is
> getting closer, we might just fix it basically (just increment the
> last number) and get back to this for 4.1? Unless you  or someone else
> can whip up a patch in 20 minutes ;-)

As you asked for it, I did it. =)

The behiavour now is the following:
- KSnapshot checks if there are any numbers in the filename.
- If there is any number, it checks for an xx-xx-20xx sequence.
   - If this sequence is found, it assumes the user is saving using the 
dd-mm-yyyy sequence, and increments the day.
   - If it's not, it just increments the last number, as it has been corrected 
in the previous patch.

I choosed to support dd-mm-yyyy instead of mm-dd-yyyy as for what I saw it's a 
sequence way more used in the world (at least outside the USA).

Please revise the patch as I'm not a regexp wizard, and please double check as 
I couldn't test the modifications because my ksnapshot (for an unknown 
reason) crashes when trying to open the filedialog to save the
screenshot... =\
For now I implemented just the above scenario, please tell me if you have 
others in mind.
Tell me if it's ok to commit, and I'll do that immediately!

Bye,
-Riccardo
-- 
GPG key:
3D0F6376
When encrypting, please encrypt also for this subkey:
9EBD7FE1
-----
Pace Peace Paix Paz Frieden Pax Pokój Friður Fred Béke 和平
Hasiti Lapé Hetep Malu Mир Wolakota Santiphap Irini Peoch
Shanti Vrede Baris Rój Mír Taika Rongo Sulh Mir Py'guapy 평화
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ksnapshot-insanity-check.diff
Type: text/x-diff
Size: 3411 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071003/bd732c16/attachment.diff>


More information about the kde-core-devel mailing list