Commit 4bb2e692 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: use the provided Singleton class for ActionsManager

parent 84d9c73e
...@@ -35,10 +35,7 @@ ...@@ -35,10 +35,7 @@
#include "main_interface.hpp" /* Show playlist */ #include "main_interface.hpp" /* Show playlist */
#include "components/controller.hpp" /* Toggle FSC controller width */ #include "components/controller.hpp" /* Toggle FSC controller width */
ActionsManager * ActionsManager::instance = NULL; ActionsManager::ActionsManager( intf_thread_t * _p_i )
ActionsManager::ActionsManager( intf_thread_t * _p_i, QObject *_parent )
: QObject( _parent )
{ {
p_intf = _p_i; p_intf = _p_i;
} }
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#endif #endif
#include "qt4.hpp" #include "qt4.hpp"
#include "util/singleton.hpp"
#include <QObject> #include <QObject>
typedef enum actionType_e typedef enum actionType_e
...@@ -58,28 +59,18 @@ typedef enum actionType_e ...@@ -58,28 +59,18 @@ typedef enum actionType_e
OPEN_SUB_ACTION, OPEN_SUB_ACTION,
} actionType_e; } actionType_e;
class ActionsManager : public QObject class ActionsManager : public QObject, public Singleton<ActionsManager>
{ {
Q_OBJECT Q_OBJECT
friend class Singleton<ActionsManager>;
public: public:
static ActionsManager *getInstance( intf_thread_t *_p_intf, QObject *_parent = 0 )
{
if( !instance )
instance = new ActionsManager( _p_intf, _parent );
return instance;
}
static void killInstance()
{
delete instance;
instance = NULL;
}
private: private:
ActionsManager( intf_thread_t *_p_i );
virtual ~ActionsManager(); virtual ~ActionsManager();
static ActionsManager *instance;
ActionsManager( intf_thread_t *_p_i, QObject *_parent );
intf_thread_t *p_intf; intf_thread_t *p_intf;
public slots: public slots:
...@@ -90,6 +81,7 @@ public slots: ...@@ -90,6 +81,7 @@ public slots:
void record(); void record();
void skipForward(); void skipForward();
void skipBackward(); void skipBackward();
protected slots: protected slots:
void fullscreen(); void fullscreen();
void snapshot(); void snapshot();
......
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