From: Soeren Apel Date: Wed, 20 Nov 2019 19:23:04 +0000 (+0100) Subject: Fix clazy warnings X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=1fd847fedce2d8b93080ee7cd4d8c86aa916f6d2 Fix clazy warnings --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index e79b0459..0b68b1d7 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -261,7 +261,7 @@ shared_ptr MainWindow::add_subwindow( shared_ptr v; QMainWindow *main_window = nullptr; - for (auto entry : session_windows_) + for (auto& entry : session_windows_) if (entry.first.get() == &session) main_window = entry.second; @@ -304,7 +304,7 @@ shared_ptr MainWindow::add_subwindow( QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); QAbstractButton *close_btn = - dock->findChildren + dock->findChildren // clazy:exclude=detaching-temporary ("qt_dockwidget_closebutton").front(); connect(close_btn, SIGNAL(clicked(bool)), @@ -868,7 +868,7 @@ void MainWindow::on_show_decoder_selector(Session *session) { #ifdef ENABLE_DECODE // Close dock widget if it's already showing and return - for (auto entry : sub_windows_) { + for (auto& entry : sub_windows_) { QDockWidget* dock = entry.first; shared_ptr decoder_selector = dynamic_pointer_cast(entry.second); @@ -881,7 +881,7 @@ void MainWindow::on_show_decoder_selector(Session *session) } // We get a pointer and need a reference - for (shared_ptr s : sessions_) + for (shared_ptr& s : sessions_) if (s.get() == session) add_subwindow(subwindows::SubWindowTypeDecoderSelector, *s); #endif diff --git a/pv/subwindows/decoder_selector/subwindow.cpp b/pv/subwindows/decoder_selector/subwindow.cpp index 63cab9f9..0b49c34a 100644 --- a/pv/subwindows/decoder_selector/subwindow.cpp +++ b/pv/subwindows/decoder_selector/subwindow.cpp @@ -39,7 +39,8 @@ namespace subwindows { namespace decoder_selector { const char *initial_notice = - QT_TRANSLATE_NOOP("pv::subwindows::decoder_selector::SubWindow", "Select a decoder to see its description here."); + QT_TRANSLATE_NOOP("pv::subwindows::decoder_selector::SubWindow", + "Select a decoder to see its description here."); // clazy:exclude=non-pod-global-static const int min_width_margin = 75; diff --git a/pv/subwindows/subwindowbase.cpp b/pv/subwindows/subwindowbase.cpp index de08c440..f81b3582 100644 --- a/pv/subwindows/subwindowbase.cpp +++ b/pv/subwindows/subwindowbase.cpp @@ -67,7 +67,7 @@ unordered_set< shared_ptr > SubWindowBase::signalbases() const void SubWindowBase::clear_signalbases() { - for (shared_ptr signalbase : signalbases_) { + for (const shared_ptr& signalbase : signalbases_) { disconnect(signalbase.get(), SIGNAL(samples_cleared()), this, SLOT(on_data_updated())); disconnect(signalbase.get(), SIGNAL(samples_added(uint64_t, uint64_t, uint64_t)), diff --git a/pv/widgets/wellarray.hpp b/pv/widgets/wellarray.hpp index 4c67ca11..8b2e1ef2 100644 --- a/pv/widgets/wellarray.hpp +++ b/pv/widgets/wellarray.hpp @@ -52,8 +52,8 @@ struct WellArrayData; class WellArray : public QWidget { Q_OBJECT - Q_PROPERTY(int selectedColumn READ selectedColumn) // clazy-exclude:qproperty-without-notify - Q_PROPERTY(int selectedRow READ selectedRow) // clazy-exclude:qproperty-without-notify + Q_PROPERTY(int selectedColumn READ selectedColumn) // clazy:exclude=qproperty-without-notify + Q_PROPERTY(int selectedRow READ selectedRow) // clazy:exclude=qproperty-without-notify public: WellArray(int rows, int cols, QWidget* parent = nullptr);