Skip to content

Conversation

@sockeye2204
Copy link

#3496

Component modified: Qt

To fix the above issue, a flag m_skipResetLevels is added to Window that is false by default. When set to true (which is done in GBAApp::newWindow), the logging levels are not refreshed in Window::reloadConfig.

@ahigerd
Copy link
Contributor

ahigerd commented Aug 5, 2025

Thanks for the contribution, but adding a flag like this feels like a band-aid fix. If we can't figure out how to get reasonable behavior using the state we already have access to, then there's something deeper wrong with the design.

I have two possible ideas:

  1. Only call m_log.setLevels if the LogView isn't currently visible. This feels reasonable because the only time this is actually a problem is when it changes while you're actively using it.
  2. Create LogView::loadConfig(ConfigController*) with logic that will only replace the current settings with the default settings if you haven't changed anything (which means you have to track if the user has changed anything), and then call that instead of m_log.setLevels. This feels reasonable because it means that changing the default levels in the settings will reflect in the LogView, but only if it's already displaying the previous default settings.

I suppose the two options aren't necessarily mutually exclusive; it wouldn't be unreasonable to do both.

Might be worth popping into #development in Discord to discuss the plan.

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

Successfully merging this pull request may close these issues.

2 participants