[Interest] QSettings keys

Marian Beermann public at enkore.de
Fri Aug 24 19:04:52 CEST 2018


Hi Bertwim,

QSettings isn't really meant as a general-purpose .ini parser. It *can*
sometimes be used for that purpose, but that's not what it's for. This
particular behaviour is perhaps comparable to HTML/XML generators, which
sometimes will escape things that didn't strictly need escaping... the
end result is the same.

-Marian

On 8/24/18 7:00 PM, Bertwim wrote:
> 
> 
> On 08/22/2018 10:35 PM, Thiago Macieira wrote:
>> On Wednesday, 22 August 2018 11:06:16 PDT Bertwim wrote:
>>> This is what I observe:
>>>
>>> For instance, if I enter the following, manually, in the ini file:
>> [ignored]
>>
>> What you type manually is not relevant.
> It *is* relevant. Because that is what is I type and that is what I see
> on the screen.
> If I see a ':' changing into a %3A then this confuses me. As the ':' is
> just a printable ascii character, I don't see any reason why it should
> be treated differently from the other characters, like a-z, 1-9 etc. It
> is just a normal printable symbol and in my view it just shouldn't
> change the representation.
> I don't understand why this is necessary and I would say this is a bug,
> even when on reading back, that is internally in the program, the
> correct interpretation is found.
>>
>>> and then look at the ini-file after it has been rewritten to disk, this
>>> has become:
>>>
>>> [foo%3Abar]
>>> line%201=some text
>>> line%3Atail=indented + key has character ':'
>>>
>>> Now, looking at the keys, removing the leading and trailing white spaces
>>> makes sense to me, as does removing the white spaces around the '='.
>>> However, writing the space between 'line' and '1' with the %20 encoding,
>>> and likewise the %3A for the colon looks weird
>>> and unnecessary, as they are normal ascii characters.
>> I don't know why the ':' was encoded. It might be a side-effect of the
>> function being used, or just because in other contexts it is a reserved
>> character.
>>
>> My question remains: if you load this file, do ou get "line:tail" as
>> the key?
>> If so, there is no bug.
>>
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list