#include <QFile>
#include <QLabel>
+#include <assert.h>
+
OpenUrlDialog *OpenUrlDialog::instance = NULL;
OpenUrlDialog* OpenUrlDialog::getInstance( QWidget *parent,
OpenUrlDialog::OpenUrlDialog( QWidget *parent,
intf_thread_t *_p_intf,
- bool bClipboard ) : QVLCDialog( parent, _p_intf )
+ bool _bClipboard ) :
+ QVLCDialog( parent, _p_intf ), bClipboard( _bClipboard )
{
- this->bClipboard = bClipboard;
- this->setWindowTitle( qtr( "Open URL" ) );
+ setWindowTitle( qtr( "Open URL" ) );
/* Buttons */
QPushButton *but;
"to the media you want to play"),
this );
- this->setToolTip( qtr( "If your clipboard contains a valid URL\n"
- "or the path to a file on your computer,\n"
- "it will be automatically selected." ) );
+ setToolTip( qtr( "If your clipboard contains a valid URL\n"
+ "or the path to a file on your computer,\n"
+ "it will be automatically selected." ) );
/* Layout */
QVBoxLayout *vlay = new QVBoxLayout( this );
if( bClipboard )
{
QClipboard *clipboard = QApplication::clipboard();
- const QMimeData *data = clipboard->mimeData( QClipboard::Selection );
- QString txt = data->text().trimmed();
+ assert( clipboard != NULL );
+ QString txt = clipboard->text( QClipboard::Selection ).trimmed();
if( txt.isEmpty() || ( !txt.contains("://") && !QFile::exists(txt) ) )
- txt = clipboard->mimeData()->text().trimmed();
+ txt = clipboard->text( QClipboard::Clipboard ).trimmed();
if( txt.contains( "://" ) || QFile::exists( txt ) )
edit->setText( txt );
QString url = oud->url();
if( !url.isEmpty() )
{
- playlist_Add( THEPL, qtu( toNativeSeparators( url ) ),
+ playlist_Add( THEPL, qtu( url ),
NULL, !oud->shouldEnqueue() ?
( PLAYLIST_APPEND | PLAYLIST_GO )
: ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
PLAYLIST_END, true, false );
- RecentsMRL::getInstance( p_intf )->addRecent(
- toNativeSeparators( url ) );
+ RecentsMRL::getInstance( p_intf )->addRecent( url );
}
}
}