[tracking] Reduce compiler warnings

- Newly added enum value NoTracking needs explicit handling
  in some switch()es, although it will never be passed in.
main
Adriaan de Groot 5 years ago
parent fd2853b2cf
commit 8ed8b5dfa3

@ -70,6 +70,9 @@ TrackingPage::enableTrackingOption( TrackingType t, bool enabled )
switch ( t ) switch ( t )
{ {
case TrackingType::NoTracking:
// Nothing to do, this **has** no widget
return;
case TrackingType::InstallTracking: case TrackingType::InstallTracking:
group = ui->installGroup; group = ui->installGroup;
break; break;
@ -108,6 +111,8 @@ TrackingPage::getTrackingOption( TrackingType t )
#define ch( x ) ui->x->isChecked() #define ch( x ) ui->x->isChecked()
switch ( t ) switch ( t )
{ {
case TrackingType::NoTracking:
return false;
case TrackingType::InstallTracking: case TrackingType::InstallTracking:
enabled = ch( installRadio ) || ch( machineRadio ) || ch( userRadio ); enabled = ch( installRadio ) || ch( machineRadio ) || ch( userRadio );
break; break;
@ -128,6 +133,9 @@ TrackingPage::setTrackingPolicy( TrackingType t, QString url )
QToolButton* button = nullptr; QToolButton* button = nullptr;
switch ( t ) switch ( t )
{ {
case TrackingType::NoTracking:
cWarning() << "Cannot configure NoTracking widget";
return;
case TrackingType::InstallTracking: case TrackingType::InstallTracking:
button = ui->installPolicyButton; button = ui->installPolicyButton;
break; break;

Loading…
Cancel
Save