From: Soeren Apel Date: Sat, 27 Jun 2015 11:33:59 +0000 (+0200) Subject: Signal: Fix index variable declaration X-Git-Tag: pulseview-0.3.0~184 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0771cc94a8487f1510d0a6751538a39652e9897f;p=pulseview.git Signal: Fix index variable declaration --- diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index 018b68f2..9f97d5bc 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -101,8 +101,6 @@ shared_ptr Signal::channel() const void Signal::populate_popup_form(QWidget *parent, QFormLayout *form) { - int index; - name_widget_ = new QComboBox(parent); name_widget_->setEditable(true); name_widget_->setCompleter(0); @@ -110,7 +108,7 @@ void Signal::populate_popup_form(QWidget *parent, QFormLayout *form) for(unsigned int i = 0; i < countof(ChannelNames); i++) name_widget_->insertItem(i, ChannelNames[i]); - index = name_widget_->findText(name_, Qt::MatchExactly); + const int index = name_widget_->findText(name_, Qt::MatchExactly); if (index == -1) { name_widget_->insertItem(0, name_);