[Development] QSettings native format on Unix

Иван Комиссаров abbapoh at gmail.com
Wed May 2 12:13:37 CEST 2012


Hi all. I was implementing some platform-specific features for my program - "open with list" and "move to trash" functionality for 3 OSes - win, mac, linux.

Under Linux, i had to use desktop-files, which are described in freedesktop.org specification.
I encounter with a problem that i can't read such files using existing qt classes. This is an ini format, but it differs from ini-format used by QSettings
(the main difference is that in this files ';' is treated as a list separator, however QSettings treats ';' as a beggining of a comment).
There are also some slight differences. I had to implement my own parser, based on QSettings code to deal with desktop files. (code is here https://gitorious.org/andromeda/andromeda/blobs/arch/src/libs/io/kdesettings.cpp)

I made small research and it appeared that KDE uses same ini format for their configs. They use KConfig class to deal both with configs and desktop files.

So i thought - why QSettings use "windows-like" ini format as a native on Linux, instead of "kde" ("desktop file") ini format?

Isn't it a good idea to use "kde" ini format as a Native QSettings format under Linux (UNIX, excluding MacOs)?

The argumentation is
a) you can read existing KDE configs (KDE won't need their own parser anymore)
b) you can read xdg files easily (same for not KDE-based programs)
c) current ini format ("windows-like") is rarely used in UNIX

I don't know what's the situation with QSettings class, but, as far as I remember, you, qt-guys, wanted to separate it into QSettings (with custom formats) and QNativeSettings (with platform-specific formats). So everything written above can be applied to QNativeSettings.

Ivan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120502/50d7393d/attachment.html>


More information about the Development mailing list