[vlc-devel] commit: Qt: remove dead code in sout to simplify. (Jean-Baptiste Kempf )

git version control git at videolan.org
Tue Mar 3 15:45:49 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Mar  3 15:31:07 2009 +0100| [3eb4455acbc5b478c550d46d6d39c179b2ec3755] | committer: Jean-Baptiste Kempf 

Qt: remove dead code in sout to simplify.

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

 modules/gui/qt4/dialogs/sout.cpp     |   36 +--------------------------------
 modules/gui/qt4/dialogs/sout.hpp     |   12 ++--------
 modules/gui/qt4/dialogs/vlm.cpp      |    2 +-
 modules/gui/qt4/dialogs_provider.cpp |    2 +-
 4 files changed, 7 insertions(+), 45 deletions(-)

diff --git a/modules/gui/qt4/dialogs/sout.cpp b/modules/gui/qt4/dialogs/sout.cpp
index eeb71ed..909cd84 100644
--- a/modules/gui/qt4/dialogs/sout.cpp
+++ b/modules/gui/qt4/dialogs/sout.cpp
@@ -88,13 +88,11 @@ struct sout_gui_descr_t
 
 SoutDialog* SoutDialog::instance = NULL;
 
-SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
-                     bool _transcode_only ) : QVLCDialog( parent,  _p_intf )
+SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf )
+           : QVLCDialog( parent,  _p_intf )
 {
     setWindowTitle( qtr( "Stream Output" ) );
 
-    b_transcode_only = _transcode_only;
-
     /* UI stuff */
     ui.setupUi( this );
 
@@ -152,7 +150,6 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
     CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );
     CONNECT( ui.RTPOutput, clicked(bool), this, RTPtoggled( bool ) );
 
-    if( b_transcode_only ) toggleSout();
 }
 
 void SoutDialog::fileBrowse()
@@ -223,35 +220,6 @@ void SoutDialog::setOptions()
     updateMRL();
 }
 
-void SoutDialog::toggleSout()
-{
-    //Toggle all the streaming options.
-#define HIDEORSHOW(x) if( b_transcode_only ) x->hide(); else x->show();
-    HIDEORSHOW( ui.HTTPOutput ) ; HIDEORSHOW( ui.RTPOutput ) ; HIDEORSHOW( ui.MMSHOutput ) ; HIDEORSHOW( ui.UDPOutput ) ;
-    HIDEORSHOW( ui.HTTPEdit ) ; HIDEORSHOW( ui.RTPEdit ) ; HIDEORSHOW( ui.MMSHEdit ) ; HIDEORSHOW( ui.UDPEdit ) ;
-    HIDEORSHOW( ui.HTTPLabel ) ; HIDEORSHOW( ui.RTPLabel ) ; HIDEORSHOW( ui.MMSHLabel ) ; HIDEORSHOW( ui.UDPLabel ) ;
-    HIDEORSHOW( ui.HTTPPortLabel ) ; HIDEORSHOW( ui.RTPPortLabel ) ; HIDEORSHOW( ui.MMSHPortLabel ) ; HIDEORSHOW( ui.UDPPortLabel )
-    HIDEORSHOW( ui.HTTPPort ) ; HIDEORSHOW( ui.RTPPort ) ; HIDEORSHOW( ui.MMSHPort ) ; HIDEORSHOW( ui.UDPPort ) ; HIDEORSHOW( ui.RTPPortLabel2 ); HIDEORSHOW( ui.RTPPort2 ); HIDEORSHOW( ui.UDPRTPLabel )
-
-    HIDEORSHOW( ui.sap ); HIDEORSHOW( ui.sapName );
-    HIDEORSHOW( ui.sapGroup ); HIDEORSHOW( ui.sapGroupLabel );
-    HIDEORSHOW( ui.ttlLabel ); HIDEORSHOW( ui.ttl );
-    HIDEORSHOW( ui.soutKeep );
-
-    HIDEORSHOW( ui.IcecastOutput ); HIDEORSHOW( ui.IcecastEdit );
-    HIDEORSHOW( ui.IcecastNamePassEdit ); HIDEORSHOW( ui.IcecastMountpointEdit );
-    HIDEORSHOW( ui.IcecastPort ); HIDEORSHOW( ui.IcecastLabel );
-    HIDEORSHOW( ui.IcecastPortLabel );
-    HIDEORSHOW( ui.IcecastMountpointLabel ); HIDEORSHOW( ui.IcecastNameLabel );
-#undef HIDEORSHOW
-
-    if( b_transcode_only ) okButton->setText( "&Save" );
-    else okButton->setText( "&Stream" );
-
-    setMinimumHeight( 500 );
-    resize( width(), sizeHint().height() );
-}
-
 void SoutDialog::changeUDPandRTPmess( bool b_udp )
 {
     ui.RTPEdit->setVisible( !b_udp );
diff --git a/modules/gui/qt4/dialogs/sout.hpp b/modules/gui/qt4/dialogs/sout.hpp
index 1518c55..2be9cf3 100644
--- a/modules/gui/qt4/dialogs/sout.hpp
+++ b/modules/gui/qt4/dialogs/sout.hpp
@@ -112,17 +112,14 @@ class SoutDialog : public QVLCDialog
 {
     Q_OBJECT;
 public:
-    static SoutDialog* getInstance( QWidget *parent, intf_thread_t *p_intf,
-                                    bool transcode_only )
+    static SoutDialog* getInstance( QWidget *parent, intf_thread_t *p_intf )
     {
         if( !instance )
-            instance = new SoutDialog( parent, p_intf, transcode_only );
+            instance = new SoutDialog( parent, p_intf );
         else
         {
             /* Recenter the dialog on the parent */
             instance->setParent( parent, Qt::Dialog );
-            instance->b_transcode_only = transcode_only;
-            instance->toggleSout();
         }
         return instance;
     }
@@ -134,11 +131,9 @@ public:
 private:
     Ui::Sout ui;
     static SoutDialog *instance;
-    SoutDialog( QWidget* parent, intf_thread_t *,
-                bool _transcode_only = false );
+    SoutDialog( QWidget* parent, intf_thread_t * );
     QPushButton *okButton;
     QString mrl;
-    bool b_transcode_only;
 
 public slots:
     void updateMRL();
@@ -146,7 +141,6 @@ public slots:
 private slots:
     void ok();
     void cancel();
-    void toggleSout();
     void setOptions();
     void fileBrowse();
     void setRawOptions( bool );
diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp
index e9aa171..841ef7d 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, false );
+    SoutDialog *s = SoutDialog::getInstance( 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 0cec713..a2ef3b4 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -570,7 +570,7 @@ void DialogsProvider::streamingDialog( QWidget *parent, QString mrl,
     const char *psz_option;
     if( !b_transcode_only )
     {
-        SoutDialog *s = SoutDialog::getInstance( parent, p_intf, b_transcode_only );
+        SoutDialog *s = SoutDialog::getInstance( parent, p_intf );
         if( s->exec() == QDialog::Accepted )
             psz_option = qtu( s->getMrl() );
     }else {




More information about the vlc-devel mailing list