-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Preferences waveforms: recall correct waveform type when selecting an overview type #12231
Conversation
a9358dc
to
a2cf623
Compare
a2cf623
to
bcd1b22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some style notes, but the basic code looks good! thanks for this fix
@@ -537,6 +538,8 @@ bool WaveformWidgetFactory::setWidgetType( | |||
WaveformWidgetType::Type type, | |||
WaveformWidgetType::Type* pCurrentType) { | |||
if (type == *pCurrentType) { | |||
qDebug() << "WaveformWidgetFactory::setWidgetType - type" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not seem like a debug statement we need -- ok to delete it?
int empty = findHandleIndexFromType(WaveformWidgetType::EmptyWaveform); | ||
int desired = findHandleIndexFromType(m_configType); | ||
if (desired == -1) { | ||
qDebug() << "WaveformWidgetFactory::setWidgetTypeFromConfig" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(whereas, this one seems useful)
desired = empty; | ||
} | ||
// qDebug() << "found valid waveform type" << getDisplayNameFromType(m_configType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove the commented-out debug lines? Unless you think they will be super useful in the future they tend to add clutter
for (int i = 0; i < m_waveformWidgetHandles.size(); i++) { | ||
WaveformWidgetAbstractHandle& handle = m_waveformWidgetHandles[i]; | ||
int index = 0; | ||
for (const auto& handle : std::as_const(m_waveformWidgetHandles)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're going to maintain an index like this, you might as well keep the original style of loop (and use .get() to get a const ref instead of mutable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I reverted this.
Though this is a QVector, not sure what you mean by get()
.
Thanks for your review. Feel free to edit this branch, I'm ill and probably won't fix it this year. |
<3 hope you feel better and happy new year |
Thanks, doing better already. |
I addressed your comments with !fixups. Please check and give 👍 if it's okay, then I'll squash and force-push. |
Draft again to avoid merging the separate fixups. |
Let me know how you want to treat this PR, not quite clear how you wanted to treat the fixups? |
I want to squash them but give @daschuer a chance to review them separately. |
Can you mark this as ready for review, and then add a note that it needs to be squashed before merge? that way it gets on his radar |
@daschuer I pushed to fixups and left them separate for now so you can easily review those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the issue is fixed and the Code looks good. Thank you.
Please give a hint once I can press merge.
This is necessary to recall the stored type when repopulating the widgets after (re)loading a skin, for example when selecting an overview type in the preferences.
0fdabc0
to
afed5f7
Compare
Ready! |
Thank you. |
Closes #12226
The waveform type was written to config but the local variable
m_configType
holding this type for updating the widgets after skin (re)load was not updated accordingly.Note that I consider this just a quick fix.
IMO we should not store the value in
m_configType
but read it from the config insetWidgetTypeFromConfig
(move the logic fromsetConfig()
. AFAICT this is required only in the constructor and inslotSkinLoaded()
.A commit that should do th trick is 80bb79c, though I'm not motivated to verify this actually works under all conditions / on all OS. If someone wants to check that and do the testing, please go ahead.
Maybe also call
DlgPrefWaveforms::slotUpdate
whenMixxxMainWindow::rebootMixxxView
succeeded.