Exposed View::_session with accessor function
authorJoel Holdsworth <joel@airwebreathe.org.uk>
Fri, 7 Sep 2012 16:25:44 +0000 (17:25 +0100)
committerJoel Holdsworth <joel@airwebreathe.org.uk>
Fri, 7 Sep 2012 16:25:44 +0000 (17:25 +0100)
pv/view/view.cpp
pv/view/view.h
pv/view/viewport.cpp

index 49b96ba390a093326ba770ce80d8e1995ddace60..e0d3ada7be39df61149417fd6af1651703e90bca 100644 (file)
@@ -63,6 +63,11 @@ View::View(SigSession &session, QWidget *parent) :
        setViewport(_viewport);
 }
 
+SigSession& View::session()
+{
+       return _session;
+}
+
 double View::scale() const
 {
        return _scale;
index 3c76c8ee6bd065364d679c7727f00f2c83908fee..b7769899b7a09bf9d52988b4c469ed473be9fcca 100644 (file)
@@ -45,6 +45,8 @@ private:
 public:
        explicit View(SigSession &session, QWidget *parent = 0);
 
+       SigSession& session();
+
        double scale() const;
        double offset() const;
        int v_offset() const;
index 572e38b154317f30612e57e07165548f560bdd80..b8598bcb619534b597d66e9b9d21a071049f63b5 100644 (file)
@@ -60,7 +60,7 @@ int Viewport::get_total_height() const
 {
        int height = 0;
        BOOST_FOREACH(const shared_ptr<Signal> s,
-               _view._session.get_signals()) {
+               _view.session().get_signals()) {
                assert(s);
                height += SignalHeight;
        }
@@ -82,7 +82,7 @@ void Viewport::paintEvent(QPaintEvent *event)
        int offset;
 
        const vector< shared_ptr<Signal> > &sigs =
-               _view._session.get_signals();
+               _view.session().get_signals();
 
        // Prepare for OpenGL rendering
        makeCurrent();