D13813: Make this test work again with new uds implementation

David Faure noreply at phabricator.kde.org
Wed Jul 4 20:47:42 BST 2018


dfaure added a comment.


  Albert, you are of course fully right.
  
  My reasoning was "in practice, [outside of strangely written tests such as the one here], there is zero reason to replace entries in a UDSEntry. All kioslaves either create a new UDSEntry for every file, or do reuse it after calling clear(). And people use if() statements rather than overwriting what they just wrote for the same file, which would be rather inefficient.". And indeed I just checked a lot of kioslaves and they do that.
  
  But ForwardingSlaveBase::prepareUDSEntry in KIO itself, uses insert() to replace UDS_URL, and in fact all of ForwardingSlaveBase should use replace(), as well as users of ForwardingSlaveBase like kio_desktop.
  That is troublesome indeed.
  
  The naming is the problem. Naming aside, the old method should still insert-or-replace and some new method should insert-only, but how to call that in a nice way other than insert, especially when 90% of the code out there should ONLY use that? Hmm, fastInsert?
  
  Then if we have fastInsert() and replace(), we can have a deprecated insert() that calls replace().

REPOSITORY
  R318 Dolphin

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

To: jtamate, #dolphin, #frameworks, elvisangelaccio
Cc: dfaure, aacid, ngraham, bruns, elvisangelaccio, kfm-devel, spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180704/141abcfd/attachment.html>


More information about the Kde-frameworks-devel mailing list