]> sigrok.org Git - pulseview.git/commitdiff
TabularDecView: Remove unnecessary stuff
authorSoeren Apel <redacted>
Thu, 30 Apr 2020 14:06:27 +0000 (16:06 +0200)
committerUwe Hermann <redacted>
Sun, 3 May 2020 15:20:55 +0000 (17:20 +0200)
pv/views/tabular_decoder/model.cpp
pv/views/tabular_decoder/view.hpp

index 6037cf3e8171745caa67191999b6a967914edd8b..c8692efb17d7125003b8989a2311b3b275a00b3d 100644 (file)
@@ -25,6 +25,7 @@
 #include "view.hpp"
 
 #include "pv/util.hpp"
+#include "pv/globalsettings.hpp"
 
 using std::make_shared;
 
@@ -48,9 +49,6 @@ AnnotationCollectionModel::AnnotationCollectionModel(QObject* parent) :
        end_index_(0),
        hide_hidden_(false)
 {
-       GlobalSettings::add_change_handler(this);
-       theme_is_dark_ = GlobalSettings::current_theme_is_dark();
-
        // TBD Maybe use empty columns as indentation levels to indicate stacked decoders
        header_data_.emplace_back(tr("Sample"));     // Column #0
        header_data_.emplace_back(tr("Time"));       // Column #1
@@ -101,7 +99,7 @@ QVariant AnnotationCollectionModel::data(const QModelIndex& index, int role) con
 
                // Only use custom cell background color if column index reached the hierarchy level
                if (index.column() >= level) {
-                       if (theme_is_dark_)
+                       if (GlobalSettings::current_theme_is_dark())
                                return QBrush(ann->dark_color());
                        else
                                return QBrush(ann->bright_color());
@@ -330,16 +328,6 @@ void AnnotationCollectionModel::update_annotations_without_hidden()
        all_annotations_without_hidden_.resize(count);
 }
 
-void AnnotationCollectionModel::on_setting_changed(const QString &key, const QVariant &value)
-{
-       (void)key;
-       (void)value;
-
-       // We don't really care about the actual setting, we just update the
-       // flag that indicates whether we are using a bright or dark color theme
-       theme_is_dark_ = GlobalSettings::current_theme_is_dark();
-}
-
 void AnnotationCollectionModel::on_annotation_visibility_changed()
 {
        if (!hide_hidden_)
index ae2d5276de2a6a46cf54f12c9951f79a4b30a104..7d25f700e3089376a12c64fecaed89672f7aa782 100644 (file)
@@ -26,7 +26,6 @@
 #include <QTableView>
 #include <QToolButton>
 
-#include "pv/globalsettings.hpp"
 #include "pv/metadata_obj.hpp"
 #include "pv/views/viewbase.hpp"
 #include "pv/data/decodesignal.hpp"
@@ -57,7 +56,7 @@ extern const char* SaveTypeNames[SaveTypeCount];
 extern const char* ViewModeNames[ViewModeCount];
 
 
-class AnnotationCollectionModel : public QAbstractTableModel, public GlobalSettingsInterface
+class AnnotationCollectionModel : public QAbstractTableModel
 {
        Q_OBJECT
 
@@ -84,8 +83,6 @@ public:
 
        void update_annotations_without_hidden();
 
-       void on_setting_changed(const QString &key, const QVariant &value) override;
-
 private Q_SLOTS:
        void on_annotation_visibility_changed();
 
@@ -99,7 +96,6 @@ private:
        uint64_t prev_last_row_;
        uint64_t start_sample_, end_sample_, start_index_, end_index_;
        bool hide_hidden_;
-       bool theme_is_dark_;
 };