Commit 830adb2a authored by Dario Lombardo's avatar Dario Lombardo

Qt: rework routine in module_preferences_scroll_area.

This removes a check that confuses clang and generates a false poritive.

Change-Id: Ib28b88b40e16ad300ba6d3df8334bd752a4fa7f1
Reviewed-on: https://code.wireshark.org/review/26171
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: 's avatarRoland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: 's avatarDario Lombardo <lomato@gmail.com>
parent 3a54fd1d
......@@ -87,14 +87,16 @@ pref_show(pref_t *pref, gpointer layout_ptr)
case PREF_ENUM:
{
const enum_val_t *ev;
if (prefs_get_enumvals(pref) == NULL) return 0;
ev = prefs_get_enumvals(pref);
if (!ev || !ev->description)
return 0;
if (prefs_get_enum_radiobuttons(pref)) {
QLabel *label = new QLabel(prefs_get_title(pref));
label->setToolTip(tooltip);
vb->addWidget(label);
QButtonGroup *enum_bg = new QButtonGroup(vb);
for (ev = prefs_get_enumvals(pref); ev && ev->description; ev++) {
while (ev->description) {
QRadioButton *enum_rb = new QRadioButton(title_to_shortcut(ev->description));
enum_rb->setToolTip(tooltip);
QStyleOption style_opt;
......@@ -107,6 +109,7 @@ pref_show(pref_t *pref, gpointer layout_ptr)
.arg(enum_rb->style()->subElementRect(QStyle::SE_CheckBoxContents, &style_opt).left()));
enum_bg->addButton(enum_rb, ev->value);
vb->addWidget(enum_rb);
ev++;
}
} else {
QHBoxLayout *hb = new QHBoxLayout();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment