D24582: Replace usage of SlaveBase::config() by SlaveBase::mapConfig()

David Faure noreply at phabricator.kde.org
Tue Oct 15 07:29:13 BST 2019


dfaure added a comment.


  Looks fine, but a bit verbose. Maybe we could have configValue() overloads (in SlaveBase) for bool, int and QString, to cover the most common use cases?
  
    - mapConfig().value(QStringLiteral("MaxCacheAge"), DEFAULT_MAX_CACHE_AGE).toInt();
    + configValue(QStringLiteral("MaxCacheAge"), DEFAULT_MAX_CACHE_AGE);
  
  Given how many calls there are, I would think it's worth it.
  
  (for other more unusual cases like QStringList the current solution remains)
  
  Also, if one day in the far future we want to replace QMap with std::map or other, all these calls to value() will be a PITA, while SlaveBase::configValue() would be trivial to port :)

REPOSITORY
  R241 KIO

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

To: meven, #frameworks, dfaure
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191015/cfbdcb83/attachment.html>


More information about the Kde-frameworks-devel mailing list