[vlc-devel] commit: Qt: move Sout Dialog out of singleton. (Jean-Baptiste Kempf )

git version control git at videolan.org
Sun Mar 15 02:47:48 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Mar 15 02:47:21 2009 +0100| [6e6dd55056a0cc3bae93ed96eb3022d733786528] | committer: Jean-Baptiste Kempf 

Qt: move Sout Dialog out of singleton.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6e6dd55056a0cc3bae93ed96eb3022d733786528
---

 modules/gui/qt4/dialogs/sout.cpp     |    2 --
 modules/gui/qt4/dialogs/sout.hpp     |   16 +---------------
 modules/gui/qt4/dialogs/vlm.cpp      |    2 +-
 modules/gui/qt4/dialogs_provider.cpp |    2 +-
 4 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/modules/gui/qt4/dialogs/sout.cpp b/modules/gui/qt4/dialogs/sout.cpp
index d41402b..ad41a9b 100644
--- a/modules/gui/qt4/dialogs/sout.cpp
+++ b/modules/gui/qt4/dialogs/sout.cpp
@@ -35,8 +35,6 @@
 #include <QFileDialog>
 #include <QToolButton>
 
-SoutDialog* SoutDialog::instance = NULL;
-
 SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, QString inputMRL )
            : QVLCDialog( parent,  _p_intf )
 {
diff --git a/modules/gui/qt4/dialogs/sout.hpp b/modules/gui/qt4/dialogs/sout.hpp
index 1aade29..1bee511 100644
--- a/modules/gui/qt4/dialogs/sout.hpp
+++ b/modules/gui/qt4/dialogs/sout.hpp
@@ -113,27 +113,13 @@ class SoutDialog : public QVLCDialog
 {
     Q_OBJECT;
 public:
-    static SoutDialog* getInstance( QWidget *parent, intf_thread_t *p_intf,
-                                    QString mrl = "" )
-    {
-        if( !instance )
-            instance = new SoutDialog( parent, p_intf, mrl );
-        else
-        {
-            /* Recenter the dialog on the parent */
-            instance->setParent( parent, Qt::Dialog );
-        }
-        return instance;
-    }
-
+    SoutDialog( QWidget* parent, intf_thread_t *, QString mrl = "");
     virtual ~SoutDialog(){}
 
     QString getMrl(){ return mrl; }
 
 private:
     Ui::Sout ui;
-    static SoutDialog *instance;
-    SoutDialog( QWidget* parent, intf_thread_t *, QString mrl );
 
     QString mrl;
     QPushButton *okButton;
diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp
index 866c5a0..1270279 100644
--- a/modules/gui/qt4/dialogs/vlm.cpp
+++ b/modules/gui/qt4/dialogs/vlm.cpp
@@ -399,7 +399,7 @@ void VLMDialog::selectInput()
 
 void VLMDialog::selectOutput()
 {
-    SoutDialog *s = SoutDialog::getInstance( this, p_intf );
+    SoutDialog *s = new SoutDialog( this, p_intf );
     if( s->exec() == QDialog::Accepted )
         ui.outputLedit->setText( s->getMrl() );
 }
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index f4390de..79ad6aa 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -576,7 +576,7 @@ void DialogsProvider::streamingDialog( QWidget *parent,
     /* Stream */
     if( !b_transcode_only )
     {
-        SoutDialog *s = SoutDialog::getInstance( parent, p_intf, mrl );
+        SoutDialog *s = new SoutDialog( parent, p_intf, mrl );
         if( s->exec() == QDialog::Accepted )
         {
             psz_soutoption = strdup( qtu( s->getMrl() ) );




More information about the vlc-devel mailing list