Commit 8e315515 authored by Clément Stenac's avatar Clément Stenac

Hopefully correct tokenization of open strings

parent aeb39123
...@@ -59,13 +59,8 @@ void FileOpenPanel::browseFile() ...@@ -59,13 +59,8 @@ void FileOpenPanel::browseFile()
QString fileString = ""; QString fileString = "";
QStringList files = browse( qtr("Open File") ); QStringList files = browse( qtr("Open File") );
foreach( QString file, files) { foreach( QString file, files) {
if( file.contains(" ") ) { fileString += "\"" + file + "\" ";
fileString += "\"" + file + "\"";
} else {
fileString += file;
}
} }
ui.fileInput->setEditText( fileString ); ui.fileInput->setEditText( fileString );
ui.fileInput->addItem( fileString ); ui.fileInput->addItem( fileString );
if ( ui.fileInput->count() > 8 ) ui.fileInput->removeItem(0); if ( ui.fileInput->count() > 8 ) ui.fileInput->removeItem(0);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <QTabWidget> #include <QTabWidget>
#include <QGridLayout> #include <QGridLayout>
#include <QFileDialog> #include <QFileDialog>
#include <QRegExp>
#include "dialogs/open.hpp" #include "dialogs/open.hpp"
#include "components/open.hpp" #include "components/open.hpp"
...@@ -107,11 +108,14 @@ void OpenDialog::ok() ...@@ -107,11 +108,14 @@ void OpenDialog::ok()
{ {
this->toggleVisible(); this->toggleVisible();
mrl = ui.advancedLineInput->text(); mrl = ui.advancedLineInput->text();
QStringList tempMRL = mrl.split(" "); QStringList tempMRL = mrl.split( QRegExp("\"\\s+\""),
QString::SkipEmptyParts );
if( !isModal() ) if( !isModal() )
{ {
for( size_t i = 0 ; i< tempMRL.size(); i++ ) for( size_t i = 0 ; i< tempMRL.size(); i++ )
{ {
QString mrli = tempMRL[i].remove( QRegExp( "^\"" ) ).
remove( QRegExp( "\"\\s+$" ) );
const char * psz_utf8 = qtu( tempMRL[i] ); const char * psz_utf8 = qtu( tempMRL[i] );
/* Play the first one, parse and enqueue the other ones */ /* Play the first one, parse and enqueue the other ones */
playlist_Add( THEPL, psz_utf8, NULL, playlist_Add( THEPL, psz_utf8, NULL,
......
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