From 8ed8b5dfa3e00274eb98dd4fa40274a1bbbfb82e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 12 May 2020 12:11:11 +0200 Subject: [PATCH] [tracking] Reduce compiler warnings - Newly added enum value NoTracking needs explicit handling in some switch()es, although it will never be passed in. --- src/modules/tracking/TrackingPage.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/tracking/TrackingPage.cpp b/src/modules/tracking/TrackingPage.cpp index 359fac4b4..0ac466673 100644 --- a/src/modules/tracking/TrackingPage.cpp +++ b/src/modules/tracking/TrackingPage.cpp @@ -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;