Commit e0a09aa3 authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: cleaning the singletons implementation.

parent ef65c998
......@@ -66,11 +66,13 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~ActionsManager();
private:
virtual ~ActionsManager();
static ActionsManager *instance;
ActionsManager( intf_thread_t *_p_i, QObject *_parent );
intf_thread_t *p_intf;
......
......@@ -615,8 +615,7 @@ ExtV4l2::ExtV4l2( intf_thread_t *_p_intf, QWidget *_parent )
ExtV4l2::~ExtV4l2()
{
if( box )
delete box;
delete box;
}
void ExtV4l2::showEvent( QShowEvent *event )
......
......@@ -42,12 +42,13 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~BookmarksDialog();
private:
BookmarksDialog( intf_thread_t * );
virtual ~BookmarksDialog();
static BookmarksDialog *instance;
void update();
QTreeWidget *bookmarksList;
......
......@@ -42,13 +42,14 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~ExtendedDialog();
void showTab( int i );
private:
ExtendedDialog( intf_thread_t * );
virtual ~ExtendedDialog();
static ExtendedDialog *instance;
SyncControls *syncW;
......
......@@ -50,12 +50,14 @@ public:
return instance;
}
static void killInstance()
{ if( instance ) delete instance; instance = NULL;}
virtual ~HelpDialog();
{ delete instance; instance = NULL;}
private:
HelpDialog( intf_thread_t * );
virtual ~HelpDialog();
static HelpDialog *instance;
public slots:
void close();
};
......@@ -99,7 +101,7 @@ public:
return instance;
}
static void killInstance()
{ if( instance ) delete instance; instance = NULL;}
{ delete instance; instance = NULL;}
void updateNotify( bool );
......
......@@ -45,18 +45,18 @@ public:
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~MediaInfoDialog();
void showTab( int );
#if 0
void setInput( input_item_t * );
#endif
private:
virtual ~MediaInfoDialog();
static MediaInfoDialog *instance;
bool isMainInputInfo;
......
......@@ -47,14 +47,15 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~MessagesDialog();
private:
MessagesDialog( intf_thread_t * );
virtual ~MessagesDialog();
static MessagesDialog *instance;
QTabWidget *mainTab;
QSpinBox *verbosityBox;
......
......@@ -64,10 +64,9 @@ public:
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~OpenDialog();
void showTab( int = OPEN_FILE_TAB );
QString getMRL( bool b = true );
......@@ -82,6 +81,7 @@ public slots:
private:
OpenDialog( QWidget *parent, intf_thread_t *, bool b_selectMode,
int _action_flag = 0, bool b_pl = true );
virtual ~OpenDialog();
static OpenDialog *instance;
input_thread_t *p_input;
......
......@@ -48,12 +48,12 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~PlaylistDialog();
private:
PlaylistDialog( intf_thread_t * );
virtual ~PlaylistDialog();
void dropEvent( QDropEvent *);
void dragEnterEvent( QDragEnterEvent * );
......
......@@ -69,13 +69,14 @@ public:
return instance;
}
static void killInstance()
{ if( instance ) delete instance; instance = NULL;}
virtual ~ToolbarEditDialog();
{ delete instance; instance = NULL;}
int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
bigBox->isChecked() * WIDGET_BIG +
!shinyBox->isChecked() * WIDGET_SHINY; }
private:
ToolbarEditDialog( intf_thread_t * );
virtual ~ToolbarEditDialog();
static ToolbarEditDialog *instance;
QCheckBox *flatBox, *bigBox, *shinyBox;
......
......@@ -103,14 +103,13 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
static bool isAlive()
{
return ( instance != NULL );
}
virtual ~DialogsProvider();
QStringList showSimpleOpen( QString help = QString(),
int filters = EXT_FILTER_MEDIA |
......@@ -126,8 +125,10 @@ protected:
private:
DialogsProvider( intf_thread_t *);
intf_thread_t *p_intf;
virtual ~DialogsProvider();
static DialogsProvider *instance;
intf_thread_t *p_intf;
bool b_isDying;
void openDialog( int );
......
......@@ -213,9 +213,9 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~MainInputManager();
input_thread_t *getInput() { return p_input; };
InputManager *getIM() { return im; };
......@@ -225,6 +225,8 @@ public:
private:
MainInputManager( intf_thread_t * );
virtual ~MainInputManager();
static MainInputManager *instance;
void customEvent( QEvent * );
......
......@@ -291,7 +291,7 @@ MainInterface::~MainInterface()
ActionsManager::killInstance();
/* Delete the FSC controller */
if( fullscreenControls ) delete fullscreenControls;
delete fullscreenControls;
/* Save states */
settings->beginGroup( "MainWindow" );
......
......@@ -47,10 +47,9 @@ public:
}
static void killInstance()
{
if( instance ) delete instance;
delete instance;
instance = NULL;
}
virtual ~RecentsMRL();
void addRecent( const QString & );
QList<QString> recents();
......@@ -58,9 +57,12 @@ public:
private:
RecentsMRL( intf_thread_t* _p_intf );
virtual ~RecentsMRL();
static RecentsMRL *instance;
void load();
void save();
static RecentsMRL *instance;
intf_thread_t* p_intf;
QList<QString> *stack;
bool isActive;
......
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