]> sigrok.org Git - pulseview.git/commitdiff
Fix some signal/slot bugs
authorSoeren Apel <redacted>
Tue, 5 May 2020 19:44:00 +0000 (21:44 +0200)
committerSoeren Apel <redacted>
Mon, 11 May 2020 19:24:22 +0000 (21:24 +0200)
pv/data/analog.hpp
pv/mainwindow.cpp
pv/mainwindow.hpp
pv/session.hpp

index bcdf7bc92300e7b9fe53eac5f8cf364bd8c701a4..630075da99a773f3d17183443a4d491b051d3816 100644 (file)
@@ -26,6 +26,7 @@
 #include <memory>
 
 #include <QObject>
+#include "pv/data/segment.hpp"
 
 using std::deque;
 using std::shared_ptr;
@@ -67,7 +68,7 @@ public:
 Q_SIGNALS:
        void samples_cleared();
 
-       void samples_added(shared_ptr<Segment> segment, uint64_t start_sample,
+       void samples_added(SharedPtrToSegment segment, uint64_t start_sample,
                uint64_t end_sample);
 
        void min_max_changed(float min, float max);
index 6758d77df88a1854141964ab54e1b80a9be1ad4a..4c98b490ca8b9854a45954a9ac2d76bfc5b64b9b 100644 (file)
@@ -333,8 +333,8 @@ shared_ptr<Session> MainWindow::add_session()
 
        shared_ptr<Session> session = make_shared<Session>(device_manager_, name);
 
-       connect(session.get(), SIGNAL(add_view(views::ViewType, Session*)),
-               this, SLOT(on_add_view(views::ViewType, Session*)));
+       connect(session.get(), SIGNAL(add_view(ViewType, Session*)),
+               this, SLOT(on_add_view(ViewType, Session*)));
        connect(session.get(), SIGNAL(name_changed()),
                this, SLOT(on_session_name_changed()));
        connect(session.get(), SIGNAL(device_changed()),
index 522ab1c0478ea7d1def85a90ada942733735f182..c9a8ad2641270d6d0df83f199b88d91939a2c675 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "session.hpp"
 #include "subwindows/subwindowbase.hpp"
-#include "views/viewbase.hpp"
 
 using std::list;
 using std::map;
@@ -53,6 +52,7 @@ class MainBar;
 
 namespace view {
 class View;
+class ViewBase;
 }
 
 namespace widgets {
@@ -61,6 +61,9 @@ class DecoderMenu;
 #endif
 }
 
+using pv::views::ViewBase;
+using pv::views::ViewType;
+
 class MainWindow : public QMainWindow
 {
        Q_OBJECT
@@ -78,9 +81,9 @@ public:
 
        shared_ptr<views::ViewBase> get_active_view() const;
 
-       shared_ptr<views::ViewBase> add_view(views::ViewType type, Session &session);
+       shared_ptr<views::ViewBase> add_view(ViewType type, Session &session);
 
-       void remove_view(shared_ptr<views::ViewBase> view);
+       void remove_view(shared_ptr<ViewBase> view);
 
        shared_ptr<subwindows::SubWindowBase> add_subwindow(
                subwindows::SubWindowType type, Session &session);
@@ -113,7 +116,7 @@ private:
        virtual bool restoreState(const QByteArray &state, int version = 0);
 
 private Q_SLOTS:
-       void on_add_view(views::ViewType type, Session *session);
+       void on_add_view(ViewType type, Session *session);
 
        void on_focus_changed();
        void on_focused_session_changed(shared_ptr<Session> session);
index 56fbc3a4ee38427af414a3efe5afad3fc324e0d2..77a20e3cfa106031e8f4d6f8f42d3c515a19606f 100644 (file)
@@ -107,6 +107,7 @@ namespace views {
 class ViewBase;
 }
 
+using pv::views::ViewType;
 
 class Session : public QObject
 {
@@ -252,7 +253,7 @@ Q_SIGNALS:
 
        void data_received();
 
-       void add_view(views::ViewType type, Session *session);
+       void add_view(ViewType type, Session *session);
 
 public Q_SLOTS:
        void on_data_saved();