https://bugs.kde.org/show_bug.cgi?id=397320
Bug ID: 397320 Summary: [Wish] No obvious way to probe the dirty/modified flag of the active document Product: krita Version: nightly build (please specify the git hash!) Platform: MS Windows OS: MS Windows Status: UNCONFIRMED Severity: normal Priority: NOR Component: Scripting Assignee: krita-bugs-n...@kde.org Reporter: nevinevi...@yahoo.com Target Milestone: --- I've been advised to open a wishbug for this. I am in the process of writing simple Python plugin. In short, I have a docker with two buttons for iterating back/forth through files from a given directory, replacing the open document with a new one. This operation implies that if the active document has unsaved changes they will be irreversibly lost. A possibility could be to always save the open file before switching it, but in this way iterating through the existing file list becomes much slower. Unnecessarily modifying files is generally not desirable on reliability and performance grounds. Therefore it would be useful to check out in advance if the active document has any unsaved changes. Oddly enough, I couldn't find any obviously named class member in the Krita Python API documentation for checking the modified/dirty status of a document, like for example something like isDirty(), or isModified(), etc. According to one developer on the official #Krita IRC channel, this doesn't seem to be currently possible. An alternative could be making Document::save() operate in a way that it doesn't actually save the document if no changes are detected, but it could be a potentially breaking change, and being able to save the document despite not having actually modified it could potentially have uses for some people. -- You are receiving this mail because: You are watching all bug changes.