]> git.sesse.net Git - vlc/commitdiff
qt4: use const for QString when possible.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 26 Mar 2009 12:20:57 +0000 (13:20 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 26 Mar 2009 14:37:08 +0000 (15:37 +0100)
17 files changed:
modules/gui/qt4/components/info_panels.cpp
modules/gui/qt4/components/info_panels.hpp
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/dialogs/convert.cpp
modules/gui/qt4/dialogs/convert.hpp
modules/gui/qt4/dialogs/errors.cpp
modules/gui/qt4/dialogs/errors.hpp
modules/gui/qt4/dialogs/mediainfo.cpp
modules/gui/qt4/dialogs/open.cpp
modules/gui/qt4/dialogs/open.hpp
modules/gui/qt4/dialogs/plugins.cpp
modules/gui/qt4/dialogs/plugins.hpp
modules/gui/qt4/dialogs/sout.cpp
modules/gui/qt4/dialogs/sout.hpp
modules/gui/qt4/dialogs/toolbar.cpp
modules/gui/qt4/dialogs/toolbar.hpp

index 4b82ed4e2e83916cc9222bbd2c5273000bb6ec27..90e14410bbd0f0593c74b95e1517a632b4b7c10f 100644 (file)
@@ -197,13 +197,13 @@ void MetaPanel::update( input_item_t *p_item )
     /* URL / URI */
     psz_meta = input_item_GetURL( p_item );
     if( !EMPTY_STR( psz_meta ) )
-        emit uriSet( QString( psz_meta ) );
+        emit uriSet( psz_meta );
     else
     {
         free( psz_meta );
         psz_meta = input_item_GetURI( p_item );
         if( !EMPTY_STR( psz_meta ) )
-            emit uriSet( QString( psz_meta ) );
+            emit uriSet( psz_meta );
     }
     free( psz_meta );
 
index 5f3be525ee062c4ab622abfd72163377b71ed3cf..f5d8de8ede673319468ef321d5f9977779ce3b72 100644 (file)
@@ -89,7 +89,7 @@ private slots:
     void enterEditMode();
 
 signals:
-    void uriSet( QString );
+    void uriSet( const QString& );
     void editing();
 };
 
index dca2b0c95c6701f8031b0669f82f2e0d08bb2f0c..6a995efa2ee5a701d812f25cb0b80f7a24ef68c0 100644 (file)
@@ -185,7 +185,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
     backgroundLayout->setColumnStretch( 2, 1 );
 
     CONNECT( THEMIM->getIM(), artChanged( QString ),
-             this, updateArt( QString ) );
+             this, updateArt( const QString& ) );
 }
 
 BackgroundWidget::~BackgroundWidget()
@@ -199,7 +199,7 @@ void BackgroundWidget::resizeEvent( QResizeEvent * event )
         label->show();
 }
 
-void BackgroundWidget::updateArt( QString url )
+void BackgroundWidget::updateArt( const QString& url )
 {
     if( url.isEmpty() )
     {
@@ -409,7 +409,7 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
     setContextMenuPolicy( Qt::ActionsContextMenu );
     CONNECT( this, updateRequested(), this, doUpdate() );
     CONNECT( THEMIM->getIM(), artChanged( QString ),
-             this, doUpdate( QString ) );
+             this, doUpdate( const QString& ) );
 
     setMinimumHeight( 128 );
     setMinimumWidth( 128 );
@@ -431,7 +431,7 @@ CoverArtLabel::~CoverArtLabel()
         removeAction( act );
 }
 
-void CoverArtLabel::doUpdate( QString url )
+void CoverArtLabel::doUpdate( const QString& url )
 {
     QPixmap pix;
     if( !url.isEmpty()  && pix.load( url ) )
index 77f23262ca8aae59a6a7f6e82f3671cc24be55a3..bec4d4badb20700e7a73091c3976be5de3d34922 100644 (file)
@@ -102,7 +102,7 @@ private:
 
 public slots:
     void toggle(){ TOGGLEV( this ); }
-    void updateArt( QString );
+    void updateArt( const QString& );
 };
 
 #if 0
@@ -208,7 +208,7 @@ public slots:
 
 private slots:
     void doUpdate();
-    void doUpdate(QString);
+    void doUpdate( const QString& );
 
 signals:
     void updateRequested();
index bad51814bb141a5021e01af423061e9688daa4e7..0e71944d3e702cd73fbfd0b8cbd1bfe43403165a 100644 (file)
@@ -38,7 +38,7 @@
 #include <QCheckBox>
 
 ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
-                              QString inputMRL )
+                              const QString& inputMRL )
               : QVLCDialog( parent, _p_intf )
 {
     setWindowTitle( qtr( "Convert" ) );
index 112c87738f59b299f4abdda8bb257b2b48efab3a..227aba20565d381150aa07315dd6a6fad7ac7e82 100644 (file)
@@ -34,7 +34,7 @@ class ConvertDialog : public QVLCDialog
 {
     Q_OBJECT;
 public:
-    ConvertDialog( QWidget *, intf_thread_t *, QString );
+    ConvertDialog( QWidget *, intf_thread_t *, const QString& );
     virtual ~ConvertDialog(){}
 
     QString getMrl() {return mrl;}
index b49a097a7ef57b90db50a78efbf5d7271b7a69b1..b1f2fd14dec585b89681875252de2e7b46d8e148 100644 (file)
@@ -67,7 +67,7 @@ ErrorsDialog::ErrorsDialog( QWidget *parent, intf_thread_t *_p_intf )
     BUTTONACT( stopShowing, dontShow() );
 }
 
-void ErrorsDialog::addError( QString title, QString text )
+void ErrorsDialog::addError( const QString& title, const QString& text )
 {
     add( true, title, text );
 }
@@ -77,7 +77,7 @@ void ErrorsDialog::addError( QString title, QString text )
     add( false, title, text );
 }*/
 
-void ErrorsDialog::add( bool error, QString title, QString text )
+void ErrorsDialog::add( bool error, const QString& title, const QString& text )
 {
     if( stopShowing->isChecked() ) return;
     messages->textCursor().movePosition( QTextCursor::End );
index 559094e7a0da6d5564cea625c8bc0a423bcfc023..dde9f056d641c84742830eb6b8dff063a43cd3e7 100644 (file)
@@ -43,12 +43,12 @@ public:
     }
     virtual ~ErrorsDialog() {};
 
-    void addError( QString, QString );
+    void addError( const QString&, const QString& );
     /*void addWarning( QString, QString );*/
 private:
     ErrorsDialog( QWidget *parent, intf_thread_t * );
     static ErrorsDialog *instance;
-    void add( bool, QString, QString );
+    void add( bool, const QString&, const QString& );
 
     QCheckBox *stopShowing;
     QTextEdit *messages;
index 5053b9d0d23dc4eedbaf44eb41bc2a30ea669031..41a5ef34050cd8250814f045e798cbebd65e2664 100644 (file)
@@ -87,7 +87,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
     BUTTONACT( saveMetaButton, saveMeta() );
 
     /* Let the MetaData Panel update the URI */
-    CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
+    CONNECT( MP, uriSet( const QString& ), uriLine, setText( const QString& ) );
     CONNECT( MP, editing(), saveMetaButton, show() );
 
     /* Display the buttonBar according to the Tab selected */
index db1e67f67996f1a634c892c7619a5a5b20fafc5a..e6a996224b8656c990875e806fbc18bc90ec2fc4 100644 (file)
@@ -143,22 +143,22 @@ OpenDialog::OpenDialog( QWidget *parent,
     CONNECT( ui.Tab, currentChanged( int ), this, signalCurrent( int ) );
 
     CONNECT( fileOpenPanel, mrlUpdated( QStringList, QString ),
-             this, updateMRL( QStringList, QString ) );
+             this, updateMRL( const QStringList&, const QString& ) );
     CONNECT( netOpenPanel, mrlUpdated( QStringList, QString ),
-             this, updateMRL( QStringList, QString ) );
+             this, updateMRL( const QStringList&, const QString& ) );
     CONNECT( discOpenPanel, mrlUpdated( QStringList, QString ),
-             this, updateMRL( QStringList, QString ) );
+             this, updateMRL( const QStringList&, const QString& ) );
     CONNECT( captureOpenPanel, mrlUpdated( QStringList, QString ),
-             this, updateMRL( QStringList, QString ) );
+             this, updateMRL( const QStringList&, const QString& ) );
 
     CONNECT( fileOpenPanel, methodChanged( QString ),
-             this, newCachingMethod( QString ) );
+             this, newCachingMethod( const QString& ) );
     CONNECT( netOpenPanel, methodChanged( QString ),
-             this, newCachingMethod( QString ) );
+             this, newCachingMethod( const QString& ) );
     CONNECT( discOpenPanel, methodChanged( QString ),
-             this, newCachingMethod( QString ) );
+             this, newCachingMethod( const QString& ) );
     CONNECT( captureOpenPanel, methodChanged( QString ),
-             this, newCachingMethod( QString ) );
+             this, newCachingMethod( const QString& ) );
 
     /* Advanced frame Connects */
     CONNECT( ui.slaveCheckbox, toggled( bool ), this, updateMRL() );
@@ -400,7 +400,7 @@ void OpenDialog::stream( bool b_transcode_only )
 }
 
 /* Update the MRL */
-void OpenDialog::updateMRL( QStringList item, QString tempMRL )
+void OpenDialog::updateMRL( const QStringList& item, const QString& tempMRL )
 {
     optionsMRL = tempMRL;
     itemsMRL = item;
@@ -425,7 +425,7 @@ void OpenDialog::updateMRL() {
     ui.mrlLine->setText( itemsMRL.join( " " ) );
 }
 
-void OpenDialog::newCachingMethod( QString method )
+void OpenDialog::newCachingMethod( const QString& method )
 {
     if( method != storedMethod ) {
         storedMethod = method;
@@ -434,7 +434,7 @@ void OpenDialog::newCachingMethod( QString method )
     }
 }
 
-QStringList OpenDialog::SeparateEntries( QString entries )
+QStringList OpenDialog::SeparateEntries( const QString& entries )
 {
     bool b_quotes_mode = false;
 
index bdaaa3380b1919542e62f8255888145af0bd9050..7ba13fc6fd93360b2486657d300824c6f3118a2c 100644 (file)
@@ -98,7 +98,7 @@ private:
 
     int i_action_flag;
     bool b_pl;
-    QStringList SeparateEntries( QString );
+    QStringList SeparateEntries( const QString& );
 
     QPushButton *cancelButton, *selectButton;
     QPushButton *playButton;
@@ -110,9 +110,9 @@ private slots:
     void cancel();
     void close();
     void toggleAdvancedPanel();
-    void updateMRL( QStringList, QString );
+    void updateMRL( const QStringList&, const QString& );
     void updateMRL();
-    void newCachingMethod( QString );
+    void newCachingMethod( const QString& );
     void signalCurrent( int );
     void browseInputSlave();
 };
index ee8d52bcae1c099cb4e9dec119a32ced50ce816a..3374028a5390789dc8bd9713185190c85bee2949 100644 (file)
@@ -77,7 +77,7 @@ PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
     layout->addWidget( label, 1, 0 );
     layout->addWidget( edit, 1, 1, 1, -1 );
     CONNECT( edit, textChanged( QString ),
-            this, search( QString ) );
+            this, search( const QString& ) );
 
     QDialogButtonBox *box = new QDialogButtonBox;
     QPushButton *okButton = new QPushButton( qtr( "&Close" ), this );
@@ -110,7 +110,7 @@ inline void PluginDialog::FillTree()
     }
 }
 
-void PluginDialog::search( const QString qs )
+void PluginDialog::search( const QString& qs )
 {
     QList<QTreeWidgetItem *> items = treePlugins->findItems( qs, Qt::MatchContains );
     items += treePlugins->findItems( qs, Qt::MatchContains, 1 );
index f862703fae37006e51aad387d7c292d47b3dfcfe..798f01f61750edde1314387700f0a0a7fe881edf 100644 (file)
@@ -42,7 +42,7 @@ private:
     QTreeWidget *treePlugins;
     SearchLineEdit *edit;
 private slots:
-    void search( const QString );
+    void search( const QString& );
 };
 
 #endif
index d900e771c046cac79b19ed4750d6746efea452d0..361a6c0191000e2d2900cbd3238b49edc0c1f51c 100644 (file)
@@ -35,7 +35,7 @@
 #include <QFileDialog>
 #include <QToolButton>
 
-SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, QString inputMRL )
+SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL )
            : QVLCDialog( parent,  _p_intf )
 {
     setWindowTitle( qtr( "Stream Output" ) );
index 1bee5111d435e059a6cd4a3071f763414f13e8b0..220333650ae062e7fe493bed2785764b1557cc9f 100644 (file)
@@ -113,7 +113,7 @@ class SoutDialog : public QVLCDialog
 {
     Q_OBJECT;
 public:
-    SoutDialog( QWidget* parent, intf_thread_t *, QString mrl = "");
+    SoutDialog( QWidget* parent, intf_thread_t *, const QString& mrl = "");
     virtual ~SoutDialog(){}
 
     QString getMrl(){ return mrl; }
index f002cabbf05488fa3fdfd20becd72d53012f79f1..8cebadf9cadd6bf7a05821a0646be5712d0027d8 100644 (file)
@@ -461,7 +461,7 @@ void WidgetListing::startDrag( Qt::DropActions /*supportedActions*/ )
  * to propagate there too
  */
 DroppingController::DroppingController( intf_thread_t *_p_intf,
-                                        QString line,
+                                        const QString& line,
                                         QWidget *_parent )
                    : AbstractController( _p_intf, _parent )
 {
@@ -477,7 +477,7 @@ DroppingController::DroppingController( intf_thread_t *_p_intf,
     parseAndCreate( line, controlLayout );
 }
 
-void DroppingController::resetLine( QString line )
+void DroppingController::resetLine( const QString& line )
 {
     hide();
     QLayoutItem *child;
index 3fbb82f189be32bb8dfd84286e53f92f7fcf800e..2d29b6f61dc92b5e10247bd714af3b3e7999dc31 100644 (file)
@@ -98,11 +98,11 @@ class DroppingController: public AbstractController
 {
     Q_OBJECT;
 public:
-    DroppingController( intf_thread_t *, QString line, QWidget *parent = 0 );
+    DroppingController( intf_thread_t *, const QString& line, QWidget *parent = 0 );
     QString getValue();
     virtual ~DroppingController();
 
-    void resetLine( QString );
+    void resetLine( const QString& );
 protected:
     virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
             buttonType_e i_type, int i_option );