D19491: generic config interface

Christoph Cullmann noreply at phabricator.kde.org
Tue Mar 5 19:12:39 GMT 2019


cullmann added a comment.


  I think some extra keys are not avoidable to be compatible with the old stuff.
  See e.g.
  
  // BEGIN ConfigInterface stff
  QStringList KTextEditor::DocumentPrivate::configKeys() const
  {
  
    static const QStringList keys = {
        QLatin1String("backup-on-save-local"),
        QLatin1String("backup-on-save-suffix"),
        QLatin1String("backup-on-save-prefix"),
        QLatin1String("replace-tabs"),
        QLatin1String("indent-pasted-text"),
        QLatin1String("tab-width"),
        QLatin1String("indent-width"),
        QLatin1String("on-the-fly-spellcheck"),
    };
    return keys;
  
  }
  
  If we have these as extra keys, we can just auto-generate that stringlist (and have all settings exposed for free).
  The configValue() + setConfigValue() can then just call directly the setValue()... things, too, after looking up the enum from a hash.

REPOSITORY
  R39 KTextEditor

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

To: cullmann, #ktexteditor, dhaumann, loh.tar
Cc: kwrite-devel, kde-frameworks-devel, gennad, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190305/6ee2a47d/attachment-0001.html>


More information about the KWrite-Devel mailing list