Bug 413473 - Kile complains about failure and deletes file if one tries to overwrite an existing template.
Summary: Kile complains about failure and deletes file if one tries to overwrite an ex...
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: user interface (show other bugs)
Version: 2.9.93
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-26 13:23 UTC by Kishore Gopalakrishnan
Modified: 2019-12-01 14:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of the error message. (7.32 KB, image/png)
2019-10-26 13:23 UTC, Kishore Gopalakrishnan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2019-10-26 13:23:02 UTC
Created attachment 123492 [details]
Screenshot of the error message.

SUMMARY
If we try to overwrite (through File > Create template from document) a previously created user template, Kile claims that creation failed and then deletes the file the user used to create the template. However, the template modification actually succeeds.

STEPS TO REPRODUCE
1. Create a template.
2. Create a new .tex document using this template and make some changes in it.
3. File > Create template from document.
4. Choose to overwrite the existing template.

OBSERVED RESULT
Kile throws up an error saying 'failed to create template' (see attached screenshot). Once we dismiss the error, it then complains that the file has been deleted by another program. However, if we check the modified template by creating a new document, we find that the changes we made have actually been applied to the template, contrary to what the error message claimed.

EXPECTED RESULT
Kile should not falsely claim template creation failed. It should also not delete the document the user used to create the template.

SOFTWARE/OS VERSIONS
Linus distro: Arch Linux
KDE Plasma Version: 5.17.0
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
If we try to create a new template (using a previously nonexistent template name), it succeeds and does not delete the document used, as expected.
Comment 1 Michel Ludwig 2019-12-01 14:57:04 UTC
Git commit 7a55cf2d93c9daa13f2fa2ec1ae25646507cfc0c by Michel Ludwig.
Committed on 01/12/2019 at 14:56.
Pushed by mludwig into branch 'master'.

Fix overriding of existing templates

Also, don't delete the original file after the template has been
created from it.

M  +3    -4    src/dialogs/managetemplatesdialog.cpp
M  +5    -73   src/templates.cpp
M  +4    -6    src/templates.h

https://commits.kde.org/kile/7a55cf2d93c9daa13f2fa2ec1ae25646507cfc0c