[vlc-commits] Qt: sout: don't parse MRL when not URL (fix #16267)
Francois Cartegnie
git at videolan.org
Wed Dec 30 16:04:10 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Dec 30 16:02:28 2015 +0100| [7fa7f22ff377445773602c64692ef6e0d5426e02] | committer: Francois Cartegnie
Qt: sout: don't parse MRL when not URL (fix #16267)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7fa7f22ff377445773602c64692ef6e0d5426e02
---
modules/gui/qt4/components/sout/sout_widgets.cpp | 23 ++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt4/components/sout/sout_widgets.cpp b/modules/gui/qt4/components/sout/sout_widgets.cpp
index 83dec67..f84ebdb 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.cpp
@@ -70,10 +70,25 @@ SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox(
void SoutInputBox::setMRL( const QString& mrl )
{
QUrl uri = QUrl::fromEncoded( mrl.toLatin1() );
- sourceLine->setText( uri.toString() );
- QString type = uri.scheme();
- if ( type.isEmpty() ) type = qtr( I_FILE_SLASH_DIR );
- sourceValueLabel->setText( type );
+ if( !uri.isValid() &&
+ !mrl.startsWith("http") &&
+ !mrl.startsWith("ftp") &&
+ !mrl.startsWith("/") )
+ {
+ int pos = mrl.indexOf("://");
+ if( pos != -1 )
+ {
+ sourceValueLabel->setText( mrl.left( pos ) );
+ sourceLine->setText( mrl );
+ }
+ }
+ else
+ {
+ sourceLine->setText( uri.toString() );
+ QString type = uri.scheme();
+ if ( type.isEmpty() ) type = qtr( I_FILE_SLASH_DIR );
+ sourceValueLabel->setText( type );
+ }
}
#define CT( x ) connect( x, SIGNAL(textChanged(QString)), this, SIGNAL(mrlUpdated()) );
More information about the vlc-commits
mailing list