Commit bfa0a5e1 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: MIM: Make use of singleton

parent ad6c671f
...@@ -939,7 +939,6 @@ void InputManager::AtoBLoop( float, int64_t i_time, int ) ...@@ -939,7 +939,6 @@ void InputManager::AtoBLoop( float, int64_t i_time, int )
* take care of updating the main playlist input. * take care of updating the main playlist input.
* Used in the main playlist Dialog * Used in the main playlist Dialog
**********************************************************************/ **********************************************************************/
MainInputManager * MainInputManager::instance = NULL;
MainInputManager::MainInputManager( intf_thread_t *_p_intf ) MainInputManager::MainInputManager( intf_thread_t *_p_intf )
: QObject(NULL), p_intf( _p_intf ) : QObject(NULL), p_intf( _p_intf )
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <vlc_input.h> #include <vlc_input.h>
#include "qt4.hpp" #include "qt4.hpp"
#include "util/singleton.hpp"
#include <QObject> #include <QObject>
#include <QEvent> #include <QEvent>
...@@ -241,22 +242,11 @@ signals: ...@@ -241,22 +242,11 @@ signals:
void epgChanged(); void epgChanged();
}; };
class MainInputManager : public QObject class MainInputManager : public QObject, public Singleton<MainInputManager>
{ {
Q_OBJECT Q_OBJECT
friend class Singleton<MainInputManager>;
public: public:
static MainInputManager *getInstance( intf_thread_t *_p_intf )
{
if( !instance )
instance = new MainInputManager( _p_intf );
return instance;
}
static void killInstance()
{
delete instance;
instance = NULL;
}
input_thread_t *getInput() { return p_input; } input_thread_t *getInput() { return p_input; }
InputManager *getIM() { return im; } InputManager *getIM() { return im; }
inline input_item_t *currentInputItem() inline input_item_t *currentInputItem()
...@@ -272,8 +262,6 @@ private: ...@@ -272,8 +262,6 @@ private:
MainInputManager( intf_thread_t * ); MainInputManager( intf_thread_t * );
virtual ~MainInputManager(); virtual ~MainInputManager();
static MainInputManager *instance;
void customEvent( QEvent * ); void customEvent( QEvent * );
InputManager *im; InputManager *im;
......
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