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

Méven Car noreply at phabricator.kde.org
Tue Oct 15 09:25:56 BST 2019


meven added a comment.


  In D24582#547267 <https://phabricator.kde.org/D24582#547267>, @dfaure wrote:
  
  > 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)
  
  
  Good suggestion, I was thinking about this myself.
  Done
  
  > 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 :)
  
  :)
  
  There are still a couple of more complicated use of config() to deal with

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/c516c891/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list