<table><tr><td style="">mdawson added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29347">View Revision</a></tr></table><br /><div><div><p>One suggestion for this change:<br />
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.</p>

<p>initUrlActionRestrictions can then remain the same, and pass in the KConfigGroup that would have been used previously.</p>

<p>It would look something like:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">KCONFIGCORE_EXPORT void loadUrlActionRestrictions(KConfigGroup cg)
{
    // Code as before, without creating the KConfigGroup
}
void initUrlActionRestrictions()
{
    KConfigGroup cg(KSharedConfig::openConfig(), "KDE URL Restrictions");
    loadUrlActionRestrictions(cg);
}</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R237 KConfig</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29347">https://phabricator.kde.org/D29347</a></div></div><br /><div><strong>To: </strong>dfaure, aacid, apol, mdawson<br /><strong>Cc: </strong>kossebau, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>