QString file = QFileDialog::getOpenFileName( NULL,
qtr( "Select File" ), qfu( config_GetHomeDir() ) );
if( file.isNull() ) return;
- text->setText( file );
+ text->setText( toNativeSeparators( file ) );
}
void FileConfigControl::finish()
qtr( "Select Directory" ),
text->text().isEmpty() ?
qfu( config_GetHomeDir() ) : text->text(),
- QFileDialog::ShowDirsOnly |
- QFileDialog::DontResolveSymlinks );
+ QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks );
+
if( dir.isNull() ) return;
- text->setText( toNativeSeparators( dir ) );
+ text->setText( toNativeSepNoSlash( dir ) );
}
#if 0
qtr( "Select a directory..." ),
qfu( config_GetHomeDir() ) );
- if( dest_dir != "" )
+ if( !dest_dir.isEmpty() )
{
- /*HACK: Qt4 isn't able to change the way OS deals with directories
- names. Windows doesn't add an ending separator so we might add it.
- */
- #if defined( WIN32 ) || defined( UNDER_CE )
- dest_dir += DIR_SEP;
- #endif
+ dest_dir = toNativeSepNoSlash( dest_dir ) + DIR_SEP;
msg_Dbg( p_intf, "Downloading to folder: %s", qtu( dest_dir ) );
toggleVisible();
update_Download( p_update, qtu( dest_dir ) );
void SoutDialog::fileBrowse()
{
- QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file..." ), "",
- qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) );
- ui.fileEdit->setText( fileName );
+ QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file..." ),
+ "", qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) );
+ ui.fileEdit->setText( toNativeSeparators( fileName ) );
updateMRL();
}
{
p_arg->i_results = 1;
p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
- p_arg->psz_results[0] = strdup( qtu( file ) );
+ p_arg->psz_results[0] = strdup( qtu( toNativeSepNoSlash( file ) ) );
}
else
p_arg->i_results = 0;
p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
i = 0;
foreach( QString file, files )
- p_arg->psz_results[i++] = strdup( qtu( file ) );
+ p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) );
}
/* Callback */
}
ADD_FILTER_ALL( fileTypes );
fileTypes.replace(QString(";*"), QString(" *"));
+
return QFileDialog::getOpenFileNames( NULL,
help.isNull() ? qfu(I_OP_SEL_FILES ) : help,
path.isNull() ? qfu( p_intf->p_sys->psz_filepath ) : path,
int i = 0;
foreach( QString file, files )
{
- const char * psz_utf8 = qtu( file );
+ const char * psz_utf8 = qtu( toNativeSeparators( file ) );
playlist_Add( THEPL, psz_utf8, NULL,
go ? ( PLAYLIST_APPEND | ( i ? 0 : PLAYLIST_GO ) |
( i ? PLAYLIST_PREPARSE : 0 ) )
**/
static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
{
- QString dir = QFileDialog::getExistingDirectory( 0, qtr("Open Directory") );
- if (!dir.isEmpty()) {
+ QString dir = QFileDialog::getExistingDirectory( NULL, qtr("Open Directory") );
+
+ if (!dir.isEmpty() )
+ {
input_item_t *p_input = input_item_NewExt( THEPL,
- qtu( "directory://" + dir ), NULL,
- 0, NULL, -1 );
+ qtu( "directory://" + toNativeSeparators(dir) ),
+ NULL, 0, NULL, -1 );
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput( THEPL, p_input,
EXT_FILTER_PLAYLIST );
foreach( QString file, files )
{
- playlist_Import( THEPL, qtu(file) );
+ playlist_Import( THEPL, qtu( toNativeSeparators( file ) ) );
}
}
file.append( ".m3u" );
}
- playlist_Export( THEPL, qtu( file ), THEPL->p_local_category,
- psz_module);
+ playlist_Export( THEPL, qtu( toNativeSeparators( file ) ),
+ THEPL->p_local_category, psz_module);
}
}
delete qfd;
QString qsFile;
foreach( qsFile, qsl )
{
- if( !input_AddSubtitles( p_input, qtu( qsFile ), true ) )
+ if( !input_AddSubtitles( p_input, qtu( toNativeSeparators( qsFile ) ),
+ true ) )
msg_Warn( p_intf, "unable to load subtitles from '%s'",
qtu( qsFile ) );
}