<table><tr><td style="">martinkostolny updated this revision to Diff 12251.<br />martinkostolny added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D4847" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Thanks a lot for all the thoughts and suggestions! I tried to work them in, but I need help with some of them.</p>

<p>I'm struggling with the atomic rename. I still find Christoph's suggestion (save to temp file and then move it in helper) a good option to stick with. But then we are in many cases unable to atomically move the tempfile because tempfile is usually in tmpfs (RAM) -> different device then target file to save. So we can't even use std::rename for this. Exist & remove & rename are racy so I went for copying to the QSaveFile and then commit. It's not exactly a one-liner, is there a better way? I may very well be on a wrong path here.</p>

<p>About the event loop evil. I agree it should be re-written with QT connects and I don't mind digging in the code. But if I understand the existing code correctly, I'd also have to rewrite at least KateBuffer::saveFile(), DocumentPrivate::saveFile() and DocumentPrivate::documentSaveCopyAs(). I'd like to suggest doing all this in a separate diff/review.</p>

<p>Did I miss something else?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R39 KTextEditor</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D4847?vs=12185&id=12251" rel="noreferrer">https://phabricator.kde.org/D4847?vs=12185&id=12251</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4847" rel="noreferrer">https://phabricator.kde.org/D4847</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/src/katetextbuffertest.cpp<br />
autotests/src/katetextbuffertest.h<br />
src/CMakeLists.txt<br />
src/buffer/katesecuretextbuffer.cpp<br />
src/buffer/katesecuretextbuffer_p.h<br />
src/buffer/katetextbuffer.cpp<br />
src/buffer/katetextbuffer.h<br />
src/buffer/org.kde.ktexteditor.katetextbuffer.actions</div></div></div><br /><div><strong>To: </strong>martinkostolny, dhaumann, KTextEditor<br /><strong>Cc: </strong>dfaure, anthonyfieroni, cullmann, ltoscano, dhaumann, graesslin, davidedmundson, palant, kwrite-devel, Frameworks, head7, kfunk, sars<br /></div>