D29347: KAuthorized: export method to reload restrictions

David Faure noreply at phabricator.kde.org
Fri May 1 20:25:26 BST 2020


dfaure created this revision.
dfaure added reviewers: aacid, apol, mdawson.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
dfaure requested review of this revision.

REVISION SUMMARY
  This is useful for unittests. Example:
  
  KCONFIGCORE_EXPORT void reloadUrlActionRestrictions();
  
  void someTestMethod()
  {
  
    KConfigGroup cg(KSharedConfig::openConfig(), "KDE URL Restrictions");
    cg.writeEntry("rule_count", 1);
    cg.writeEntry("rule_1", QStringList{"open", {}, {}, {}, "file", "", "", "false"});
    cg.sync();
    reloadUrlActionRestrictions();
    
    // Some test for code that uses KUrlAuthorized
    
    cg.deleteEntry("rule_1");
    cg.deleteEntry("rule_count");
    cg.sync();
    reloadUrlActionRestrictions();
  
  }
  
  This is consistent with the fact that other functions used by
  KUrlAuthorized are defined here and exported internally.

TEST PLAN
  Used this in a KIO unittest I'm writing for the future OpenUrlJob

REPOSITORY
  R237 KConfig

BRANCH
  master

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

AFFECTED FILES
  src/core/kauthorized.cpp

To: dfaure, aacid, apol, mdawson
Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200501/b5b0e5ff/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list