]> git.sesse.net Git - vlc/commitdiff
qt4: use const for QString when it's possible.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 26 Mar 2009 11:47:07 +0000 (12:47 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 26 Mar 2009 12:12:12 +0000 (13:12 +0100)
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.hpp
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/sout/profile_selector.cpp
modules/gui/qt4/components/sout/profile_selector.hpp
modules/gui/qt4/components/sout/sout_widgets.cpp
modules/gui/qt4/components/sout/sout_widgets.hpp

index 319f169e7a4a80c43762af1c03c5e3221e516b73..f3e102ccbc4cd376113c4f970427b117919c8d40 100644 (file)
@@ -99,7 +99,7 @@ void AbstractController::setupButton( QAbstractButton *aButton )
 
 /* Open the generic config line for the toolbar, parse it
  * and create the widgets accordingly */
-void AbstractController::parseAndCreate( QString config,
+void AbstractController::parseAndCreate( const QString& config,
                                          QBoxLayout *controlLayout )
 {
     QStringList list = config.split( ";", QString::SkipEmptyParts ) ;
index 508b14d49efeefcfe3d663c7a7f020806cac596b..39c07ef240408c1ce6c65053c197d2054ec074f4 100644 (file)
@@ -143,7 +143,7 @@ protected:
 
     AdvControlsWidget   *advControls;
 
-    void parseAndCreate( QString config, QBoxLayout *controlLayout );
+    void parseAndCreate( const QString& config, QBoxLayout *controlLayout );
 
     virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
                                      buttonType_e i_type, int i_option );
index dc68a2344b446eb5f22f42ed510fe0f46113b799..c5de69acb060e5257c5d8059cb4406388ab99a33 100644 (file)
@@ -402,7 +402,7 @@ QStringList PLModel::selectedURIs()
                 char *psz = input_item_GetURI( p_item->p_input );
                 if( psz )
                 {
-                    lst.append( QString( psz ) );
+                    lst.append( psz );
                     free( psz );
                 }
             }
@@ -763,7 +763,7 @@ next:
     rebuild();
 }
 
-void PLModel::search( QString search_text )
+void PLModel::search( const QString& search_text )
 {
     /** \todo Fire the search with a small delay ? */
     PL_LOCK;
@@ -771,7 +771,7 @@ void PLModel::search( QString search_text )
         playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
                                                         rootItem->i_id );
         assert( p_root );
-        char *psz_name = search_text.toUtf8().data();
+        const char *psz_name = search_text.toUtf8().data();
         playlist_LiveSearchUpdate( p_playlist , p_root, psz_name );
     }
     PL_UNLOCK;
index 39af4c8896270489db03f0690ed3b167530714a5..6e55161baf9164fb91ed7c27cfeb4e3629c1bf51 100644 (file)
@@ -113,7 +113,7 @@ public:
     /* Actions made by the views */
     void popup( QModelIndex & index, QPoint &point, QModelIndexList list );
     void doDelete( QModelIndexList selected );
-    void search( QString search );
+    void search( const QString& search_text );
     void sort( int column, Qt::SortOrder order );
     void removeItem( int );
 
index fdf2653adab1b15bbe79e2fd278a8f2834b0add1..ebd01d00d446c807465d00006d64d976635ef4dd 100644 (file)
@@ -1311,7 +1311,7 @@ void KeySelectorControl::doApply()
 }
 
 KeyInputDialog::KeyInputDialog( QTreeWidget *_table,
-                                QString keyToChange,
+                                const QString& keyToChange,
                                 QWidget *_parent ) :
                                 QDialog( _parent ), keyValue(0)
 {
index 90cb3fccb7625a20acce0b9ac33cdb43b23393ea..05a27c5d94b4473fb410612fc2b9dadd394c4578 100644 (file)
@@ -460,7 +460,7 @@ private slots:
 class KeyInputDialog : public QDialog
 {
 public:
-    KeyInputDialog( QTreeWidget *, QString, QWidget * );
+    KeyInputDialog( QTreeWidget *, const QString&, QWidget * );
     int keyValue;
     bool conflicts;
 private:
index 769609038f0a5495e6e4f06c9f66d4634ea20a33..7b1f41641a9747bdfff1b942237f615997f35a1a 100644 (file)
@@ -109,7 +109,7 @@ void VLCProfileSelector::editProfile()
                  profileBox->itemData( profileBox->currentIndex() ).toString() );
 }
 
-void VLCProfileSelector::editProfile( QString qs, QString value )
+void VLCProfileSelector::editProfile( const QString& qs, const QString& value )
 {
     VLCProfileEditor *editor = new VLCProfileEditor( qs, value, this );
 
@@ -212,7 +212,7 @@ void VLCProfileSelector::updateOptions( int i )
 /**
  * VLCProfileEditor
  **/
-VLCProfileEditor::VLCProfileEditor( QString qs_name, QString value,
+VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value,
         QWidget *_parent )
                  : QVLCDialog( _parent, NULL )
 {
@@ -293,7 +293,7 @@ inline void VLCProfileEditor::registerCodecs()
     ADD_SCODEC( "T.140", "t140" )
 }
 
-void VLCProfileEditor::fillProfile( QString qs )
+void VLCProfileEditor::fillProfile( const QString& qs )
 {
     QStringList options = qs.split( ";" );
     if( options.size() < 16 )
index e8b4364b5ccd89d57e6762dbbe7e06f399081abc..65ff9739682502ac4df066d714f94c5b9f3d8c54 100644 (file)
@@ -43,7 +43,7 @@ public:
 private:
     QComboBox *profileBox;
     void fillProfilesCombo();
-    void editProfile( QString, QString );
+    void editProfile( const QString&, const QString& );
     void saveProfiles();
     QString mux;
     QString transcode;
@@ -62,14 +62,14 @@ class VLCProfileEditor : public QVLCDialog
 
     Ui::Profiles ui;
 public:
-    VLCProfileEditor( QString, QString, QWidget * );
+    VLCProfileEditor( const QString&, const QString&, QWidget * );
 
     QString name;
     QString muxValue;
     QString transcodeValue();
 private:
     void registerCodecs();
-    void fillProfile( QString qs );
+    void fillProfile( const QString& qs );
 protected slots:
     virtual void close();
 private slots:
index 6d089fe095c5cf6e91a7078d588d4b21d278bc2a..b7854970bef45cb0554039d2aa7d4d5847c3f94f 100644 (file)
@@ -34,7 +34,7 @@
 #include <QLineEdit>
 #include <QFileDialog>
 
-SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent )
+SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox( _parent )
 {
     /**
      * Source Block
@@ -62,7 +62,7 @@ SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent
     sourceLayout->addWidget( line, 2, 0, 1, -1 );
 }
 
-void SoutInputBox::setMRL( QString mrl )
+void SoutInputBox::setMRL( const QString& mrl )
 {
     sourceLine->setText( mrl );
     QString type;
@@ -104,7 +104,7 @@ FileDestBox::FileDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
     BUTTONACT( fileSelectButton, fileBrowse() );
 }
 
-QString FileDestBox::getMRL( QString mux )
+QString FileDestBox::getMRL( const QString& mux )
 {
     if( fileEdit->text().isEmpty() ) return "";
 
@@ -158,7 +158,7 @@ HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
     CT( HTTPEdit );
 }
 
-QString HTTPDestBox::getMRL( QString mux )
+QString HTTPDestBox::getMRL( const QString& mux )
 {
     if( HTTPEdit->text().isEmpty() ) return "";
 
@@ -202,7 +202,7 @@ MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
     CT( MMSHEdit );
 }
 
-QString MMSHDestBox::getMRL( QString mux )
+QString MMSHDestBox::getMRL( const QString& mux )
 {
     if( MMSHEdit->text().isEmpty() ) return "";
 
@@ -246,7 +246,7 @@ UDPDestBox::UDPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
     CT( UDPEdit );
 }
 
-QString UDPDestBox::getMRL( QString mux )
+QString UDPDestBox::getMRL( const QString& mux )
 {
     if( UDPEdit->text().isEmpty() ) return "";
 
@@ -317,7 +317,7 @@ RTPDestBox::RTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
     CT( RTPEdit );
 }
 
-QString RTPDestBox::getMRL( QString mux )
+QString RTPDestBox::getMRL( const QString& mux )
 {
     if( RTPEdit->text().isEmpty() ) return "";
 
@@ -380,7 +380,7 @@ ICEDestBox::ICEDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
     CT( ICEPassEdit );
 }
 
-QString ICEDestBox::getMRL( QString mux )
+QString ICEDestBox::getMRL( const QString& mux )
 {
     if( ICEEdit->text().isEmpty() ) return "";
 
index 83d8e28100a845ea4c523e53e5bc293f793c5654..ff2038f2b20fe53fae0678b1ca963ce3f35b8fee 100644 (file)
@@ -35,9 +35,9 @@ class QSpinBox;
 class SoutInputBox : public QGroupBox
 {
     public:
-        SoutInputBox( QWidget *_parent = NULL, QString mrl = "" );
+        SoutInputBox( QWidget *_parent = NULL, const QString& mrl = "" );
 
-        void setMRL( QString );
+        void setMRL( const QString& );
     private:
         QLineEdit *sourceLine;
         QLabel *sourceValueLabel;
@@ -49,7 +49,7 @@ class VirtualDestBox : public QWidget
     Q_OBJECT;
     public:
         VirtualDestBox( QWidget *_parent = NULL ) : QWidget( _parent ){}
-        virtual QString getMRL( QString ) = 0;
+        virtual QString getMRL( const QString& ) = 0;
     protected:
         QString mrl;
     signals:
@@ -61,7 +61,7 @@ class FileDestBox: public VirtualDestBox
     Q_OBJECT;
     public:
         FileDestBox( QWidget *_parent = NULL );
-        virtual QString getMRL( QString );
+        virtual QString getMRL( const QString& );
     private:
         QLineEdit *fileEdit;
     private slots:
@@ -73,7 +73,7 @@ class HTTPDestBox: public VirtualDestBox
     Q_OBJECT;
     public:
         HTTPDestBox( QWidget *_parent = NULL );
-        virtual QString getMRL( QString );
+        virtual QString getMRL( const QString& );
     private:
         QLineEdit *HTTPEdit;
         QSpinBox *HTTPPort;
@@ -84,7 +84,7 @@ class MMSHDestBox: public VirtualDestBox
     Q_OBJECT;
     public:
         MMSHDestBox( QWidget *_parent = NULL );
-        virtual QString getMRL( QString );
+        virtual QString getMRL( const QString& );
     private:
         QLineEdit *MMSHEdit;
         QSpinBox *MMSHPort;
@@ -95,7 +95,7 @@ class UDPDestBox: public VirtualDestBox
     Q_OBJECT;
     public:
         UDPDestBox( QWidget *_parent = NULL );
-        virtual QString getMRL( QString );
+        virtual QString getMRL( const QString& );
     private:
         QLineEdit *UDPEdit;
         QSpinBox *UDPPort;
@@ -106,7 +106,7 @@ class RTPDestBox: public VirtualDestBox
     Q_OBJECT;
     public:
         RTPDestBox( QWidget *_parent = NULL );
-        virtual QString getMRL( QString );
+        virtual QString getMRL( const QString& );
     private:
         QLineEdit *RTPEdit;
         QSpinBox *RTPPort;
@@ -119,7 +119,7 @@ class ICEDestBox: public VirtualDestBox
     Q_OBJECT;
     public:
         ICEDestBox( QWidget *_parent = NULL );
-        virtual QString getMRL( QString );
+        virtual QString getMRL( const QString& );
     private:
         QLineEdit *ICEEdit;
         QLineEdit *ICEMountEdit;