Skip to content

Commit

Permalink
group case by return value and use WWT alias
Browse files Browse the repository at this point in the history
Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
  • Loading branch information
m0dB and Swiftb0y committed Sep 1, 2023
1 parent 0023259 commit f569ff0
Showing 1 changed file with 28 additions and 44 deletions.
72 changes: 28 additions & 44 deletions src/preferences/upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,39 @@ Upgrade::~Upgrade() {
namespace {
// mapping to proactively move users to the new all-shader waveform types
WaveformWidgetType::Type upgradeToAllShaders(WaveformWidgetType::Type waveformType) {
// TODO: convert `WaveformWidgetType::Type` to an enum class then shorten more `using enum ...`
using WWT = WaveformWidgetType;
switch (waveformType) {
case WaveformWidgetType::EmptyWaveform:
case WWT::EmptyWaveform:
case WWT::SoftwareSimpleWaveform:
case WWT::SoftwareWaveform:
case WWT::GLVSyncTest:
case WWT::QtVSyncTest:
case WWT::AllShaderRGBWaveform:
case WWT::AllShaderLRRGBWaveform:
case WWT::AllShaderFilteredWaveform:
case WWT::AllShaderSimpleWaveform:
case WWT::AllShaderHSVWaveform:
case WWT::Count_WaveformwidgetType:
return waveformType;
case WaveformWidgetType::SoftwareSimpleWaveform:
return waveformType;
case WaveformWidgetType::SoftwareWaveform:
return waveformType;
case WaveformWidgetType::QtSimpleWaveform:
return WaveformWidgetType::AllShaderSimpleWaveform;
case WaveformWidgetType::QtWaveform:
return WaveformWidgetType::AllShaderRGBWaveform;
case WaveformWidgetType::GLSimpleWaveform:
case WWT::QtSimpleWaveform:
case WWT::GLSimpleWaveform:
return WaveformWidgetType::AllShaderSimpleWaveform;
case WaveformWidgetType::GLFilteredWaveform:
case WWT::GLFilteredWaveform:
case WWT::GLSLFilteredWaveform:
return WaveformWidgetType::AllShaderFilteredWaveform;
case WaveformWidgetType::GLSLFilteredWaveform:
return WaveformWidgetType::AllShaderFilteredWaveform;
case WaveformWidgetType::HSVWaveform:
return WaveformWidgetType::AllShaderHSVWaveform;
case WaveformWidgetType::GLVSyncTest:
return waveformType;
case WaveformWidgetType::RGBWaveform:
return WaveformWidgetType::AllShaderRGBWaveform;
case WaveformWidgetType::GLRGBWaveform:
return WaveformWidgetType::AllShaderRGBWaveform;
case WaveformWidgetType::GLSLRGBWaveform:
return WaveformWidgetType::AllShaderRGBWaveform;
case WaveformWidgetType::QtVSyncTest:
return waveformType;
case WaveformWidgetType::QtHSVWaveform:
return WaveformWidgetType::AllShaderHSVWaveform;
case WaveformWidgetType::QtRGBWaveform:
return WaveformWidgetType::AllShaderRGBWaveform;
case WaveformWidgetType::GLSLRGBStackedWaveform:
return WaveformWidgetType::AllShaderRGBWaveform;
case WaveformWidgetType::AllShaderRGBWaveform:
return waveformType;
case WaveformWidgetType::AllShaderLRRGBWaveform:
return waveformType;
case WaveformWidgetType::AllShaderFilteredWaveform:
return waveformType;
case WaveformWidgetType::AllShaderSimpleWaveform:
return waveformType;
case WaveformWidgetType::AllShaderHSVWaveform:
return waveformType;
case WaveformWidgetType::Count_WaveformwidgetType:
return waveformType;
case WWT::QtWaveform:
case WWT::RGBWaveform:
case WWT::GLRGBWaveform:
case WWT::GLSLRGBWaveform:
case WWT::QtRGBWaveform:
case WWT::GLSLRGBStackedWaveform:
return WWT::AllShaderRGBWaveform;
case WWT::HSVWaveform:
case WWT::QtHSVWaveform:
return WWT::AllShaderHSVWaveform;
}
return WaveformWidgetType::AllShaderRGBWaveform;
return WWT::AllShaderRGBWaveform;
}
} // namespace

Expand Down

0 comments on commit f569ff0

Please sign in to comment.