Commit f9bab4b4 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: use provided Singleton util for RecentsMRL

parent dff2e609
...@@ -50,8 +50,6 @@ ...@@ -50,8 +50,6 @@
#endif #endif
RecentsMRL* RecentsMRL::instance = NULL;
RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf ) RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf )
{ {
stack = new QStringList; stack = new QStringList;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#define QVLC_RECENTS_H_ #define QVLC_RECENTS_H_
#include "qt4.hpp" #include "qt4.hpp"
#include "util/singleton.hpp"
#include <QObject> #include <QObject>
class QStringList; class QStringList;
...@@ -33,23 +34,12 @@ class QSignalMapper; ...@@ -33,23 +34,12 @@ class QSignalMapper;
#define RECENTS_LIST_SIZE 10 #define RECENTS_LIST_SIZE 10
class RecentsMRL : public QObject class RecentsMRL : public QObject, public Singleton<RecentsMRL>
{ {
Q_OBJECT Q_OBJECT
friend class Singleton<RecentsMRL>;
public: public:
static RecentsMRL* getInstance( intf_thread_t* p_intf )
{
if(!instance)
instance = new RecentsMRL( p_intf );
return instance;
}
static void killInstance()
{
delete instance;
instance = NULL;
}
void addRecent( const QString & ); void addRecent( const QString & );
QStringList recents(); QStringList recents();
playlist_item_t *toPlaylist(int length); playlist_item_t *toPlaylist(int length);
...@@ -59,8 +49,6 @@ private: ...@@ -59,8 +49,6 @@ private:
RecentsMRL( intf_thread_t* _p_intf ); RecentsMRL( intf_thread_t* _p_intf );
virtual ~RecentsMRL(); virtual ~RecentsMRL();
static RecentsMRL *instance;
intf_thread_t *p_intf; intf_thread_t *p_intf;
QStringList *stack; QStringList *stack;
QRegExp *filter; QRegExp *filter;
......
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