SUMMARY The original filename, not the new one, is retained inside documentinfo.xml after "Save As" STEPS TO REPRODUCE 1. Create a file dog.kra 2. Save to a different name cat.kra using "Save As..." 3. Make some changes to the drawing 4. Try to close Krita OBSERVED RESULT A dialogue appears asking "The document 'dog' has been modified. Do you want to save it?" although no 'dog' file is currently open. EXPECTED RESULT The dialogue should ask "The document 'cat' has been modified. Do you want to save it?" SOFTWARE/OS VERSIONS Windows: 10 ADDITIONAL INFORMATION The file documentinfo.xml still contains <title>Dog</title> instead of Cat. I assume this is a bug and not an intended behaviour as it would be very confusing. One may ask "No" to the save request, given that it requests to save a different file, not the opened one.
It is intended behaviour, it's because we cannot tell reliably whether or not the title has changed.
Thanks for the prompt reply. If the title inside documentinfo.xml really needs to remain unchanged (I am not sure I understand why), then the proper fix of this bug would be *not* to read the file name from documentinfo.xml, but from the file system, when requesting the user if they want to save the changes to their file. For sure, if I am editing the file "cat.kra", it does not make sense to be asked if I want to save changes to "dog.kra", just because at some point in the past I created a file with that name. This can lead to data loss.
It's a longstanding issue -- I think there's another report, by deevad about it. It comes from Krita's heritage as part of KOffice, where the title of a document and the filename of the document can be different. But when asking whether a document should be saved, we should use the filename.
Thanks for the explanation. It makes sense. And thank you for your work on Krita. It's such a great program!
Git commit 98ed8547abb7af01d926cb8d27b104c03dd6a3c3 by Agata Cacko. Committed on 01/08/2020 at 20:06. Pushed by tymond into branch 'master'. Don't use document title when warning about unsaved changes Before this commit, Krita would use document title (which is usually the filename that was first used for that document without the extension). That would cause a confusion when "Save As" feature is used since Krita would stll hold the old name as the document title. This commit changes it to always use the filename instead (in the unsaved changes warning dialog). M +1 -5 libs/ui/KisView.cpp https://invent.kde.org/graphics/krita/commit/98ed8547abb7af01d926cb8d27b104c03dd6a3c3
Git commit 1024e8c32750fd4043b21fa8222a071e4ee56c50 by Agata Cacko. Committed on 01/09/2020 at 19:35. Pushed by tymond into branch 'krita/4.3'. Don't use document title when warning about unsaved changes Before this commit, Krita would use document title (which is usually the filename that was first used for that document without the extension). That would cause a confusion when "Save As" feature is used since Krita would stll hold the old name as the document title. This commit changes it to always use the filename instead (in the unsaved changes warning dialog). M +1 -5 libs/ui/KisView.cpp https://invent.kde.org/graphics/krita/commit/1024e8c32750fd4043b21fa8222a071e4ee56c50