From: Soeren Apel Date: Sun, 21 Oct 2018 21:10:43 +0000 (+0200) Subject: More clazy fixes X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7a0d99e6d48870c51d00c25617eb309181dc2a60;p=pulseview.git More clazy fixes --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index dfabc9a0..c79364eb 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -172,8 +172,8 @@ shared_ptr MainWindow::add_view(const QString &title, QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); QAbstractButton *close_btn = - dock->findChildren("qt_dockwidget_closebutton") - .front(); // clazy:exclude=detaching-temporary + dock->findChildren("qt_dockwidget_closebutton") // clazy:exclude=detaching-temporary + .front(); connect(close_btn, SIGNAL(clicked(bool)), this, SLOT(on_view_close_clicked())); @@ -313,8 +313,8 @@ void MainWindow::remove_session(shared_ptr session) // When there are no more tabs, the height of the QTabWidget // drops to zero. We must prevent this to keep the static // widgets visible - for (QWidget *w : static_tab_widget_->findChildren()) - w->setMinimumHeight(h); // clazy:exclude=range-loop + for (QWidget *w : static_tab_widget_->findChildren()) // clazy:exclude=range-loop + w->setMinimumHeight(h); int margin = static_tab_widget_->layout()->contentsMargins().bottom(); static_tab_widget_->setMinimumHeight(h + 2 * margin); diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index 1f9e4c4e..9c7196bf 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -333,7 +333,7 @@ QMenu* DecodeTrace::create_view_context_menu(QWidget *parent, QPoint &click_pos) QMenu* default_menu = Trace::create_view_context_menu(parent, click_pos); if (default_menu) { - for (QAction *action : default_menu->actions()) { + for (QAction *action : default_menu->actions()) { // clazy:exclude=range-loop menu->addAction(action); if (action->parent() == default_menu) action->setParent(menu); @@ -899,7 +899,7 @@ void DecodeTrace::create_decoder_form(int index, const vector channels = decode_signal_->get_channels(); // Add the channels - for (DecodeChannel ch : channels) { + for (const DecodeChannel& ch : channels) { // Ignore channels not part of the decoder we create the form for if (ch.decoder_ != dec) continue; diff --git a/pv/views/trace/logicsignal.cpp b/pv/views/trace/logicsignal.cpp index 5c6aa54b..8c4c982c 100644 --- a/pv/views/trace/logicsignal.cpp +++ b/pv/views/trace/logicsignal.cpp @@ -583,8 +583,8 @@ void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form) // Only allow triggers to be changed when we're stopped if (session_.get_capture_state() != Session::Stopped) - for (QAction* action : trigger_bar_->findChildren()) - action->setEnabled(false); // clazy:exclude=range-loop + for (QAction* action : trigger_bar_->findChildren()) // clazy:exclude=range-loop + action->setEnabled(false); form->addRow(tr("Trigger"), trigger_bar_); } diff --git a/pv/views/trace/trace.cpp b/pv/views/trace/trace.cpp index 0a1fdf30..5c854aed 100644 --- a/pv/views/trace/trace.cpp +++ b/pv/views/trace/trace.cpp @@ -191,7 +191,7 @@ QMenu* Trace::create_view_context_menu(QWidget *parent, QPoint &click_pos) QMenu* default_menu = TraceTreeItem::create_view_context_menu(parent, click_pos); if (default_menu) { - for (QAction *action : default_menu->actions()) { + for (QAction *action : default_menu->actions()) { // clazy:exclude=range-loop menu->addAction(action); if (action->parent() == default_menu) action->setParent(menu);