Sonnet status?

David Faure faure+bluesystems at kde.org
Wed Nov 21 22:01:21 UTC 2012


On Wednesday 21 November 2012 21:00:27 Martin Sandsmark wrote:
> On Fri, Nov 09, 2012 at 01:15:49AM +0100, David Faure wrote:
> > From a frameworks point of view, sonnet has had its core moved into
> > staging
> > (as you can see in a frameworks checkout). It needs simple porting from
> > i18n to QCoreApplication::translate("", ...) to have no more kdecore
> > dependency, and then the core framework is done, iirc.
> 
> https://git.reviewboard.kde.org/r/107412/
> 
> > It's just that it currently depends on KConfig for *one* setting, maybe
> > this could be done differently so as not to have this dependency.

Hmm, I'm not sure why I wrote "for one setting", grepping again shows much more.

./settings.cpp:192:    const QStringList ignores = conf.readEntry(ignoreEntry, QStringList());
./settings.cpp:227:    d->defaultClient = conf.readEntry("defaultClient",
./settings.cpp:229:    d->defaultLanguage = conf.readEntry(
./settings.cpp:233:    d->checkUppercase = conf.readEntry(
./settings.cpp:236:    d->skipRunTogether = conf.readEntry(
./settings.cpp:239:    d->backgroundCheckerEnabled = conf.readEntry(
./settings.cpp:242:    d->checkerEnabledByDefault = conf.readEntry(
./settings.cpp:245:    d->disablePercentage = conf.readEntry("Sonnet_AsYouTypeDisablePercentage", 42);
./settings.cpp:246:    d->disableWordCount = conf.readEntry("Sonnet_AsYouTypeDisableWordCount", 100);

(The last two look like overkill, they are not written out by save(), I think it was
just someone too afraid to commit hardcoded numbers...)

> Could I just use QSettings there? Or is there a better solution?

I don't really like porting our code from KConfig to QSettings in general, given that the Qt
developers are already turning their back to QSettings, and given that QSettings doesn't
support kiosk nor $XDG_CONFIG_DIRS. However, in this case it seems to be a simple
set of user settings, not much point in system-wide settings for such things, so a
plain text file would do, so QSettings will do too.
So, OK for this one, but I really don't want to see all of KF5 ported to QSettings.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by BlueSystems and KDAB to work on KDE Frameworks



More information about the Kde-frameworks-devel mailing list