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