Before this patch: if one opens a write protected document, makes changes and then wants to save, error message occurs about insufficient privileges or disk space.
With this patch kate-part will try to save the document contents with elevated privileges in case the regular save failed. So that KAuth graphical prompt is presented to user. I believe this was suggested by many KDE users as a wanted feature. Please let me know if this isn't the right approach.
I'm in fact quite new to KTextEditor as well as KAuth so feel free to criticize the code. I'll try to fix everything you point at :).
What I basically did:
- created TextBufferSecure class (for dedicated KAuth helper binary)
- moved most contents of TextBuffer:save() method to this new class' saveInternal() method
- TextBuffer:save() method now first tries to save with TextBufferSecure::saveInternal() helper method
- if that fails it will call it again through KAuth action