From: Soeren Apel Date: Wed, 30 Dec 2020 21:27:13 +0000 (+0100) Subject: Fix some clang-tidy complaints X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=c259400566cecf3b6ca959bc60c671a7195c0078 Fix some clang-tidy complaints --- diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index 2223abaf..c3d0bed1 100644 --- a/pv/data/signalbase.hpp +++ b/pv/data/signalbase.hpp @@ -87,7 +87,7 @@ private: class SignalBase : public QObject, public enable_shared_from_this { Q_OBJECT - Q_PROPERTY(QString error_message READ get_error_message) + Q_PROPERTY(QString error_message READ get_error_message NOTIFY error_message_changed) public: enum ChannelType { @@ -379,7 +379,7 @@ Q_SIGNALS: void enabled_changed(const bool &value); void name_changed(const QString &name); void color_changed(const QColor &color); - void error_message_changed(const QString &msg); + void error_message_changed(QString msg); void conversion_type_changed(const ConversionType t); void samples_cleared(); diff --git a/pv/subwindows/decoder_selector/subwindow.cpp b/pv/subwindows/decoder_selector/subwindow.cpp index 2c65dcf2..0c4b76bb 100644 --- a/pv/subwindows/decoder_selector/subwindow.cpp +++ b/pv/subwindows/decoder_selector/subwindow.cpp @@ -74,7 +74,8 @@ void QCustomTreeView::currentChanged(const QModelIndex& current, const QModelIndex& previous) { QTreeView::currentChanged(current, previous); - currentChanged(current); + + current_changed(current); } @@ -158,7 +159,7 @@ SubWindow::SubWindow(Session& session, QWidget* parent) : connect(filter, SIGNAL(returnPressed()), this, SLOT(on_filter_return_pressed())); - connect(tree_view_, SIGNAL(currentChanged(const QModelIndex&)), + connect(tree_view_, SIGNAL(current_changed(const QModelIndex&)), this, SLOT(on_item_changed(const QModelIndex&))); connect(tree_view_, SIGNAL(activated(const QModelIndex&)), this, SLOT(on_item_activated(const QModelIndex&))); diff --git a/pv/subwindows/decoder_selector/subwindow.hpp b/pv/subwindows/decoder_selector/subwindow.hpp index c189fb24..f4ec0223 100644 --- a/pv/subwindows/decoder_selector/subwindow.hpp +++ b/pv/subwindows/decoder_selector/subwindow.hpp @@ -99,7 +99,7 @@ public: void currentChanged(const QModelIndex& current, const QModelIndex& previous); Q_SIGNALS: - void currentChanged(const QModelIndex& current); + void current_changed(const QModelIndex& current); }; class SubWindow : public SubWindowBase diff --git a/pv/views/tabular_decoder/model.cpp b/pv/views/tabular_decoder/model.cpp index 337f4ce9..def753b2 100644 --- a/pv/views/tabular_decoder/model.cpp +++ b/pv/views/tabular_decoder/model.cpp @@ -228,8 +228,9 @@ void AnnotationCollectionModel::set_signal_and_segment(data::DecodeSignal* signa return; } - for (const shared_ptr& dec : signal_->decoder_stack()) - disconnect(dec.get(), nullptr, this, SLOT(on_annotation_visibility_changed())); + if (signal_) + for (const shared_ptr& dec : signal_->decoder_stack()) + disconnect(dec.get(), nullptr, this, SLOT(on_annotation_visibility_changed())); all_annotations_ = signal->get_all_annotations_by_segment(current_segment); signal_ = signal; diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index 2e4d147d..f1de3b20 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -933,7 +933,7 @@ pair View::get_time_extents() const if (signals_.size() == 0) return make_pair(0, 0); - for (shared_ptr s : signals_) + for (const shared_ptr& s : signals_) if (s->base()->data() && (s->base()->data()->segments().size() > 0)) data.push_back(s->base()->data());