Qt: Use the singleton class, to simplify the code
authorHugo Beauzee-Luyssen <beauze.h@gmail.com>
Mon, 21 Dec 2009 14:31:36 +0000 (15:31 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 25 Dec 2009 17:16:49 +0000 (18:16 +0100)
Use the generic singleton for Bookmarks, ErrorsDialog, extended dialog, GotoTime dialog, every help class, MediaInfo, Messages, OpenURL, Playlist, Plugin, Podcast configuration and VLM. Also fix some memleaks when quitting

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
25 files changed:
modules/gui/qt4/dialogs/bookmarks.cpp
modules/gui/qt4/dialogs/bookmarks.hpp
modules/gui/qt4/dialogs/errors.cpp
modules/gui/qt4/dialogs/errors.hpp
modules/gui/qt4/dialogs/extended.cpp
modules/gui/qt4/dialogs/extended.hpp
modules/gui/qt4/dialogs/gototime.cpp
modules/gui/qt4/dialogs/gototime.hpp
modules/gui/qt4/dialogs/help.cpp
modules/gui/qt4/dialogs/help.hpp
modules/gui/qt4/dialogs/mediainfo.cpp
modules/gui/qt4/dialogs/mediainfo.hpp
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/openurl.cpp
modules/gui/qt4/dialogs/openurl.hpp
modules/gui/qt4/dialogs/playlist.cpp
modules/gui/qt4/dialogs/playlist.hpp
modules/gui/qt4/dialogs/plugins.cpp
modules/gui/qt4/dialogs/plugins.hpp
modules/gui/qt4/dialogs/podcast_configuration.cpp
modules/gui/qt4/dialogs/podcast_configuration.hpp
modules/gui/qt4/dialogs/vlm.cpp
modules/gui/qt4/dialogs/vlm.hpp
modules/gui/qt4/dialogs_provider.cpp

index 950f724..4feaf51 100644 (file)
@@ -31,8 +31,6 @@
 #include <QSpacerItem>
 #include <QPushButton>
 
-BookmarksDialog *BookmarksDialog::instance = NULL;
-
 BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
 {
     setWindowFlags( Qt::Tool );
index 223d281..af55f4a 100644 (file)
 #include <QStandardItemModel>
 #include <QTreeView>
 #include <QTreeWidget>
+#include "util/singleton.hpp"
 
-class BookmarksDialog : public QVLCFrame
+class BookmarksDialog : public QVLCFrame, public Singleton<BookmarksDialog>
 {
     Q_OBJECT;
-public:
-    static BookmarksDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance )
-            instance = new BookmarksDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    {
-        delete instance;
-        instance = NULL;
-    }
 private:
     BookmarksDialog( intf_thread_t * );
     virtual ~BookmarksDialog();
 
-    static BookmarksDialog *instance;
     QTreeWidget *bookmarksList;
 
 private slots:
@@ -60,6 +48,8 @@ private slots:
     void edit( QTreeWidgetItem *item, int column );
     void extract();
     void activateItem( QModelIndex index );
+
+    friend class    Singleton<BookmarksDialog>;
 };
 
 #endif
index 2dd0b8b..0d4edcc 100644 (file)
 #include <QDialogButtonBox>
 #include <QPushButton>
 
-ErrorsDialog *ErrorsDialog::instance = NULL;
-
-ErrorsDialog::ErrorsDialog( QWidget *parent, intf_thread_t *_p_intf )
-             : QVLCDialog( parent, _p_intf )
+ErrorsDialog::ErrorsDialog( intf_thread_t *_p_intf )
+             : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
 {
     setWindowTitle( qtr( "Errors" ) );
     setWindowRole( "vlc-errors" );
index dde9f05..ebe8f32 100644 (file)
 #define QVLC_ERRORS_DIALOG_H_ 1
 
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 
 class QPushButton;
 class QCheckBox;
 class QGridLayout;
 class QTextEdit;
 
-class ErrorsDialog : public QVLCDialog
+class ErrorsDialog : public QVLCDialog, public Singleton<ErrorsDialog>
 {
     Q_OBJECT;
 public:
-    static ErrorsDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new ErrorsDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
-        return instance;
-    }
-    virtual ~ErrorsDialog() {};
 
     void addError( const QString&, const QString& );
     /*void addWarning( QString, QString );*/
 private:
-    ErrorsDialog( QWidget *parent, intf_thread_t * );
-    static ErrorsDialog *instance;
+    virtual ~ErrorsDialog() {};
+    ErrorsDialog( intf_thread_t * );
     void add( bool, const QString&, const QString& );
 
     QCheckBox *stopShowing;
@@ -56,6 +50,8 @@ private slots:
     void close();
     void clear();
     void dontShow();
+
+    friend class    Singleton<ErrorsDialog>;
 };
 
 #endif
index c44bcbd..87cfff6 100644 (file)
@@ -33,8 +33,6 @@
 #include <QTabWidget>
 #include <QGridLayout>
 
-ExtendedDialog *ExtendedDialog::instance = NULL;
-
 ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
 {
     setWindowFlags( Qt::Tool );
index 04977ab..ed16ded 100644 (file)
 #include "util/qvlcframe.hpp"
 
 #include "components/extended_panels.hpp"
+#include "util/singleton.hpp"
 
 class QTabWidget;
 
-class ExtendedDialog : public QVLCFrame
+class ExtendedDialog : public QVLCFrame, public Singleton<ExtendedDialog>
 {
     Q_OBJECT;
 public:
-    static ExtendedDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new ExtendedDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    {
-        delete instance;
-        instance = NULL;
-    }
     void showTab( int i );
     int currentTab();
 private:
     ExtendedDialog( intf_thread_t * );
     virtual ~ExtendedDialog();
 
-    static ExtendedDialog *instance;
-
     SyncControls *syncW;
     ExtVideo *videoEffect;
     Equalizer *equal;
     QTabWidget *mainTabW;
 private slots:
     void changedItem( int );
+
+    friend class    Singleton<ExtendedDialog>;
 };
 
 #endif
index 5832acd..a75ec11 100644 (file)
 #include <QGroupBox>
 #include <QDialogButtonBox>
 
-GotoTimeDialog *GotoTimeDialog::instance = NULL;
-
-GotoTimeDialog::GotoTimeDialog( QWidget *parent, intf_thread_t *_p_intf)
-               : QVLCDialog( parent, _p_intf )
+GotoTimeDialog::GotoTimeDialog( intf_thread_t *_p_intf)
+               : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
 {
     setWindowFlags( Qt::Tool );
     setWindowTitle( qtr( "Go to Time" ) );
index 54698f6..f84961d 100644 (file)
 #define QVLC_GOTOTIME_DIALOG_H_ 1
 
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 
 class QTimeEdit;
 
-class GotoTimeDialog : public QVLCDialog
+class GotoTimeDialog : public QVLCDialog, public Singleton<GotoTimeDialog>
 {
     Q_OBJECT;
-public:
-    static GotoTimeDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new GotoTimeDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
-        return instance;
-    }
-    virtual ~GotoTimeDialog();
-
 private:
-    GotoTimeDialog( QWidget *, intf_thread_t * );
-    static GotoTimeDialog *instance;
+    GotoTimeDialog( intf_thread_t * );
+    virtual ~GotoTimeDialog();
     QTimeEdit *timeEdit;
 private slots:
     void close();
     void cancel();
+
+    friend class    Singleton<GotoTimeDialog>;
 };
 
 #endif
index c793467..ded00b5 100644 (file)
@@ -47,8 +47,6 @@
 
 #include <assert.h>
 
-HelpDialog *HelpDialog::instance = NULL;
-
 HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 
 {
@@ -80,10 +78,8 @@ void HelpDialog::close()
     toggleVisible();
 }
 
-AboutDialog *AboutDialog::instance = NULL;
-
-AboutDialog::AboutDialog( QWidget *parent, intf_thread_t *_p_intf)
-            : QVLCDialog( parent, _p_intf )
+AboutDialog::AboutDialog( intf_thread_t *_p_intf)
+            : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
 {
     setWindowTitle( qtr( "About" ) );
     setWindowRole( "vlc-about" );
@@ -198,8 +194,6 @@ static void UpdateCallback( void *data, bool b_ret )
     QApplication::postEvent( UDialog, event );
 }
 
-UpdateDialog *UpdateDialog::instance = NULL;
-
 UpdateDialog::UpdateDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 {
     setWindowTitle( qtr( "VLC media player updates" ) );
index c6cde3a..e5b04e9 100644 (file)
@@ -31,6 +31,7 @@
 #include "qt4.hpp"
 
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 
 class QPushButton;
 class QTextBrowser;
@@ -39,50 +40,32 @@ class QEvent;
 class QPushButton;
 class QTextEdit;
 
-class HelpDialog : public QVLCFrame
+class HelpDialog : public QVLCFrame, public Singleton<HelpDialog>
 {
     Q_OBJECT;
-public:
-    static HelpDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new HelpDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    { delete instance; instance = NULL;}
-
 private:
     HelpDialog( intf_thread_t * );
     virtual ~HelpDialog();
 
-    static HelpDialog *instance;
-
 public slots:
     void close();
+
+    friend class    Singleton<HelpDialog>;
 };
 
 
-class AboutDialog : public QVLCDialog
+class AboutDialog : public QVLCDialog, public Singleton<AboutDialog>
 {
     Q_OBJECT;
-public:
-    static AboutDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new AboutDialog( (QWidget *)p_intf->p_sys->p_mi,
-                                        p_intf );
-        return instance;
-    }
 
 private:
-    AboutDialog( QWidget *, intf_thread_t * );
+    AboutDialog( intf_thread_t * );
     virtual ~AboutDialog();
 
-    static AboutDialog *instance;
-
 public slots:
     void close();
+
+    friend class    Singleton<AboutDialog>;
 };
 
 #ifdef UPDATE_CHECK
@@ -90,27 +73,16 @@ public slots:
 static const int UDOkEvent = QEvent::User + DialogEventType + 21;
 static const int UDErrorEvent = QEvent::User + DialogEventType + 22;
 
-class UpdateDialog : public QVLCFrame
+class UpdateDialog : public QVLCFrame, public Singleton<UpdateDialog>
 {
     Q_OBJECT;
 public:
-    static UpdateDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance )
-            instance = new UpdateDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    { delete instance; instance = NULL;}
-
     void updateNotify( bool );
 
 private:
     UpdateDialog( intf_thread_t * );
     virtual ~UpdateDialog();
 
-    static UpdateDialog *instance;
-
     update_t *p_update;
     QPushButton *updateButton;
     QLabel *updateLabelTop;
@@ -122,6 +94,8 @@ private:
 private slots:
     void close();
     void UpdateOrDownload();
+
+    friend class    Singleton<UpdateDialog>;
 };
 #endif
 
index 371e878..51e991a 100644 (file)
@@ -34,8 +34,6 @@
 #include <QLineEdit>
 #include <QLabel>
 
-MediaInfoDialog *MediaInfoDialog::instance = NULL;
-
 /* This Dialog has two main modes:
     - General Mode that shows the current Played item, and the stats
     - Single mode that shows the info on ONE SINGLE Item on the playlist
index 8b591c7..4343bb7 100644 (file)
 
 #include "util/qvlcframe.hpp"
 #include "components/info_panels.hpp"
+#include "util/singleton.hpp"
 
 class QTabWidget;
 
-class MediaInfoDialog : public QVLCFrame
+class MediaInfoDialog : public QVLCFrame, public Singleton<MediaInfoDialog>
 {
     Q_OBJECT;
 public:
     MediaInfoDialog( intf_thread_t *,
-                     input_item_t * );
-
-    static MediaInfoDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance) instance = new MediaInfoDialog( p_intf, NULL );
-        return instance;
-    }
-
-    static void killInstance()
-    {
-        delete instance;
-        instance = NULL;
-    }
+                     input_item_t * input = NULL );
 
     void showTab( int );
 #if 0
@@ -57,7 +46,6 @@ public:
 private:
     virtual ~MediaInfoDialog();
 
-    static MediaInfoDialog *instance;
     bool isMainInputInfo;
 
     QTabWidget *infoTabW;
@@ -77,6 +65,8 @@ private slots:
 
     void saveMeta();
     void updateButtons( int i_tab );
+
+    friend class    Singleton<MediaInfoDialog>;
 };
 
 #endif
index 4c5954c..825446d 100644 (file)
@@ -41,8 +41,6 @@
 
 #include <assert.h>
 
-MessagesDialog *MessagesDialog::instance = NULL;
-
 enum {
     MsgEvent_Type = QEvent::User + MsgEventType + 1,
 };
index def795d..766feff 100644 (file)
@@ -25,6 +25,7 @@
 #define QVLC_MESSAGES_DIALOG_H_ 1
 
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 
 class QTabWidget;
 class QPushButton;
@@ -35,28 +36,13 @@ class QTextEdit;
 class QTreeWidget;
 class QTreeWidgetItem;
 
-class MessagesDialog : public QVLCFrame
+class MessagesDialog : public QVLCFrame, public Singleton<MessagesDialog>
 {
     Q_OBJECT;
-public:
-    static MessagesDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new MessagesDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    {
-        delete instance;
-        instance = NULL;
-    }
-
-
 private:
     MessagesDialog( intf_thread_t * );
     virtual ~MessagesDialog();
 
-    static MessagesDialog *instance;
     QTabWidget *mainTab;
     QSpinBox *verbosityBox;
     QLabel *verbosityLabel;
@@ -78,6 +64,8 @@ private:
     void clear();
     void updateTree();
     void buildTree( QTreeWidgetItem *, vlc_object_t * );
+
+    friend class    Singleton<MessagesDialog>;
 };
 
 #endif
index 24f4adc..d588898 100644 (file)
 
 #include <assert.h>
 
-OpenUrlDialog *OpenUrlDialog::instance = NULL;
-
-OpenUrlDialog* OpenUrlDialog::getInstance( QWidget *parent,
-                                           intf_thread_t *p_intf,
-                                           bool bClipboard )
-{
-    /* Creation */
-    if( !instance )
-        instance = new OpenUrlDialog( parent, p_intf, bClipboard );
-    else
-        instance->bClipboard = bClipboard;
-    return instance;
-}
-
-OpenUrlDialog::OpenUrlDialog( QWidget *parent,
-                              intf_thread_t *_p_intf,
+OpenUrlDialog::OpenUrlDialog( intf_thread_t *_p_intf,
                               bool _bClipboard ) :
-        QVLCDialog( parent, _p_intf ), bClipboard( _bClipboard )
+        QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf ), bClipboard( _bClipboard )
 {
     setWindowTitle( qtr( "Open URL" ) );
     setWindowRole( "vlc-open-url" );
index 40bda54..c7fae15 100644 (file)
 
 #include <vlc_common.h>
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 
 class ClickLineEdit;
 
-class OpenUrlDialog : public QVLCDialog
+class OpenUrlDialog : public QVLCDialog, public Singleton<OpenUrlDialog>
 {
     Q_OBJECT
 
 private:
-    OpenUrlDialog( QWidget *, intf_thread_t *, bool bClipboard = true );
+    OpenUrlDialog( intf_thread_t *, bool bClipboard = true );
     QString lastUrl;
     bool bClipboard, bShouldEnqueue;
     ClickLineEdit *edit;
 
-    static OpenUrlDialog *instance;
-
 private slots:
     void enqueue();
     void play();
@@ -52,16 +51,14 @@ private slots:
 public:
     virtual ~OpenUrlDialog() {}
 
-    static OpenUrlDialog* getInstance( QWidget *parent,
-                                       intf_thread_t *p_intf,
-                                       bool bClipboard = true );
-
     QString url() const;
     bool shouldEnqueue() const;
     void showEvent( QShowEvent *ev );
 
 public slots:
     virtual void close() { play(); };
+
+    friend class    Singleton<OpenUrlDialog>;
 };
 
 #endif
index 459ee68..f64cc7d 100644 (file)
@@ -33,8 +33,6 @@
 #include <QUrl>
 #include <QHBoxLayout>
 
-PlaylistDialog *PlaylistDialog::instance = NULL;
-
 PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
                 : QVLCMW( _p_intf )
 {
index a27ed8e..ac20a45 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "util/qvlcframe.hpp"
 #include "../components/playlist/playlist.hpp"
+#include "util/singleton.hpp"
 
 #include <QModelIndex>
 
@@ -34,23 +35,12 @@ class PLSelector;
 class PLPanel;
 class QSettings;
 
-class PlaylistDialog : public QVLCMW
+class PlaylistDialog : public QVLCMW, public Singleton<PlaylistDialog>
 {
     Q_OBJECT;
 private:
     PlaylistWidget *playlistWidget;
 
-public:
-    static PlaylistDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance) instance = new PlaylistDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    {
-        delete instance;
-        instance = NULL;
-    }
 private:
     PlaylistDialog( intf_thread_t * );
     virtual ~PlaylistDialog();
@@ -60,7 +50,7 @@ private:
     void dragMoveEvent( QDragMoveEvent * );
     void dragLeaveEvent( QDragLeaveEvent * );
 
-    static PlaylistDialog *instance;
+    friend class    Singleton<PlaylistDialog>;
 };
 
 
index e071c18..40bb9bc 100644 (file)
@@ -38,8 +38,6 @@
 #include <QLineEdit>
 #include <QLabel>
 
-PluginDialog *PluginDialog::instance = NULL;
-
 PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 {
     setWindowTitle( qtr( "Plugins and extensions" ) );
index 1245e9c..f45888c 100644 (file)
@@ -25,6 +25,7 @@
 #define QVLC_PLUGIN_DIALOG_H_ 1
 
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 #include <QTreeWidget>
 #include <QStringList>
 
@@ -32,31 +33,21 @@ class QTreeWidget;
 class QLineEdit;
 
 class SearchLineEdit;
-class PluginDialog : public QVLCFrame
+class PluginDialog : public QVLCFrame, public Singleton<PluginDialog>
 {
     Q_OBJECT;
-public:
-    static PluginDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new PluginDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    {
-        delete instance;
-        instance = NULL;
-    }
+
 private:
     PluginDialog( intf_thread_t * );
     virtual ~PluginDialog();
-    static PluginDialog *instance;
 
     void FillTree();
     QTreeWidget *treePlugins;
     SearchLineEdit *edit;
 private slots:
     void search( const QString& );
+
+    friend class    Singleton<PluginDialog>;
 };
 
 class PluginTreeItem : public QTreeWidgetItem
index bd10c00..1ec44d2 100644 (file)
 
 #include "podcast_configuration.hpp"
 
-PodcastConfigDialog *PodcastConfigDialog::instance = NULL;
-
-PodcastConfigDialog::PodcastConfigDialog( QWidget *parent, intf_thread_t *_p_intf)
-                    : QVLCDialog( parent, _p_intf )
+PodcastConfigDialog::PodcastConfigDialog( intf_thread_t *_p_intf)
+                    : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
 
 {
     ui.setupUi( this );
index 2779c56..b653cf8 100644 (file)
 
 #include "util/qvlcframe.hpp"
 #include "ui/podcast_configuration.h"
+#include "util/singleton.hpp"
 
-class PodcastConfigDialog : public QVLCDialog
+class PodcastConfigDialog : public QVLCDialog, public Singleton<PodcastConfigDialog>
 {
     Q_OBJECT;
-public:
-    static PodcastConfigDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance )
-            instance = new PodcastConfigDialog( (QWidget *)p_intf->p_sys->p_mi,
-                                                p_intf );
-        return instance;
-    }
-    virtual ~PodcastConfigDialog();
 
 private:
-    PodcastConfigDialog( QWidget *, intf_thread_t * );
-    static PodcastConfigDialog *instance;
+    PodcastConfigDialog( intf_thread_t * );
+    virtual ~PodcastConfigDialog();
+
     Ui::PodcastConfiguration ui;
 public slots:
     void accept();
     void add();
     void remove();
+
+    friend class    Singleton<PodcastConfigDialog>;
 };
 
 #endif
index c0734d7..ef02c6c 100644 (file)
@@ -55,9 +55,7 @@
 #include <QFileDialog>
 
 
-VLMDialog *VLMDialog::instance = NULL;
-
-VLMDialog::VLMDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( parent, _p_intf )
+VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
 {
     p_vlm = vlm_New( p_intf );
 
index 3a13b7a..ed68e58 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "ui/vlm.h"
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
 #include <QDateTime>
 
 enum{
@@ -67,24 +68,19 @@ class VLMAWidget;
 class VLMWrapper;
 
 
-class VLMDialog : public QVLCDialog
+class VLMDialog : public QVLCDialog, public Singleton<VLMDialog>
 {
     Q_OBJECT;
+
 public:
-    static VLMDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-             instance = new VLMDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
-        return instance;
-    };
-    virtual ~VLMDialog();
     void toggleVisible();
 
     VLMWrapper *vlmWrapper;
     vlm_t *p_vlm;
 private:
-    VLMDialog( QWidget *, intf_thread_t * );
-    static VLMDialog *instance;
+    VLMDialog( intf_thread_t * );
+    virtual ~VLMDialog();
+
     Ui::Vlm ui;
 
     QList<VLMAWidget *> vlmItems;
@@ -111,6 +107,8 @@ private slots:
     void selectOutput();
     bool exportVLMConf();
     bool importVLMConf();
+
+    friend class    Singleton<VLMDialog>;
 };
 
 class VLMWrapper
index b710eed..29177ce 100644 (file)
@@ -53,6 +53,7 @@
 #include "dialogs/toolbar.hpp"
 #include "dialogs/plugins.hpp"
 #include "dialogs/external.hpp"
+#include "dialogs/errors.hpp"
 
 #include <QEvent>
 #include <QApplication>
@@ -452,8 +453,7 @@ void DialogsProvider::simpleMLAppendDialog()
  **/
 void DialogsProvider::openUrlDialog()
 {
-    OpenUrlDialog *oud = OpenUrlDialog::getInstance( p_intf->p_sys->p_mi,
-                                                     p_intf );
+    OpenUrlDialog *oud = OpenUrlDialog::getInstance( p_intf );
     if( oud->exec() == QDialog::Accepted )
     {
         QString url = oud->url();