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

Loading…
Cancel
Save