From a27668428baa47b7b90d1f3d91ccf8101a6fbcdf Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 2 Jul 2019 21:07:43 +0100 Subject: [PATCH] Cleaner warning sidestep --- widgets/colorhighlighting.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/widgets/colorhighlighting.cpp b/widgets/colorhighlighting.cpp index e9e25d11c..6ad0bd4da 100644 --- a/widgets/colorhighlighting.cpp +++ b/widgets/colorhighlighting.cpp @@ -42,8 +42,8 @@ void ColorHighlighting::set_items (DecodeHighlightingModel const& highlighting_m int index {0}; for (auto const& item : highlighting_model.items ()) { - QLabel * example {nullptr}; - QLabel * label {nullptr}; + QLabel * example; + QLabel * label; switch (index++) { case 0: @@ -110,8 +110,9 @@ void ColorHighlighting::set_items (DecodeHighlightingModel const& highlighting_m example = ui->example16_label; label = ui->p16_label; break; + default: + continue; } - if (!example || !label) continue; auto palette = example->parentWidget ()->palette (); if (Qt::NoBrush != item.background_.style ()) {