Commit 7fa7f22f authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: sout: don't parse MRL when not URL (fix #16267)

parent ee8c9ec3
...@@ -70,10 +70,25 @@ SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox( ...@@ -70,10 +70,25 @@ SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox(
void SoutInputBox::setMRL( const QString& mrl ) void SoutInputBox::setMRL( const QString& mrl )
{ {
QUrl uri = QUrl::fromEncoded( mrl.toLatin1() ); QUrl uri = QUrl::fromEncoded( mrl.toLatin1() );
sourceLine->setText( uri.toString() ); if( !uri.isValid() &&
QString type = uri.scheme(); !mrl.startsWith("http") &&
if ( type.isEmpty() ) type = qtr( I_FILE_SLASH_DIR ); !mrl.startsWith("ftp") &&
sourceValueLabel->setText( type ); !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()) ); #define CT( x ) connect( x, SIGNAL(textChanged(QString)), this, SIGNAL(mrlUpdated()) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment