]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/info_panels.cpp
i18n fix
[vlc] / modules / gui / qt4 / components / info_panels.cpp
index afcd93f67f302f57f391bc0dbd7e98698462b751..5b78c9b7665806573681e43f2496aae80de4aeb7 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "qt4.hpp"
 #include "components/info_panels.hpp"
+#include "components/interface_widgets.hpp"
 
 #include <QTreeWidget>
 #include <QListView>
@@ -105,13 +106,7 @@ MetaPanel::MetaPanel( QWidget *parent,
     line++;
 
     /* ART_URL */
-    art_cover = new QLabel( "" );
-    art_cover->setMinimumHeight( 128 );
-    art_cover->setMinimumWidth( 128 );
-    art_cover->setMaximumHeight( 128 );
-    art_cover->setMaximumWidth( 128 );
-    art_cover->setScaledContents( true );
-    art_cover->setPixmap( QPixmap( ":/noart.png" ) );
+    art_cover = new CoverArtLabel( VLC_OBJECT( p_intf ) );
     metaLayout->addWidget( art_cover, line, 8, 4, 2, Qt::AlignRight );
 
 /* Settings is unused */
@@ -131,7 +126,7 @@ MetaPanel::MetaPanel( QWidget *parent,
     nowplaying_text->setReadOnly( true );
     ADD_META_2( VLC_META_PUBLISHER, publisher_text );
     ADD_META_2( VLC_META_COPYRIGHT, copyright_text );
-    ADD_META_2( "Comments", description_text );
+    ADD_META_2( N_("Comments"), description_text );
 
 /* useless metadata */
 
@@ -198,10 +193,7 @@ void MetaPanel::update( input_item_t *p_item )
     /* URL / URI */
     psz_meta = input_item_GetURL( p_item );
     if( !EMPTY_STR( psz_meta ) )
-    {
         emit uriSet( QString( psz_meta ) );
-        free( psz_meta );
-    }
     else
     {
         free( psz_meta );
@@ -209,6 +201,7 @@ void MetaPanel::update( input_item_t *p_item )
         if( !EMPTY_STR( psz_meta ) )
             emit uriSet( QString( psz_meta ) );
     }
+    free( psz_meta );
 
     /* Other classic though */
     UPDATE_META( Artist, artist_text );
@@ -229,16 +222,8 @@ void MetaPanel::update( input_item_t *p_item )
 #undef UPDATE_META_INT
 #undef UPDATE_META
 
-    /* Art Urls */
-    psz_meta = input_item_GetArtURL( p_item );
-    if( psz_meta && !strncmp( psz_meta, "file://", 7 ) )
-    {
-        QString artUrl = qfu( psz_meta ).replace( "file://",QString("" ) );
-        art_cover->setPixmap( QPixmap( artUrl ) );
-    }
-    else
-        art_cover->setPixmap( QPixmap( ":/noart.png" ) );
-    free( psz_meta );
+    /* Update Art */
+    art_cover->update( p_item );
 }
 
 /**
@@ -291,7 +276,7 @@ void MetaPanel::saveMeta()
     if( p_mod )
         module_Unneed( p_playlist, p_mod );
     PL_UNLOCK;
-    pl_Release( p_playlist );
+    pl_Release( p_intf );
 
     /* Reset the status of the mode. No need to emit any signal because parent
        is the only caller */
@@ -332,7 +317,7 @@ void MetaPanel::clear()
     language_text->clear();
     nowplaying_text->clear();
     publisher_text->clear();
-    art_cover;
+    art_cover->update( NULL );
 
     setEditMode( false );
 }
@@ -377,7 +362,10 @@ void ExtraMetaPanel::update( input_item_t *p_item )
     vlc_mutex_lock( &p_item->lock );
     vlc_meta_t *p_meta = p_item->p_meta;
     if( !p_meta )
+    {
+        vlc_mutex_unlock( &p_item->lock );
         return;
+    }
 
     vlc_dictionary_t * p_dict = &p_meta->extra_tags;
     char ** ppsz_allkey = vlc_dictionary_all_keys( p_dict );