]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/open.cpp
qt4: use const for QString when possible.
[vlc] / modules / gui / qt4 / dialogs / open.cpp
index 1646093e36dcf4b9a6c625e52f1781ac43e92328..e6a996224b8656c990875e806fbc18bc90ec2fc4 100644 (file)
@@ -30,6 +30,7 @@
 #include "dialogs_provider.hpp"
 
 #include "recents.hpp"
+#include "util/qt_dirs.hpp"
 
 #include <QTabWidget>
 #include <QGridLayout>
@@ -142,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() );
@@ -352,12 +353,12 @@ void OpenDialog::finish( bool b_enqueue = false )
         if( i == 0 )
         {
             /* Take options from the UI, not from what we stored */
-            QStringList optionsList = ui.advancedLineInput->text().split( ":" );
+            QStringList optionsList = ui.advancedLineInput->text().split( " :" );
 
             /* Insert options */
             for( int j = 0; j < optionsList.size(); j++ )
             {
-                QString qs = optionsList[j].trimmed();
+                QString qs = colon_unescape( optionsList[j] );
                 if( !qs.isEmpty() )
                 {
                     input_item_AddOption( p_input, qtu( qs ),
@@ -399,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;
@@ -424,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;
@@ -433,7 +434,7 @@ void OpenDialog::newCachingMethod( QString method )
     }
 }
 
-QStringList OpenDialog::SeparateEntries( QString entries )
+QStringList OpenDialog::SeparateEntries( const QString& entries )
 {
     bool b_quotes_mode = false;