[vlc-commits] Qt: convert: don't enforce container extension (fix #9282)

Jean-Baptiste Kempf git at videolan.org
Fri Feb 28 18:10:21 CET 2014


vlc/vlc-2.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Feb 28 18:07:30 2014 +0100| [22c956f0df5c126f5cdb87bb5b0aebadd7e20585] | committer: Jean-Baptiste Kempf

Qt: convert: don't enforce container extension (fix #9282)

(cherry picked from commit 82d7c41a88adb9fd85d956c949876315871eb138)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=22c956f0df5c126f5cdb87bb5b0aebadd7e20585
---

 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 a61d032..e371d20 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..." ),
         "",
-        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