Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing organization name on qapp breaks tests with QSettings #402

Open
TilmanK opened this issue Dec 31, 2021 · 3 comments
Open

Missing organization name on qapp breaks tests with QSettings #402

TilmanK opened this issue Dec 31, 2021 · 3 comments

Comments

@TilmanK
Copy link
Contributor

TilmanK commented Dec 31, 2021

I've stumbled across an issue this morning with running tests that use QSettings.

The qapp fixture does have a default value and a config setting for the application name. Nevertheless, it has none for the organization name. Both of them are required for QSettings to work (see https://doc.qt.io/qt-5/qsettings.html#basic-usage).

I'm still not sure, what went wrong since the qapp fixture is requested in my tests AFTER I wrote values to QSettings in earlier fixtures, but when I add the organization name in the qapp fixture, my tests work. I need to figure this out. Anyway: Is there are reason, that a name is set for the application, but none for the organization?

@nicoddemus
Copy link
Member

Hi @TilmanK,

I'm still not sure, what went wrong since the qapp fixture is requested in my tests AFTER I wrote values to QSettings in earlier fixtures, but when I add the organization name in the qapp fixture, my tests work.

Not sure either, I personally never used QSettings so I couldn't say.

Anyway: Is there are reason, that a name is set for the application, but none for the organization?

Not that I'm aware of.

@TilmanK
Copy link
Contributor Author

TilmanK commented Jan 4, 2022

Hi @TilmanK,

I'm still not sure, what went wrong since the qapp fixture is requested in my tests AFTER I wrote values to QSettings in earlier fixtures, but when I add the organization name in the qapp fixture, my tests work.

Not sure either, I personally never used QSettings so I couldn't say.

I am now. I've set the application name AFTER I ran some fixtures that already accessed QSettings.

Anyway: Is there are reason, that a name is set for the application, but none for the organization?

Not that I'm aware of.

Ok, I'd prepare a PR if you or anyone else doesn't have any obligation.

@The-Compiler
Copy link
Member

Looks like fc1faad doesn't have much context - I think the only reason I didn't do so is that I wasn't aware of anything which requires the organization name to be set. So please go ahead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants