Commit 33179cc3 authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: use const for QString when it's possible.

parent 98f134c2
...@@ -99,7 +99,7 @@ void AbstractController::setupButton( QAbstractButton *aButton ) ...@@ -99,7 +99,7 @@ void AbstractController::setupButton( QAbstractButton *aButton )
/* Open the generic config line for the toolbar, parse it /* Open the generic config line for the toolbar, parse it
* and create the widgets accordingly */ * and create the widgets accordingly */
void AbstractController::parseAndCreate( QString config, void AbstractController::parseAndCreate( const QString& config,
QBoxLayout *controlLayout ) QBoxLayout *controlLayout )
{ {
QStringList list = config.split( ";", QString::SkipEmptyParts ) ; QStringList list = config.split( ";", QString::SkipEmptyParts ) ;
......
...@@ -143,7 +143,7 @@ protected: ...@@ -143,7 +143,7 @@ protected:
AdvControlsWidget *advControls; AdvControlsWidget *advControls;
void parseAndCreate( QString config, QBoxLayout *controlLayout ); void parseAndCreate( const QString& config, QBoxLayout *controlLayout );
virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index, virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
buttonType_e i_type, int i_option ); buttonType_e i_type, int i_option );
......
...@@ -402,7 +402,7 @@ QStringList PLModel::selectedURIs() ...@@ -402,7 +402,7 @@ QStringList PLModel::selectedURIs()
char *psz = input_item_GetURI( p_item->p_input ); char *psz = input_item_GetURI( p_item->p_input );
if( psz ) if( psz )
{ {
lst.append( QString( psz ) ); lst.append( psz );
free( psz ); free( psz );
} }
} }
...@@ -763,7 +763,7 @@ next: ...@@ -763,7 +763,7 @@ next:
rebuild(); rebuild();
} }
void PLModel::search( QString search_text ) void PLModel::search( const QString& search_text )
{ {
/** \todo Fire the search with a small delay ? */ /** \todo Fire the search with a small delay ? */
PL_LOCK; PL_LOCK;
...@@ -771,7 +771,7 @@ void PLModel::search( QString search_text ) ...@@ -771,7 +771,7 @@ void PLModel::search( QString search_text )
playlist_item_t *p_root = playlist_ItemGetById( p_playlist, playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
rootItem->i_id ); rootItem->i_id );
assert( p_root ); 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 ); playlist_LiveSearchUpdate( p_playlist , p_root, psz_name );
} }
PL_UNLOCK; PL_UNLOCK;
......
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
/* Actions made by the views */ /* Actions made by the views */
void popup( QModelIndex & index, QPoint &point, QModelIndexList list ); void popup( QModelIndex & index, QPoint &point, QModelIndexList list );
void doDelete( QModelIndexList selected ); void doDelete( QModelIndexList selected );
void search( QString search ); void search( const QString& search_text );
void sort( int column, Qt::SortOrder order ); void sort( int column, Qt::SortOrder order );
void removeItem( int ); void removeItem( int );
......
...@@ -1311,7 +1311,7 @@ void KeySelectorControl::doApply() ...@@ -1311,7 +1311,7 @@ void KeySelectorControl::doApply()
} }
KeyInputDialog::KeyInputDialog( QTreeWidget *_table, KeyInputDialog::KeyInputDialog( QTreeWidget *_table,
QString keyToChange, const QString& keyToChange,
QWidget *_parent ) : QWidget *_parent ) :
QDialog( _parent ), keyValue(0) QDialog( _parent ), keyValue(0)
{ {
......
...@@ -460,7 +460,7 @@ private slots: ...@@ -460,7 +460,7 @@ private slots:
class KeyInputDialog : public QDialog class KeyInputDialog : public QDialog
{ {
public: public:
KeyInputDialog( QTreeWidget *, QString, QWidget * ); KeyInputDialog( QTreeWidget *, const QString&, QWidget * );
int keyValue; int keyValue;
bool conflicts; bool conflicts;
private: private:
......
...@@ -109,7 +109,7 @@ void VLCProfileSelector::editProfile() ...@@ -109,7 +109,7 @@ void VLCProfileSelector::editProfile()
profileBox->itemData( profileBox->currentIndex() ).toString() ); 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 ); VLCProfileEditor *editor = new VLCProfileEditor( qs, value, this );
...@@ -212,7 +212,7 @@ void VLCProfileSelector::updateOptions( int i ) ...@@ -212,7 +212,7 @@ void VLCProfileSelector::updateOptions( int i )
/** /**
* VLCProfileEditor * VLCProfileEditor
**/ **/
VLCProfileEditor::VLCProfileEditor( QString qs_name, QString value, VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value,
QWidget *_parent ) QWidget *_parent )
: QVLCDialog( _parent, NULL ) : QVLCDialog( _parent, NULL )
{ {
...@@ -293,7 +293,7 @@ inline void VLCProfileEditor::registerCodecs() ...@@ -293,7 +293,7 @@ inline void VLCProfileEditor::registerCodecs()
ADD_SCODEC( "T.140", "t140" ) ADD_SCODEC( "T.140", "t140" )
} }
void VLCProfileEditor::fillProfile( QString qs ) void VLCProfileEditor::fillProfile( const QString& qs )
{ {
QStringList options = qs.split( ";" ); QStringList options = qs.split( ";" );
if( options.size() < 16 ) if( options.size() < 16 )
......
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
private: private:
QComboBox *profileBox; QComboBox *profileBox;
void fillProfilesCombo(); void fillProfilesCombo();
void editProfile( QString, QString ); void editProfile( const QString&, const QString& );
void saveProfiles(); void saveProfiles();
QString mux; QString mux;
QString transcode; QString transcode;
...@@ -62,14 +62,14 @@ class VLCProfileEditor : public QVLCDialog ...@@ -62,14 +62,14 @@ class VLCProfileEditor : public QVLCDialog
Ui::Profiles ui; Ui::Profiles ui;
public: public:
VLCProfileEditor( QString, QString, QWidget * ); VLCProfileEditor( const QString&, const QString&, QWidget * );
QString name; QString name;
QString muxValue; QString muxValue;
QString transcodeValue(); QString transcodeValue();
private: private:
void registerCodecs(); void registerCodecs();
void fillProfile( QString qs ); void fillProfile( const QString& qs );
protected slots: protected slots:
virtual void close(); virtual void close();
private slots: private slots:
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include <QLineEdit> #include <QLineEdit>
#include <QFileDialog> #include <QFileDialog>
SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent ) SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox( _parent )
{ {
/** /**
* Source Block * Source Block
...@@ -62,7 +62,7 @@ SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent ...@@ -62,7 +62,7 @@ SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent
sourceLayout->addWidget( line, 2, 0, 1, -1 ); sourceLayout->addWidget( line, 2, 0, 1, -1 );
} }
void SoutInputBox::setMRL( QString mrl ) void SoutInputBox::setMRL( const QString& mrl )
{ {
sourceLine->setText( mrl ); sourceLine->setText( mrl );
QString type; QString type;
...@@ -104,7 +104,7 @@ FileDestBox::FileDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -104,7 +104,7 @@ FileDestBox::FileDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
BUTTONACT( fileSelectButton, fileBrowse() ); BUTTONACT( fileSelectButton, fileBrowse() );
} }
QString FileDestBox::getMRL( QString mux ) QString FileDestBox::getMRL( const QString& mux )
{ {
if( fileEdit->text().isEmpty() ) return ""; if( fileEdit->text().isEmpty() ) return "";
...@@ -158,7 +158,7 @@ HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -158,7 +158,7 @@ HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( HTTPEdit ); CT( HTTPEdit );
} }
QString HTTPDestBox::getMRL( QString mux ) QString HTTPDestBox::getMRL( const QString& mux )
{ {
if( HTTPEdit->text().isEmpty() ) return ""; if( HTTPEdit->text().isEmpty() ) return "";
...@@ -202,7 +202,7 @@ MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -202,7 +202,7 @@ MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( MMSHEdit ); CT( MMSHEdit );
} }
QString MMSHDestBox::getMRL( QString mux ) QString MMSHDestBox::getMRL( const QString& mux )
{ {
if( MMSHEdit->text().isEmpty() ) return ""; if( MMSHEdit->text().isEmpty() ) return "";
...@@ -246,7 +246,7 @@ UDPDestBox::UDPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -246,7 +246,7 @@ UDPDestBox::UDPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( UDPEdit ); CT( UDPEdit );
} }
QString UDPDestBox::getMRL( QString mux ) QString UDPDestBox::getMRL( const QString& mux )
{ {
if( UDPEdit->text().isEmpty() ) return ""; if( UDPEdit->text().isEmpty() ) return "";
...@@ -317,7 +317,7 @@ RTPDestBox::RTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -317,7 +317,7 @@ RTPDestBox::RTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( RTPEdit ); CT( RTPEdit );
} }
QString RTPDestBox::getMRL( QString mux ) QString RTPDestBox::getMRL( const QString& mux )
{ {
if( RTPEdit->text().isEmpty() ) return ""; if( RTPEdit->text().isEmpty() ) return "";
...@@ -380,7 +380,7 @@ ICEDestBox::ICEDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -380,7 +380,7 @@ ICEDestBox::ICEDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( ICEPassEdit ); CT( ICEPassEdit );
} }
QString ICEDestBox::getMRL( QString mux ) QString ICEDestBox::getMRL( const QString& mux )
{ {
if( ICEEdit->text().isEmpty() ) return ""; if( ICEEdit->text().isEmpty() ) return "";
......
...@@ -35,9 +35,9 @@ class QSpinBox; ...@@ -35,9 +35,9 @@ class QSpinBox;
class SoutInputBox : public QGroupBox class SoutInputBox : public QGroupBox
{ {
public: public:
SoutInputBox( QWidget *_parent = NULL, QString mrl = "" ); SoutInputBox( QWidget *_parent = NULL, const QString& mrl = "" );
void setMRL( QString ); void setMRL( const QString& );
private: private:
QLineEdit *sourceLine; QLineEdit *sourceLine;
QLabel *sourceValueLabel; QLabel *sourceValueLabel;
...@@ -49,7 +49,7 @@ class VirtualDestBox : public QWidget ...@@ -49,7 +49,7 @@ class VirtualDestBox : public QWidget
Q_OBJECT; Q_OBJECT;
public: public:
VirtualDestBox( QWidget *_parent = NULL ) : QWidget( _parent ){} VirtualDestBox( QWidget *_parent = NULL ) : QWidget( _parent ){}
virtual QString getMRL( QString ) = 0; virtual QString getMRL( const QString& ) = 0;
protected: protected:
QString mrl; QString mrl;
signals: signals:
...@@ -61,7 +61,7 @@ class FileDestBox: public VirtualDestBox ...@@ -61,7 +61,7 @@ class FileDestBox: public VirtualDestBox
Q_OBJECT; Q_OBJECT;
public: public:
FileDestBox( QWidget *_parent = NULL ); FileDestBox( QWidget *_parent = NULL );
virtual QString getMRL( QString ); virtual QString getMRL( const QString& );
private: private:
QLineEdit *fileEdit; QLineEdit *fileEdit;
private slots: private slots:
...@@ -73,7 +73,7 @@ class HTTPDestBox: public VirtualDestBox ...@@ -73,7 +73,7 @@ class HTTPDestBox: public VirtualDestBox
Q_OBJECT; Q_OBJECT;
public: public:
HTTPDestBox( QWidget *_parent = NULL ); HTTPDestBox( QWidget *_parent = NULL );
virtual QString getMRL( QString ); virtual QString getMRL( const QString& );
private: private:
QLineEdit *HTTPEdit; QLineEdit *HTTPEdit;
QSpinBox *HTTPPort; QSpinBox *HTTPPort;
...@@ -84,7 +84,7 @@ class MMSHDestBox: public VirtualDestBox ...@@ -84,7 +84,7 @@ class MMSHDestBox: public VirtualDestBox
Q_OBJECT; Q_OBJECT;
public: public:
MMSHDestBox( QWidget *_parent = NULL ); MMSHDestBox( QWidget *_parent = NULL );
virtual QString getMRL( QString ); virtual QString getMRL( const QString& );
private: private:
QLineEdit *MMSHEdit; QLineEdit *MMSHEdit;
QSpinBox *MMSHPort; QSpinBox *MMSHPort;
...@@ -95,7 +95,7 @@ class UDPDestBox: public VirtualDestBox ...@@ -95,7 +95,7 @@ class UDPDestBox: public VirtualDestBox
Q_OBJECT; Q_OBJECT;
public: public:
UDPDestBox( QWidget *_parent = NULL ); UDPDestBox( QWidget *_parent = NULL );
virtual QString getMRL( QString ); virtual QString getMRL( const QString& );
private: private:
QLineEdit *UDPEdit; QLineEdit *UDPEdit;
QSpinBox *UDPPort; QSpinBox *UDPPort;
...@@ -106,7 +106,7 @@ class RTPDestBox: public VirtualDestBox ...@@ -106,7 +106,7 @@ class RTPDestBox: public VirtualDestBox
Q_OBJECT; Q_OBJECT;
public: public:
RTPDestBox( QWidget *_parent = NULL ); RTPDestBox( QWidget *_parent = NULL );
virtual QString getMRL( QString ); virtual QString getMRL( const QString& );
private: private:
QLineEdit *RTPEdit; QLineEdit *RTPEdit;
QSpinBox *RTPPort; QSpinBox *RTPPort;
...@@ -119,7 +119,7 @@ class ICEDestBox: public VirtualDestBox ...@@ -119,7 +119,7 @@ class ICEDestBox: public VirtualDestBox
Q_OBJECT; Q_OBJECT;
public: public:
ICEDestBox( QWidget *_parent = NULL ); ICEDestBox( QWidget *_parent = NULL );
virtual QString getMRL( QString ); virtual QString getMRL( const QString& );
private: private:
QLineEdit *ICEEdit; QLineEdit *ICEEdit;
QLineEdit *ICEMountEdit; QLineEdit *ICEMountEdit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment