Commit a8242d18 authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: use const for QString when possible.

parent 84bf3811
...@@ -197,13 +197,13 @@ void MetaPanel::update( input_item_t *p_item ) ...@@ -197,13 +197,13 @@ void MetaPanel::update( input_item_t *p_item )
/* URL / URI */ /* URL / URI */
psz_meta = input_item_GetURL( p_item ); psz_meta = input_item_GetURL( p_item );
if( !EMPTY_STR( psz_meta ) ) if( !EMPTY_STR( psz_meta ) )
emit uriSet( QString( psz_meta ) ); emit uriSet( psz_meta );
else else
{ {
free( psz_meta ); free( psz_meta );
psz_meta = input_item_GetURI( p_item ); psz_meta = input_item_GetURI( p_item );
if( !EMPTY_STR( psz_meta ) ) if( !EMPTY_STR( psz_meta ) )
emit uriSet( QString( psz_meta ) ); emit uriSet( psz_meta );
} }
free( psz_meta ); free( psz_meta );
......
...@@ -89,7 +89,7 @@ private slots: ...@@ -89,7 +89,7 @@ private slots:
void enterEditMode(); void enterEditMode();
signals: signals:
void uriSet( QString ); void uriSet( const QString& );
void editing(); void editing();
}; };
......
...@@ -185,7 +185,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) ...@@ -185,7 +185,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
backgroundLayout->setColumnStretch( 2, 1 ); backgroundLayout->setColumnStretch( 2, 1 );
CONNECT( THEMIM->getIM(), artChanged( QString ), CONNECT( THEMIM->getIM(), artChanged( QString ),
this, updateArt( QString ) ); this, updateArt( const QString& ) );
} }
BackgroundWidget::~BackgroundWidget() BackgroundWidget::~BackgroundWidget()
...@@ -199,7 +199,7 @@ void BackgroundWidget::resizeEvent( QResizeEvent * event ) ...@@ -199,7 +199,7 @@ void BackgroundWidget::resizeEvent( QResizeEvent * event )
label->show(); label->show();
} }
void BackgroundWidget::updateArt( QString url ) void BackgroundWidget::updateArt( const QString& url )
{ {
if( url.isEmpty() ) if( url.isEmpty() )
{ {
...@@ -409,7 +409,7 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i ) ...@@ -409,7 +409,7 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
setContextMenuPolicy( Qt::ActionsContextMenu ); setContextMenuPolicy( Qt::ActionsContextMenu );
CONNECT( this, updateRequested(), this, doUpdate() ); CONNECT( this, updateRequested(), this, doUpdate() );
CONNECT( THEMIM->getIM(), artChanged( QString ), CONNECT( THEMIM->getIM(), artChanged( QString ),
this, doUpdate( QString ) ); this, doUpdate( const QString& ) );
setMinimumHeight( 128 ); setMinimumHeight( 128 );
setMinimumWidth( 128 ); setMinimumWidth( 128 );
...@@ -431,7 +431,7 @@ CoverArtLabel::~CoverArtLabel() ...@@ -431,7 +431,7 @@ CoverArtLabel::~CoverArtLabel()
removeAction( act ); removeAction( act );
} }
void CoverArtLabel::doUpdate( QString url ) void CoverArtLabel::doUpdate( const QString& url )
{ {
QPixmap pix; QPixmap pix;
if( !url.isEmpty() && pix.load( url ) ) if( !url.isEmpty() && pix.load( url ) )
......
...@@ -102,7 +102,7 @@ private: ...@@ -102,7 +102,7 @@ private:
public slots: public slots:
void toggle(){ TOGGLEV( this ); } void toggle(){ TOGGLEV( this ); }
void updateArt( QString ); void updateArt( const QString& );
}; };
#if 0 #if 0
...@@ -208,7 +208,7 @@ public slots: ...@@ -208,7 +208,7 @@ public slots:
private slots: private slots:
void doUpdate(); void doUpdate();
void doUpdate(QString); void doUpdate( const QString& );
signals: signals:
void updateRequested(); void updateRequested();
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <QCheckBox> #include <QCheckBox>
ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf, ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
QString inputMRL ) const QString& inputMRL )
: QVLCDialog( parent, _p_intf ) : QVLCDialog( parent, _p_intf )
{ {
setWindowTitle( qtr( "Convert" ) ); setWindowTitle( qtr( "Convert" ) );
......
...@@ -34,7 +34,7 @@ class ConvertDialog : public QVLCDialog ...@@ -34,7 +34,7 @@ class ConvertDialog : public QVLCDialog
{ {
Q_OBJECT; Q_OBJECT;
public: public:
ConvertDialog( QWidget *, intf_thread_t *, QString ); ConvertDialog( QWidget *, intf_thread_t *, const QString& );
virtual ~ConvertDialog(){} virtual ~ConvertDialog(){}
QString getMrl() {return mrl;} QString getMrl() {return mrl;}
......
...@@ -67,7 +67,7 @@ ErrorsDialog::ErrorsDialog( QWidget *parent, intf_thread_t *_p_intf ) ...@@ -67,7 +67,7 @@ ErrorsDialog::ErrorsDialog( QWidget *parent, intf_thread_t *_p_intf )
BUTTONACT( stopShowing, dontShow() ); BUTTONACT( stopShowing, dontShow() );
} }
void ErrorsDialog::addError( QString title, QString text ) void ErrorsDialog::addError( const QString& title, const QString& text )
{ {
add( true, title, text ); add( true, title, text );
} }
...@@ -77,7 +77,7 @@ void ErrorsDialog::addError( QString title, QString text ) ...@@ -77,7 +77,7 @@ void ErrorsDialog::addError( QString title, QString text )
add( false, title, 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; if( stopShowing->isChecked() ) return;
messages->textCursor().movePosition( QTextCursor::End ); messages->textCursor().movePosition( QTextCursor::End );
......
...@@ -43,12 +43,12 @@ public: ...@@ -43,12 +43,12 @@ public:
} }
virtual ~ErrorsDialog() {}; virtual ~ErrorsDialog() {};
void addError( QString, QString ); void addError( const QString&, const QString& );
/*void addWarning( QString, QString );*/ /*void addWarning( QString, QString );*/
private: private:
ErrorsDialog( QWidget *parent, intf_thread_t * ); ErrorsDialog( QWidget *parent, intf_thread_t * );
static ErrorsDialog *instance; static ErrorsDialog *instance;
void add( bool, QString, QString ); void add( bool, const QString&, const QString& );
QCheckBox *stopShowing; QCheckBox *stopShowing;
QTextEdit *messages; QTextEdit *messages;
......
...@@ -87,7 +87,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, ...@@ -87,7 +87,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
BUTTONACT( saveMetaButton, saveMeta() ); BUTTONACT( saveMetaButton, saveMeta() );
/* Let the MetaData Panel update the URI */ /* 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() ); CONNECT( MP, editing(), saveMetaButton, show() );
/* Display the buttonBar according to the Tab selected */ /* Display the buttonBar according to the Tab selected */
......
...@@ -143,22 +143,22 @@ OpenDialog::OpenDialog( QWidget *parent, ...@@ -143,22 +143,22 @@ OpenDialog::OpenDialog( QWidget *parent,
CONNECT( ui.Tab, currentChanged( int ), this, signalCurrent( int ) ); CONNECT( ui.Tab, currentChanged( int ), this, signalCurrent( int ) );
CONNECT( fileOpenPanel, mrlUpdated( QStringList, QString ), CONNECT( fileOpenPanel, mrlUpdated( QStringList, QString ),
this, updateMRL( QStringList, QString ) ); this, updateMRL( const QStringList&, const QString& ) );
CONNECT( netOpenPanel, mrlUpdated( QStringList, QString ), CONNECT( netOpenPanel, mrlUpdated( QStringList, QString ),
this, updateMRL( QStringList, QString ) ); this, updateMRL( const QStringList&, const QString& ) );
CONNECT( discOpenPanel, mrlUpdated( QStringList, QString ), CONNECT( discOpenPanel, mrlUpdated( QStringList, QString ),
this, updateMRL( QStringList, QString ) ); this, updateMRL( const QStringList&, const QString& ) );
CONNECT( captureOpenPanel, mrlUpdated( QStringList, QString ), CONNECT( captureOpenPanel, mrlUpdated( QStringList, QString ),
this, updateMRL( QStringList, QString ) ); this, updateMRL( const QStringList&, const QString& ) );
CONNECT( fileOpenPanel, methodChanged( QString ), CONNECT( fileOpenPanel, methodChanged( QString ),
this, newCachingMethod( QString ) ); this, newCachingMethod( const QString& ) );
CONNECT( netOpenPanel, methodChanged( QString ), CONNECT( netOpenPanel, methodChanged( QString ),
this, newCachingMethod( QString ) ); this, newCachingMethod( const QString& ) );
CONNECT( discOpenPanel, methodChanged( QString ), CONNECT( discOpenPanel, methodChanged( QString ),
this, newCachingMethod( QString ) ); this, newCachingMethod( const QString& ) );
CONNECT( captureOpenPanel, methodChanged( QString ), CONNECT( captureOpenPanel, methodChanged( QString ),
this, newCachingMethod( QString ) ); this, newCachingMethod( const QString& ) );
/* Advanced frame Connects */ /* Advanced frame Connects */
CONNECT( ui.slaveCheckbox, toggled( bool ), this, updateMRL() ); CONNECT( ui.slaveCheckbox, toggled( bool ), this, updateMRL() );
...@@ -400,7 +400,7 @@ void OpenDialog::stream( bool b_transcode_only ) ...@@ -400,7 +400,7 @@ void OpenDialog::stream( bool b_transcode_only )
} }
/* Update the MRL */ /* Update the MRL */
void OpenDialog::updateMRL( QStringList item, QString tempMRL ) void OpenDialog::updateMRL( const QStringList& item, const QString& tempMRL )
{ {
optionsMRL = tempMRL; optionsMRL = tempMRL;
itemsMRL = item; itemsMRL = item;
...@@ -425,7 +425,7 @@ void OpenDialog::updateMRL() { ...@@ -425,7 +425,7 @@ void OpenDialog::updateMRL() {
ui.mrlLine->setText( itemsMRL.join( " " ) ); ui.mrlLine->setText( itemsMRL.join( " " ) );
} }
void OpenDialog::newCachingMethod( QString method ) void OpenDialog::newCachingMethod( const QString& method )
{ {
if( method != storedMethod ) { if( method != storedMethod ) {
storedMethod = method; storedMethod = method;
...@@ -434,7 +434,7 @@ void OpenDialog::newCachingMethod( QString 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; bool b_quotes_mode = false;
......
...@@ -98,7 +98,7 @@ private: ...@@ -98,7 +98,7 @@ private:
int i_action_flag; int i_action_flag;
bool b_pl; bool b_pl;
QStringList SeparateEntries( QString ); QStringList SeparateEntries( const QString& );
QPushButton *cancelButton, *selectButton; QPushButton *cancelButton, *selectButton;
QPushButton *playButton; QPushButton *playButton;
...@@ -110,9 +110,9 @@ private slots: ...@@ -110,9 +110,9 @@ private slots:
void cancel(); void cancel();
void close(); void close();
void toggleAdvancedPanel(); void toggleAdvancedPanel();
void updateMRL( QStringList, QString ); void updateMRL( const QStringList&, const QString& );
void updateMRL(); void updateMRL();
void newCachingMethod( QString ); void newCachingMethod( const QString& );
void signalCurrent( int ); void signalCurrent( int );
void browseInputSlave(); void browseInputSlave();
}; };
......
...@@ -77,7 +77,7 @@ PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -77,7 +77,7 @@ PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
layout->addWidget( label, 1, 0 ); layout->addWidget( label, 1, 0 );
layout->addWidget( edit, 1, 1, 1, -1 ); layout->addWidget( edit, 1, 1, 1, -1 );
CONNECT( edit, textChanged( QString ), CONNECT( edit, textChanged( QString ),
this, search( QString ) ); this, search( const QString& ) );
QDialogButtonBox *box = new QDialogButtonBox; QDialogButtonBox *box = new QDialogButtonBox;
QPushButton *okButton = new QPushButton( qtr( "&Close" ), this ); QPushButton *okButton = new QPushButton( qtr( "&Close" ), this );
...@@ -110,7 +110,7 @@ inline void PluginDialog::FillTree() ...@@ -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 ); QList<QTreeWidgetItem *> items = treePlugins->findItems( qs, Qt::MatchContains );
items += treePlugins->findItems( qs, Qt::MatchContains, 1 ); items += treePlugins->findItems( qs, Qt::MatchContains, 1 );
......
...@@ -42,7 +42,7 @@ private: ...@@ -42,7 +42,7 @@ private:
QTreeWidget *treePlugins; QTreeWidget *treePlugins;
SearchLineEdit *edit; SearchLineEdit *edit;
private slots: private slots:
void search( const QString ); void search( const QString& );
}; };
#endif #endif
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <QFileDialog> #include <QFileDialog>
#include <QToolButton> #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 ) : QVLCDialog( parent, _p_intf )
{ {
setWindowTitle( qtr( "Stream Output" ) ); setWindowTitle( qtr( "Stream Output" ) );
......
...@@ -113,7 +113,7 @@ class SoutDialog : public QVLCDialog ...@@ -113,7 +113,7 @@ class SoutDialog : public QVLCDialog
{ {
Q_OBJECT; Q_OBJECT;
public: public:
SoutDialog( QWidget* parent, intf_thread_t *, QString mrl = ""); SoutDialog( QWidget* parent, intf_thread_t *, const QString& mrl = "");
virtual ~SoutDialog(){} virtual ~SoutDialog(){}
QString getMrl(){ return mrl; } QString getMrl(){ return mrl; }
......
...@@ -461,7 +461,7 @@ void WidgetListing::startDrag( Qt::DropActions /*supportedActions*/ ) ...@@ -461,7 +461,7 @@ void WidgetListing::startDrag( Qt::DropActions /*supportedActions*/ )
* to propagate there too * to propagate there too
*/ */
DroppingController::DroppingController( intf_thread_t *_p_intf, DroppingController::DroppingController( intf_thread_t *_p_intf,
QString line, const QString& line,
QWidget *_parent ) QWidget *_parent )
: AbstractController( _p_intf, _parent ) : AbstractController( _p_intf, _parent )
{ {
...@@ -477,7 +477,7 @@ DroppingController::DroppingController( intf_thread_t *_p_intf, ...@@ -477,7 +477,7 @@ DroppingController::DroppingController( intf_thread_t *_p_intf,
parseAndCreate( line, controlLayout ); parseAndCreate( line, controlLayout );
} }
void DroppingController::resetLine( QString line ) void DroppingController::resetLine( const QString& line )
{ {
hide(); hide();
QLayoutItem *child; QLayoutItem *child;
......
...@@ -98,11 +98,11 @@ class DroppingController: public AbstractController ...@@ -98,11 +98,11 @@ class DroppingController: public AbstractController
{ {
Q_OBJECT; Q_OBJECT;
public: public:
DroppingController( intf_thread_t *, QString line, QWidget *parent = 0 ); DroppingController( intf_thread_t *, const QString& line, QWidget *parent = 0 );
QString getValue(); QString getValue();
virtual ~DroppingController(); virtual ~DroppingController();
void resetLine( QString ); void resetLine( const QString& );
protected: protected:
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 );
......
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