QSettings and sections containing spaces
I am using QSettings to edit .desktop menu entries. I do it like this: dfile is the path of the QString file is the absolute file
QSettings set(dfile, QSettings::IniFormat);
qDebug() << "Editing " << set.fileName();
set.beginGroup("Desktop Entry");
// set whatever I need
set.endGroup();
But when the .desktop file is saved I get
[Desktop%20Entry]
Encoding=UTF-8
Version=1.0
# and etc.
instead
[Desktop Entry]
Encoding=UTF-8
Version=1.0
# and etc.
What am I doing wrong? Thanks to
+3
source to share
1 answer
You are not doing anything wrong. The space is just encoded as% 20 using HTML URL encoding . You can read the settings back, right?
+1
user362638
source
to share