From 98bac9636ee62a8863760a8b8381019a6a546173 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Tue, 8 Oct 2013 22:36:57 +0200 Subject: [PATCH] Fix off-by-one in PD menu list construction. A minor logic bug caused the first PD in the list of PDs to be ignored and not to be added to the decoder list the user has access to. I.e., one of the available decoders couldn't be used at all in PulseView. This fixes bug #164. --- pv/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index dc5f981..0e971ce 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -305,14 +305,14 @@ void MainWindow::setup_add_decoders(QMenu *parent) { GSList *l = g_slist_sort(g_slist_copy( (GSList*)srd_decoder_list()), decoder_name_cmp); - while ((l = l->next)) { + do { QAction *const action = parent->addAction(QString( ((srd_decoder*)l->data)->name)); action->setData(qVariantFromValue(l->data)); _decoders_add_mapper.setMapping(action, action); connect(action, SIGNAL(triggered()), &_decoders_add_mapper, SLOT(map())); - } + } while ((l = l->next)); g_slist_free(l); } -- 2.30.2