Commit 1866ec48 authored by Jonathan Heard's avatar Jonathan Heard Committed by Hugo Beauzée-Luyssen

Remove all reliance upon QUrl for handling MRLs in GUI

Fixes #17850
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 7b7132de
......@@ -125,13 +125,13 @@ bool PLItem::operator< ( AbstractPLItem& other )
return false;
}
QUrl PLItem::getURI() const
QString PLItem::getURI() const
{
QString uri;
vlc_mutex_lock( &p_input->lock );
uri = QString( p_input->psz_uri );
vlc_mutex_unlock( &p_input->lock );
return QUrl( uri );
return uri;
}
QString PLItem::getTitle() const
......
......@@ -32,7 +32,6 @@
#include <QList>
#include <QString>
#include <QUrl>
class AbstractPLItem
{
......@@ -57,7 +56,7 @@ protected:
virtual AbstractPLItem *child( int id ) const = 0;
void removeChild( AbstractPLItem *item );
void clearChildren();
virtual QUrl getURI() const = 0;
virtual QString getURI() const = 0;
virtual QString getTitle() const = 0;
virtual bool readOnly() const = 0;
......@@ -79,7 +78,7 @@ private:
int id() const Q_DECL_OVERRIDE;
input_item_t *inputItem() Q_DECL_OVERRIDE { return p_input; }
AbstractPLItem *child( int id ) const Q_DECL_OVERRIDE { return children.value( id ); };
virtual QUrl getURI() const Q_DECL_OVERRIDE;
virtual QString getURI() const Q_DECL_OVERRIDE;
virtual QString getTitle() const Q_DECL_OVERRIDE;
virtual bool readOnly() const Q_DECL_OVERRIDE;
......
......@@ -1048,7 +1048,7 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
if( !item )
return false;
char* psz_path = vlc_uri2path( qtu( item->getURI().toString() ) );
char* psz_path = vlc_uri2path( qtu( item->getURI() ) );
free( psz_path );
return psz_path != NULL;
}
......
......@@ -163,7 +163,7 @@ QString VLCModel::getURI( const QModelIndex &index ) const
{
AbstractPLItem *item = getItem( index );
if ( !item ) return QString();
return item->getURI().toString();
return item->getURI();
}
input_item_t * VLCModel::getInputItem( const QModelIndex &index ) const
......
......@@ -70,6 +70,8 @@ SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox(
void SoutInputBox::setMRL( const QString& mrl )
{
QUrl uri = QUrl::fromEncoded( mrl.toLatin1() );
QString type = uri.scheme();
if( !uri.isValid() &&
!mrl.startsWith("http") &&
!mrl.startsWith("ftp") &&
......@@ -82,10 +84,14 @@ void SoutInputBox::setMRL( const QString& mrl )
sourceLine->setText( mrl );
}
}
else if ( type == "window" )
{
/* QUrl mangles X11 Window identifiers so use the raw mrl */
sourceLine->setText( mrl );
}
else
{
sourceLine->setText( uri.toString() );
QString type = uri.scheme();
if ( type.isEmpty() ) type = qtr( I_FILE_SLASH_DIR );
sourceValueLabel->setText( type );
}
......
......@@ -35,7 +35,6 @@
#include <QClipboard>
#include <QMimeData>
#include <QList>
#include <QUrl>
#include <QFile>
#include <QLabel>
......
......@@ -30,7 +30,6 @@
#include "util/qt_dirs.hpp"
#include <QUrl>
#include <QMimeData>
#include <QHBoxLayout>
......
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