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