Commit 5539992d authored by Ludovic Fauvet's avatar Ludovic Fauvet

Revert "TracksView is now a singleton"

Not needed anymore.
This reverts commit c7f780d7.
parent 9491943a
...@@ -39,7 +39,7 @@ Timeline::Timeline( QWidget *parent ) : ...@@ -39,7 +39,7 @@ Timeline::Timeline( QWidget *parent ) :
m_mainWorkflow = new MainWorkflow( MAX_TRACKS ); m_mainWorkflow = new MainWorkflow( MAX_TRACKS );
m_tracksScene = new TracksScene( this ); m_tracksScene = new TracksScene( this );
m_tracksView = TracksView::instance( m_tracksScene, m_mainWorkflow, m_ui.tracksFrame ); m_tracksView = new TracksView( m_tracksScene, m_mainWorkflow, m_ui.tracksFrame );
m_tracksView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_tracksView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
m_tracksView->scale(1, 1); m_tracksView->scale(1, 1);
m_tracksView->setAlignment( Qt::AlignLeft | Qt::AlignTop ); m_tracksView->setAlignment( Qt::AlignLeft | Qt::AlignTop );
......
...@@ -35,26 +35,9 @@ ...@@ -35,26 +35,9 @@
#include "GraphicsCursorItem.h" #include "GraphicsCursorItem.h"
#include "Commands.hpp" #include "Commands.hpp"
TracksView* TracksView::m_instance = NULL;
TracksView* TracksView::instance( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidget* parent )
{
if ( m_instance ) return m_instance;
m_instance = new TracksView( scene, mainWorkflow, parent );
return m_instance;
}
TracksView* TracksView::instance()
{
Q_ASSERT( m_instance );
return m_instance;
}
TracksView::TracksView( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidget* parent ) TracksView::TracksView( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidget* parent )
: QGraphicsView( scene, parent ), m_scene( scene ), m_mainWorkflow( mainWorkflow ) : QGraphicsView( scene, parent ), m_scene( scene ), m_mainWorkflow( mainWorkflow )
{ {
connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( deleteLater() ) );
//TODO should be defined by the settings //TODO should be defined by the settings
m_tracksHeight = 25; m_tracksHeight = 25;
......
...@@ -81,8 +81,7 @@ class TracksView : public QGraphicsView ...@@ -81,8 +81,7 @@ class TracksView : public QGraphicsView
Q_OBJECT Q_OBJECT
public: public:
static TracksView* instance( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidget* parent = 0 ); TracksView( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidget* parent = 0 );
static TracksView* instance();
void setDuration( int duration ); void setDuration( int duration );
int duration() const { return m_projectDuration; } int duration() const { return m_projectDuration; }
int tracksHeight() const { return m_tracksHeight; } int tracksHeight() const { return m_tracksHeight; }
...@@ -113,14 +112,11 @@ private slots: ...@@ -113,14 +112,11 @@ private slots:
void updateDuration(); void updateDuration();
private: private:
TracksView( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidget* parent = 0 );
virtual ~TracksView() { }
void createLayout(); void createLayout();
void addVideoTrack(); void addVideoTrack();
void addAudioTrack(); void addAudioTrack();
void moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position ); void moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position );
void moveMediaItem( AbstractGraphicsMediaItem* item, int track, int time ); void moveMediaItem( AbstractGraphicsMediaItem* item, int track, int time );
static TracksView* m_instance;
QGraphicsScene* m_scene; QGraphicsScene* m_scene;
int m_tracksHeight; int m_tracksHeight;
unsigned int m_tracksCount; unsigned int m_tracksCount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment