mdawson added a comment.

  One suggestion for this change:
  Instead of exporting a method that takes no parameters and always loads from 
configuration file, why not make a new method with the implementation that 
takes in a given KConfigGroup.  That way unit tests can pass in a KConfigGroup 
setup appropriately without having to create a normal configuration file in the 
user's home folder (ie use a temporary file).  They can also configure the 
KConfig to not cascade/use the global configuration so they are isolated from 
the environment.
  
  initUrlActionRestrictions can then remain the same, and pass in the 
KConfigGroup that would have been used previously.
  
  It would look something like:
  
    KCONFIGCORE_EXPORT void loadUrlActionRestrictions(KConfigGroup cg)
    {
        // Code as before, without creating the KConfigGroup
    }
    void initUrlActionRestrictions()
    {
        KConfigGroup cg(KSharedConfig::openConfig(), "KDE URL Restrictions");
        loadUrlActionRestrictions(cg);
    }

REPOSITORY
  R237 KConfig

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

To: dfaure, aacid, apol, mdawson
Cc: kossebau, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns

Reply via email to