Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
m0dB committed Sep 22, 2023
1 parent e73e72f commit e9cb2b3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 43 deletions.
55 changes: 20 additions & 35 deletions src/skin/legacy/legacyskinparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1307,28 +1307,20 @@ QWidget* LegacySkinParser::parseSpinny(const QDomElement& node) {
// with platform windows q_createNativeChildrenAndSetParent() while another window is already
// under construction. The ID for the first window is not cleared and leads to a segfault
// during on shutdown. This has been tested with Qt 5.12.8 and 5.15.3
QWidget* pParent = (qApp->platformName() == QLatin1String("xcb") ? nullptr : m_pParent;

Check failure on line 1310 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / clazy

expected ')'

Check failure on line 1310 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 (gcc)

expected ‘)’ before ‘;’ token

Check failure on line 1310 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / coverage

expected ‘)’ before ‘;’ token

Check failure on line 1310 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

syntax error: ';'
WSpinnyBase* pSpinny;
if (qApp->platformName() == QLatin1String("xcb")) {
#ifdef MIXXX_USE_QOPENGL
if (pWaveformWidgetFactory->isOpenGlShaderAvailable() &&
!CmdlineArgs::Instance().getUseLegacySpinny()) {
pSpinny = new WSpinnyGLSL(nullptr, group, m_pConfig, m_pVCManager, pPlayer);
} else
if (pWaveformWidgetFactory->isOpenGlShaderAvailable() &&
!CmdlineArgs::Instance().getUseLegacySpinny()) {
pSpinny = new WSpinnyGLSL(pParent, group, m_pConfig, m_pVCManager, pPlayer);
} else
#endif
{
pSpinny = new WSpinny(nullptr, group, m_pConfig, m_pVCManager, pPlayer);
}
{
pSpinny = new WSpinny(pParent, group, m_pConfig, m_pVCManager, pPlayer);
}
if (!pParent) {
// Widget was created without parent (see comment above), set it now
pSpinny->setParent(m_pParent);
} else {
#ifdef MIXXX_USE_QOPENGL
if (pWaveformWidgetFactory->isOpenGlShaderAvailable() &&
!CmdlineArgs::Instance().getUseLegacySpinny()) {
pSpinny = new WSpinnyGLSL(m_pParent, group, m_pConfig, m_pVCManager, pPlayer);
} else
#endif
{
pSpinny = new WSpinny(m_pParent, group, m_pConfig, m_pVCManager, pPlayer);
}
}
commonWidgetSetup(node, pSpinny);

Expand Down Expand Up @@ -1366,7 +1358,7 @@ QWidget* LegacySkinParser::parseVuMeter(const QDomElement& node) {
return nullptr;
#else
auto* pWaveformWidgetFactory = WaveformWidgetFactory::instance();
if (!CmdlineArgs::Instance().getUseVuMeterGL() ||
if (CmdlineArgs::Instance().getUseLegacyVuMeter() ||
(!pWaveformWidgetFactory->isOpenGlAvailable() &&
!pWaveformWidgetFactory->isOpenGlesAvailable())) {
// Legacy WVuMeter
Expand Down Expand Up @@ -1397,26 +1389,19 @@ QWidget* LegacySkinParser::parseVuMeter(const QDomElement& node) {
// with platform windows q_createNativeChildrenAndSetParent() while another window is already
// under construction. The ID for the first window is not cleared and leads to a segfault
// during on shutdown. This has been tested with Qt 5.12.8 and 5.15.3
QWidget* pParent = (qApp->platformName() == QLatin1String("xcb") ? nullptr : m_pParent;

Check failure on line 1392 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / clazy

expected ')'

Check failure on line 1392 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 (gcc)

expected ‘)’ before ‘;’ token

Check failure on line 1392 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / coverage

expected ‘)’ before ‘;’ token

Check failure on line 1392 in src/skin/legacy/legacyskinparser.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

syntax error: ';'
WVuMeterBase* pVuMeterWidget;
if (qApp->platformName() == QLatin1String("xcb")) {
#ifdef MIXXX_USE_QOPENGL
if (pWaveformWidgetFactory->isOpenGlShaderAvailable()) {
pVuMeterWidget = new WVuMeterGLSL();
} else
if (pWaveformWidgetFactory->isOpenGlShaderAvailable()) {
pVuMeterWidget = new WVuMeterGLSL(pParent);
} else
#endif
{
pVuMeterWidget = new WVuMeter();
}
{
pVuMeterWidget = new WVuMeter(pParent);
}
if (!pParent) {
// Widget was created without parent (see comment above), set it now
pVuMeterWidget->setParent(m_pParent);
} else {
#ifdef MIXXX_USE_QOPENGL
if (pWaveformWidgetFactory->isOpenGlShaderAvailable()) {
pVuMeterWidget = new WVuMeterGLSL(m_pParent);
} else
#endif
{
pVuMeterWidget = new WVuMeter(m_pParent);
}
}
commonWidgetSetup(node, pVuMeterWidget);

Expand Down
10 changes: 5 additions & 5 deletions src/util/cmdlineargs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CmdlineArgs::CmdlineArgs()
m_controllerAbortOnWarning(false),
m_developer(false),
m_safeMode(false),
m_useVuMeterGL(false),
m_useLegacyVuMeter(false),
m_useLegacySpinny(false),
m_debugAssertBreak(false),
m_settingsPathSet(false),
Expand Down Expand Up @@ -173,11 +173,11 @@ bool CmdlineArgs::parse(const QStringList& arguments, CmdlineArgs::ParseMode mod
parser.addOption(timelinePath);
parser.addOption(timelinePathDeprecated);

const QCommandLineOption enableVuMeterGL(QStringLiteral("enable-vumetergl"),
const QCommandLineOption enableLegacyVuMeter(QStringLiteral("enable-legacy-vumeter"),
forUserFeedback ? QCoreApplication::translate("CmdlineArgs",
"Use OpenGL vu meter")
"Use legacy vu meter")
: QString());
parser.addOption(enableVuMeterGL);
parser.addOption(enableLegacyVuMeter);

const QCommandLineOption enableLegacySpinny(QStringLiteral("enable-legacy-spinny"),
forUserFeedback ? QCoreApplication::translate("CmdlineArgs",
Expand Down Expand Up @@ -345,7 +345,7 @@ bool CmdlineArgs::parse(const QStringList& arguments, CmdlineArgs::ParseMode mod
m_timelinePath = parser.value(timelinePathDeprecated);
}

m_useVuMeterGL = parser.isSet(enableVuMeterGL);
m_useLegacyVuMeter = parser.isSet(enableLegacyVuMeter);
m_useLegacySpinny = parser.isSet(enableLegacySpinny);
m_controllerDebug = parser.isSet(controllerDebug) || parser.isSet(controllerDebugDeprecated);
m_controllerAbortOnWarning = parser.isSet(controllerAbortOnWarning);
Expand Down
6 changes: 3 additions & 3 deletions src/util/cmdlineargs.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class CmdlineArgs final {
bool useColors() const {
return m_useColors;
}
bool getUseVuMeterGL() const {
return m_useVuMeterGL;
bool getUseLegacyVuMeter() const {
return m_useLegacyVuMeter;
}
bool getUseLegacySpinny() const {
return m_useLegacySpinny;
Expand Down Expand Up @@ -82,7 +82,7 @@ class CmdlineArgs final {
bool m_controllerAbortOnWarning; // Controller Engine will be stricter
bool m_developer; // Developer Mode
bool m_safeMode;
bool m_useVuMeterGL;
bool m_useLegacyVuMeter;
bool m_useLegacySpinny;
bool m_debugAssertBreak;
bool m_settingsPathSet; // has --settingsPath been set on command line ?
Expand Down

0 comments on commit e9cb2b3

Please sign in to comment.