QSettings bug
Posted: Thu Jan 21 2021 8:18 pm
All,
I cannot find the message thread. I believe it was in Diamond forum about someone pointing out a bogus .conf file. I think Barbara responded that was an OS thing. It's not. It's a bug in QSettings. I haven't dug into the code but I have stumbled into a good example porting Gede.
m_globalSettings = new QSettings( QSettings::UserScope, "Logikal Solutions", GLOBAL_CONFIG_FILENAME, this );
This creates a 'Logikal Solutions' directory and a 'Logikal Solutions.conf' empty file. This is not being done by the OS as one can plainly see by the contents of my config directory.
We've communicated in the past because I like that minimal word processor for roughing out ideas. He too uses QSettings much like I show the call above.
A GottCode directory with a FocusWriter.conf file in it. This is what I expected to see.
My gut tells me there is some kind of "failsafe path" in the code where it assumes we have an organization without an application name, mainly because it is parsing things left to right. After finding the application name it doesn't go back to clean up the now "failsafe oopsie." That is the only place in the code where "Logikal Solutions" exists.
I delete it before each test run and it shows up after each test.
This is obviously in the constructor and I think it is some kind of safety code to avoid having an empty file name. The logic path just isn't sound. I just pulled from the tip of tip and built CopperSpice from scratch yesterday.
[ Edited for clarity ]
I cannot find the message thread. I believe it was in Diamond forum about someone pointing out a bogus .conf file. I think Barbara responded that was an OS thing. It's not. It's a bug in QSettings. I haven't dug into the code but I have stumbled into a good example porting Gede.
m_globalSettings = new QSettings( QSettings::UserScope, "Logikal Solutions", GLOBAL_CONFIG_FILENAME, this );
This creates a 'Logikal Solutions' directory and a 'Logikal Solutions.conf' empty file. This is not being done by the OS as one can plainly see by the contents of my config directory.
We've communicated in the past because I like that minimal word processor for roughing out ideas. He too uses QSettings much like I show the call above.
A GottCode directory with a FocusWriter.conf file in it. This is what I expected to see.
My gut tells me there is some kind of "failsafe path" in the code where it assumes we have an organization without an application name, mainly because it is parsing things left to right. After finding the application name it doesn't go back to clean up the now "failsafe oopsie." That is the only place in the code where "Logikal Solutions" exists.
I delete it before each test run and it shows up after each test.
This is obviously in the constructor and I think it is some kind of safety code to avoid having an empty file name. The logic path just isn't sound. I just pulled from the tip of tip and built CopperSpice from scratch yesterday.
[ Edited for clarity ]