Commit c58c5428 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt4 media info: show local file path instead of file:// URI

This fixes #3626.
(cherry picked from commit 83ffb866a8590db08ada770a568ade8f6fdcf293)
parent c521391d
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include "dialogs/mediainfo.hpp" #include "dialogs/mediainfo.hpp"
#include "input_manager.hpp" #include "input_manager.hpp"
#include <vlc_url.h>
#include <QTabWidget> #include <QTabWidget>
#include <QGridLayout> #include <QGridLayout>
#include <QLineEdit> #include <QLineEdit>
...@@ -73,7 +75,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, ...@@ -73,7 +75,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
closeButton->setDefault( true ); closeButton->setDefault( true );
QLabel *uriLabel = new QLabel( qtr( "Location:" ) ); QLabel *uriLabel = new QLabel( qtr( "Location:" ) );
QLineEdit *uriLine = new QLineEdit; uriLine = new QLineEdit;
layout->addWidget( infoTabW, 0, 0, 1, 8 ); layout->addWidget( infoTabW, 0, 0, 1, 8 );
layout->addWidget( uriLabel, 1, 0, 1, 1 ); layout->addWidget( uriLabel, 1, 0, 1, 1 );
...@@ -87,7 +89,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, ...@@ -87,7 +89,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
BUTTONACT( saveMetaButton, saveMeta() ); BUTTONACT( saveMetaButton, saveMeta() );
/* Let the MetaData Panel update the URI */ /* Let the MetaData Panel update the URI */
CONNECT( MP, uriSet( const QString& ), uriLine, setText( const QString& ) ); CONNECT( MP, uriSet( const QString& ), this, updateURI( const QString& ) );
CONNECT( MP, editing(), saveMetaButton, show() ); CONNECT( MP, editing(), saveMetaButton, show() );
/* Display the buttonBar according to the Tab selected */ /* Display the buttonBar according to the Tab selected */
...@@ -181,3 +183,19 @@ void MediaInfoDialog::updateButtons( int i_tab ) ...@@ -181,3 +183,19 @@ void MediaInfoDialog::updateButtons( int i_tab )
saveMetaButton->hide(); saveMetaButton->hide();
} }
void MediaInfoDialog::updateURI( const QString& uri )
{
QString location;
/* If URI points to a local file, show the path instead of the URI */
char *path = make_path( qtu( uri ) );
if( path != NULL )
{
location = qfu( path );
free( path );
}
else
location = uri;
uriLine->setText( location );
}
...@@ -56,6 +56,7 @@ private: ...@@ -56,6 +56,7 @@ private:
ExtraMetaPanel *EMP; ExtraMetaPanel *EMP;
QPushButton *saveMetaButton; QPushButton *saveMetaButton;
QLineEdit *uriLine;
private slots: private slots:
void updateAllTabs( input_item_t * ); void updateAllTabs( input_item_t * );
...@@ -65,6 +66,7 @@ private slots: ...@@ -65,6 +66,7 @@ private slots:
void saveMeta(); void saveMeta();
void updateButtons( int i_tab ); void updateButtons( int i_tab );
void updateURI( const QString& );
friend class Singleton<MediaInfoDialog>; friend class Singleton<MediaInfoDialog>;
}; };
......
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