Skip to content

Commit

Permalink
group case by return value
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 authored Aug 28, 2023
1 parent 0023259 commit 5a47ed6
Showing 1 changed file with 25 additions and 41 deletions.
66 changes: 25 additions & 41 deletions src/preferences/upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,53 +33,37 @@ 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:
case WWT::QtWaveform:
case WWT::HSVWaveform:
case WWT::RGBWaveform:
case WWT::GLRGBWaveform:
case WWT::GLSLRGBWaveform:
case WWT::QtRGBWaveform:
case WWT::GLSLRGBStackedWaveform:
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:
case WWT::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;
}
return WaveformWidgetType::AllShaderRGBWaveform;
}
Expand Down

0 comments on commit 5a47ed6

Please sign in to comment.