D4847: KAuth integration in document saving

Martin Kostolný noreply at phabricator.kde.org
Fri Mar 3 22:30:42 UTC 2017


martinkostolny added a comment.


  I've learnt a few things about autotests (`KTextEditor::EditorPrivate::unitTestMode()` was really helpful, thanks!). I managed to create a test case, which allowed the code to go through KAuth action. But I was unsuccessful to finish it to my satisfaction - I couldn't come up with a solution where in case of unit testing KAuth dialog is not shown and just allows the execution. `action.exectute(ExecutionMode::AuthorizeOnlyMode)` will not help here since it does not really execute the action. I also tried to create "autotestsave" action alongside existing "save" action and set it to be always allowed. Then triggered it only from unit test. This worked well but I don't find it safe having such action available in non-testing runtime.
  
  If somebody with better KAuth knowledge would know how to allow running otherwise secured KAuth action in unit-test runtime, that would be really helpful :).

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D4847

To: martinkostolny, dhaumann, #ktexteditor
Cc: ltoscano, dhaumann, graesslin, davidedmundson, palant, kwrite-devel, #frameworks, head7, cullmann, kfunk, sars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170303/a5ab6fe3/attachment.html>


More information about the Kde-frameworks-devel mailing list