[vlc-commits] Qt: convert: don't enforce container extension (fix #9282)
Francois Cartegnie
git at videolan.org
Fri Sep 13 00:01:12 CEST 2013
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 12 23:59:34 2013 +0200| [82d7c41a88adb9fd85d956c949876315871eb138] | committer: Francois Cartegnie
Qt: convert: don't enforce container extension (fix #9282)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82d7c41a88adb9fd85d956c949876315871eb138
---
modules/gui/qt4/dialogs/convert.cpp | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/modules/gui/qt4/dialogs/convert.cpp b/modules/gui/qt4/dialogs/convert.cpp
index 6a8c8ac..62cf840 100644
--- a/modules/gui/qt4/dialogs/convert.cpp
+++ b/modules/gui/qt4/dialogs/convert.cpp
@@ -129,7 +129,8 @@ void ConvertDialog::fileBrowse()
QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file..." ),
p_intf->p_sys->filepath,
- QString( qtr( "Containers (*" ) + fileExtension + ")" ) );
+ QString( "%1 (*%2);;%3 (*.*)" ).arg( qtr( "Containers" ) )
+ .arg( fileExtension ).arg( qtr("All") ) );
fileLine->setText( toNativeSeparators( fileName ) );
setDestinationFileExtension();
}
@@ -174,13 +175,10 @@ void ConvertDialog::setDestinationFileExtension()
if( !fileLine->text().isEmpty() && profile->isEnabled() )
{
QString newFileExtension = "." + profile->getMux();
- QString newFileName;
- int index = fileLine->text().lastIndexOf( "." );
- if( index != -1 ) {
- newFileName = fileLine->text().left( index ).append( newFileExtension );
- } else {
- newFileName = fileLine->text().append( newFileExtension );
+ if( fileLine->text().lastIndexOf( "." ) == -1 )
+ {
+ QString newFileName = fileLine->text().append( newFileExtension );
+ fileLine->setText( toNativeSeparators( newFileName ) );
}
- fileLine->setText( toNativeSeparators( newFileName ) );
}
}
More information about the vlc-commits
mailing list