QSettings bug

Discuss anything related to product development
Post Reply
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

QSettings bug

Post by seasoned_geek »

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 ]
barbara
Posts: 446
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QSettings bug

Post by barbara »

Please tell us the following information. Sometimes a lot of text or sample code gets in the way of seeing the real issue.

1 What version of CopperSpice are you using.
Binaries from the CS forum, clone of github ( approx sha )

2 I was using class X or method X.

3 I expected Y to happen.

4 Instead Z happened.

Thank you for giving us item number one, this is very helpful for the team. We know you built CS from a current sha.

We know you were using the QSettings class.
What were you trying to do?
What did you get?

Barbara
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

Re: QSettings bug

Post by seasoned_geek »

I was trying to chase down this bug.

I generated a hello_settings GUI application. It is the default "Hello World!" GUI application QtCreator generates with a button added to "Store Settings." The only significant piece of the code is here:

[ Edit, code saved off line]

I construct the QSettings object in the constructor. I don't write to it until the button is clicked and the slot is activated. The 'Logikal Solutions' directory gets created under .config when the application starts. There is no bogus 'Logikal Solutions.conf' file created at the same level. After I store my settings Ethyl has all my tags+data and is under the 'Logikal Solutions' directory.

This is the expected behavior.

Creating the same application under CopperSpice has both the 'Logikal Solutions' directory and a bogus 'Logikal Solutions.conf' file created under ./config at application startup.

This is unexpected behavior.
barbara
Posts: 446
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QSettings bug

Post by barbara »

Thanks, we have noted your reported issue and it will be reviewed.
Post Reply