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 )
/* 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 );
......
......@@ -89,7 +89,7 @@ private slots:
void enterEditMode();
signals:
void uriSet( QString );
void uriSet( const QString& );
void editing();
};
......
......@@ -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 ) )
......
......@@ -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();
......
......@@ -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" ) );
......
......@@ -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;}
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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();
};
......
......@@ -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 );
......
......@@ -42,7 +42,7 @@ private:
QTreeWidget *treePlugins;
SearchLineEdit *edit;
private slots:
void search( const QString );
void search( const QString& );
};
#endif
......
......@@ -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" ) );
......
......@@ -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; }
......
......@@ -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;
......
......@@ -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 );
......
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