[vlc-commits] Qt: SoutInputBox: show decoded mrl (fix #8436 part1)
Francois Cartegnie
git at videolan.org
Sat Apr 20 13:32:21 CEST 2013
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Apr 20 13:03:20 2013 +0200| [7bd70d43b331d0c07e3ed821a1ec2919b630b09e] | committer: Francois Cartegnie
Qt: SoutInputBox: show decoded mrl (fix #8436 part1)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7bd70d43b331d0c07e3ed821a1ec2919b630b09e
---
modules/gui/qt4/components/sout/sout_widgets.cpp | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/modules/gui/qt4/components/sout/sout_widgets.cpp b/modules/gui/qt4/components/sout/sout_widgets.cpp
index 1799e94..6770a02 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.cpp
@@ -34,6 +34,7 @@
#include <QLabel>
#include <QLineEdit>
#include <QFileDialog>
+#include <QUrl>
#define I_FILE_SLASH_DIR \
I_DIR_OR_FOLDER( N_("File/Directory"), N_("File/Folder") )
@@ -68,15 +69,10 @@ SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox(
void SoutInputBox::setMRL( const QString& mrl )
{
- sourceLine->setText( mrl );
- QString type;
- int i = mrl.indexOf( "://" );
- if( i != -1 )
- {
- type = mrl.left( i );
- }
- else
- type = qtr( I_FILE_SLASH_DIR );
+ QUrl uri = QUrl::fromEncoded( mrl.toAscii() );
+ sourceLine->setText( uri.toString() );
+ QString type = uri.scheme();
+ if ( type.isEmpty() ) type = qtr( I_FILE_SLASH_DIR );
sourceValueLabel->setText( type );
}
More information about the vlc-commits
mailing list