I've saved a message as a draft. What was my surprise that on the next run, Trojitá showed no draft available to load. But the file was there and renaming it helped to be able to make it visible for Trojitá.
Steps to Reproduce:
1. create a new message
2. kill Trojitá gently (try to logout)
3. Trojitá will ask for saving as draft, answer to save
4. accept the suggested default filename
5. on next run, choose to load the saved draft
Trojitá does not show the file with the draft
Trojitá offers to load the saved draft
the actual file name produced in step 4 was ".draft.draft" - after getting rid of the starting dot, the file appeared in the file chooser dialog box
the leading dot means exactly that - "hidden"; good file dialogs have an opton to show hidden files.
-> There's no issue on opening the draft but on implicit name choosing.
... and don't you ever dare to send mails w/o subject line ;-)
Looks like this happens because there's no fallback to use when the subject
of the draft is empty. Patch under review at
Don't worry, Thomas, Trojita will refuse to send such mail. It should be
possible to save it as a draft, though.
(In reply to comment #1)
> the leading dot means exactly that - "hidden"; good file dialogs have an
> opton to show hidden files.
ah, true, I forgot about that as my favourite file manager `mc` doesn't do such stupid things like hiding files from me :-)
> -> There's no issue on opening the draft but on implicit name choosing.
agreed; what I've meant in the first place was that suggesting using just the extension while the same string gets appended automatically is not a good idea anyways
> ... and don't you ever dare to send mails w/o subject line ;-)
the subject of this particular e-mail will depend on the date when I'll send it so it is intentional to have it empty, instead having to rewrite it (and it's easier to spot completely empty subject rather than "FIXME" in the middle of pre-filled subject)
(In reply to comment #2)
> Looks like this happens because there's no fallback to use when the subject
> of the draft is empty. Patch under review at
> https://git.reviewboard.kde.org/r/112309/ .
cool, using the current date looks like a nice idea to me, thanks
Git commit be2982019d996a579b4ad218a8a621a6c5fc123d by Jan Kundrát.
Committed on 27/08/2013 at 11:14.
Pushed by jkt into branch 'master'.
Use current date when saving mail drafts in case subject is empty and sanitize the suggested filename unconditionally
Thanks to Karel Volný for reporting this. Previously, a message with an empty
subject would produced file ".draft" which did not match the GUI's wildcard and
therefore was not visible in the file picker when resuming these drafts.
Thanks to Thomas Lübking for pointing out that some characters are best avoided
here. The code now sanitizes the suggested filename so that it does not contain
"strange" characters, even if they were present in the subject before. Of
course, the subject itself is not modified.
M +10 -1 src/Gui/ComposeWidget.cpp