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

use enum class for waveform overview type #13370

Merged
merged 2 commits into from
Jun 29, 2024

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Jun 14, 2024

Follow-up for #13273

@@ -80,8 +81,8 @@ WOverview::WOverview(
QStringLiteral("[Waveform]"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't understand those ControlFlag::NoAssertIfMissing flags above. Some controls are read when painting and there is no null check. Even if default controls return 0 there will a division by 0 at one place.
Should we remove those flags?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot imagine a valid reason that this is missing. Maybe a leftover from a refactoring?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, so I'll remove those.

src/widget/woverview.h Outdated Show resolved Hide resolved
src/widget/woverview.cpp Outdated Show resolved Hide resolved
src/preferences/dialog/dlgprefwaveform.cpp Outdated Show resolved Hide resolved
@@ -80,8 +81,8 @@ WOverview::WOverview(
QStringLiteral("[Waveform]"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot imagine a valid reason that this is missing. Maybe a leftover from a refactoring?

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, couple more nits

Comment on lines 325 to 330
int type = waveformOverviewComboBox->currentData().toInt();
m_pConfig->setValue(kOverviewTypeCfgKey, type);
m_pTypeControl->forceSet(type);
Copy link
Member

@Swiftb0y Swiftb0y Jun 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int type = waveformOverviewComboBox->currentData().toInt();
m_pConfig->setValue(kOverviewTypeCfgKey, type);
m_pTypeControl->forceSet(type);
QVariant comboboxData = waveformOverviewComboBox->currentData();
DEBUG_ASSERT(comboboxData.canConvert<WOverview::Type>());
auto type = comboboxData.value<WOverview::Type>();
m_pConfig->setValue(kOverviewTypeCfgKey, type);
m_pTypeControl->forceSet(static_cast<double>(type));

src/widget/woverview.cpp Show resolved Hide resolved
src/widget/woverview.h Outdated Show resolved Hide resolved
src/widget/woverview.cpp Outdated Show resolved Hide resolved
Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. There is still more cleanup possible in future PRs, but this is already an improvement. Thank you.

@Swiftb0y
Copy link
Member

Swiftb0y commented Jun 18, 2024

@daschuer do you want to take a look?
also @ronso0 do you have nerves to test out https://github.com/mixxxdj/mixxx/pull/13370/files#r1641522940 ?

src/preferences/dialog/dlgprefwaveform.cpp Show resolved Hide resolved
src/preferences/dialog/dlgprefwaveform.cpp Outdated Show resolved Hide resolved
@ronso0
Copy link
Member Author

ronso0 commented Jun 21, 2024

@Swiftb0y Looks good with the latest changes?

@Swiftb0y
Copy link
Member

Swiftb0y commented Jun 21, 2024

yes, the last remaining unresolved comment is #13370 (comment)

@Swiftb0y
Copy link
Member

yes, the last remaining unresolved comment is #13370 (comment)

@ronso0 friendly ping ;)

@ronso0
Copy link
Member Author

ronso0 commented Jun 24, 2024

@Swiftb0y
Copy link
Member

Swiftb0y commented Jun 24, 2024

I guess the link anchor doesn't work properly. I'm referring to this request 😅 :
image

@ronso0
Copy link
Member Author

ronso0 commented Jun 24, 2024

Oh-oh-kay, got it now 😬

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Waiting for CI.

@JoergAtGithub
Copy link
Member

Lets merge this! Thank you!

@JoergAtGithub JoergAtGithub merged commit 4072440 into mixxxdj:2.5 Jun 29, 2024
13 checks passed
@Swiftb0y
Copy link
Member

sorry, forgot, thank you.

@ronso0 ronso0 deleted the overview-type-enum branch June 29, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants