More clazy fixes
authorSoeren Apel <soeren@apelpie.net>
Sun, 21 Oct 2018 21:10:43 +0000 (23:10 +0200)
committerSoeren Apel <soeren@apelpie.net>
Sun, 21 Oct 2018 21:10:43 +0000 (23:10 +0200)
pv/mainwindow.cpp
pv/views/trace/decodetrace.cpp
pv/views/trace/logicsignal.cpp
pv/views/trace/trace.cpp

index dfabc9a..c79364e 100644 (file)
@@ -172,8 +172,8 @@ shared_ptr<views::ViewBase> MainWindow::add_view(const QString &title,
                QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable);
 
        QAbstractButton *close_btn =
-               dock->findChildren<QAbstractButton*>("qt_dockwidget_closebutton")
-                       .front();  // clazy:exclude=detaching-temporary
+               dock->findChildren<QAbstractButton*>("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> 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<QWidget*>())
-                       w->setMinimumHeight(h);  // clazy:exclude=range-loop
+               for (QWidget *w : static_tab_widget_->findChildren<QWidget*>())  // clazy:exclude=range-loop
+                       w->setMinimumHeight(h);
 
                int margin = static_tab_widget_->layout()->contentsMargins().bottom();
                static_tab_widget_->setMinimumHeight(h + 2 * margin);
index 1f9e4c4..9c7196b 100644 (file)
@@ -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<DecodeChannel> 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;
index 5c6aa54..8c4c982 100644 (file)
@@ -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<QAction*>())
-                               action->setEnabled(false);  // clazy:exclude=range-loop
+                       for (QAction* action : trigger_bar_->findChildren<QAction*>())  // clazy:exclude=range-loop
+                               action->setEnabled(false);
 
                form->addRow(tr("Trigger"), trigger_bar_);
        }
index 0a1fdf3..5c854ae 100644 (file)
@@ -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);