[vlc-commits] qt: fix file url when converting / opening multiple files

Pierre Lamot git at videolan.org
Wed Jan 17 22:10:40 CET 2018


vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Jan 12 10:14:04 2018 +0100| [1775d39cde0af46fae4e229fd00aa5b14d23cbcc] | committer: Jean-Baptiste Kempf

qt: fix file url when converting / opening multiple files

fix: #19391, #19413
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 2148aa6eb48439b7e18af9dd585e555f29bb305f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=1775d39cde0af46fae4e229fd00aa5b14d23cbcc
---

 modules/gui/qt/dialogs/convert.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt/dialogs/convert.cpp b/modules/gui/qt/dialogs/convert.cpp
index 1c7b1a85ed..052cdeb55c 100644
--- a/modules/gui/qt/dialogs/convert.cpp
+++ b/modules/gui/qt/dialogs/convert.cpp
@@ -71,6 +71,7 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
     fileLine = new QLineEdit;
     fileLine->setMinimumWidth( 300 );
     fileLine->setFocus( Qt::ActiveWindowFocusReason );
+    fileLine->setReadOnly(true);
     destLabel->setBuddy( fileLine );
     // You can set a specific name for only one file.
     if(singleFileSelected)
@@ -154,11 +155,11 @@ void ConvertDialog::fileBrowse()
 {
     QString fileExtension = ( ! profile->isEnabled() ) ? ".*" : "." + profile->getMux();
 
-    QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file..." ),
+    QUrl fileName = QFileDialog::getSaveFileUrl( this, qtr( "Save file..." ),
         p_intf->p_sys->filepath,
         QString( "%1 (*%2);;%3 (*.*)" ).arg( qtr( "Containers" ) )
             .arg( fileExtension ).arg( qtr("All") ), 0, QFileDialog::DontConfirmOverwrite );
-    fileLine->setText( toNativeSeparators( fileName ) );
+    fileLine->setText( fileName.toEncoded() );
     setDestinationFileExtension();
 }
 
@@ -198,7 +199,7 @@ void ConvertDialog::close()
             // Only one file, use the destination provided
             if(singleFileSelected)
             {
-                newFileName = fileLine->text();
+                newFileName = QUrl(fileLine->text()).toLocalFile();
             }
 
             // Multiple, use the convention.
@@ -209,7 +210,7 @@ void ConvertDialog::close()
                 newFileName = incomingMRLs->at(i);
 
                 // Remove the file:// from the front of our MRL
-                newFileName = newFileName.remove(0,7);
+                newFileName = QUrl(newFileName).toLocalFile();
 
                 // Remote the existing extention (if any)
                 int extentionPos = newFileName.lastIndexOf('.');



More information about the vlc-commits mailing list