Fix some clang-tidy complaints
authorSoeren Apel <soeren@apelpie.net>
Wed, 30 Dec 2020 21:27:13 +0000 (22:27 +0100)
committerSoeren Apel <soeren@apelpie.net>
Wed, 30 Dec 2020 21:27:13 +0000 (22:27 +0100)
pv/data/signalbase.hpp
pv/subwindows/decoder_selector/subwindow.cpp
pv/subwindows/decoder_selector/subwindow.hpp
pv/views/tabular_decoder/model.cpp
pv/views/trace/view.cpp

index 2223abaf75d3346532d26f81c9a529d0e4b3ae41..c3d0bed11a6e9863305f7cef9f54b866c4cb55a7 100644 (file)
@@ -87,7 +87,7 @@ private:
 class SignalBase : public QObject, public enable_shared_from_this<SignalBase>
 {
        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();
index 2c65dcf2e4f3f928ac38216a4303fd7fe543b8be..0c4b76bb8c14aca9fcb58688f037579c205dd13e 100644 (file)
@@ -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&)));
index c189fb24860efb085a859617e5bd8bf4bcb896eb..f4ec022329b425d63f48f3be766a0b9b40b23582 100644 (file)
@@ -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
index 337f4ce9ae1d02d46ffba8dc903162d5d6a2d468..def753b2fa44b99f8e71d1db508ed103d25b422d 100644 (file)
@@ -228,8 +228,9 @@ void AnnotationCollectionModel::set_signal_and_segment(data::DecodeSignal* signa
                return;
        }
 
-       for (const shared_ptr<Decoder>& dec : signal_->decoder_stack())
-               disconnect(dec.get(), nullptr, this, SLOT(on_annotation_visibility_changed()));
+       if (signal_)
+               for (const shared_ptr<Decoder>& 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;
index 2e4d147d2fb6a9949d5d4fcb348f1c3bc92ac448..f1de3b20e9faeab2c2ac10e3665b5b38d897d1ae 100644 (file)
@@ -933,7 +933,7 @@ pair<Timestamp, Timestamp> View::get_time_extents() const
        if (signals_.size() == 0)
                return make_pair(0, 0);
 
-       for (shared_ptr<Signal> s : signals_)
+       for (const shared_ptr<Signal>& s : signals_)
                if (s->base()->data() && (s->base()->data()->segments().size() > 0))
                        data.push_back(s->base()->data());