[vlc-devel] commit: Always show something in the statusLabel, even if you don' t have ANY metadata. (Jean-Baptiste Kempf )

git version control git at videolan.org
Sat Sep 13 10:30:45 CEST 2008


vlc | branch: 0.9-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep 13 01:31:51 2008 -0700| [70d1cb5f057a993ef84c89cc26b8adb6ccfde8e7] | committer: Jean-Baptiste Kempf 

Always show something in the statusLabel, even if you don't have ANY metadata.

This will slow a few complaints from many people.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=70d1cb5f057a993ef84c89cc26b8adb6ccfde8e7
---

 modules/gui/qt4/input_manager.cpp |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 342bdc5..62d91be 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -305,6 +305,7 @@ void InputManager::UpdateMeta()
     /* Update text, name and nowplaying */
     QString text;
 
+    /* Try to get the Title, then the Name */
     char *psz_name = input_item_GetTitle( input_GetItem( p_input ) );
     if( EMPTY_STR( psz_name ) )
     {
@@ -312,28 +313,37 @@ void InputManager::UpdateMeta()
         psz_name = input_item_GetName( input_GetItem( p_input ) );
     }
 
+    /* Try to get the nowplaying */
     char *psz_nowplaying =
         input_item_GetNowPlaying( input_GetItem( p_input ) );
     if( !EMPTY_STR( psz_nowplaying ) )
     {
         text.sprintf( "%s - %s", psz_nowplaying, psz_name );
     }
-    else
+    else  /* Do it ourself */
     {
         char *psz_artist = input_item_GetArtist( input_GetItem( p_input ) );
+
         if( !EMPTY_STR( psz_artist ) )
-        {
             text.sprintf( "%s - %s", psz_artist, psz_name );
-        }
         else
-        {
             text.sprintf( "%s", psz_name );
-        }
+
         free( psz_artist );
     }
+    /* Free everything */
     free( psz_name );
     free( psz_nowplaying );
 
+    /* If we have Nothing */
+    if( text.isEmpty() )
+    {
+        psz_name = input_item_GetURI( input_GetItem( p_input ) );
+        text.sprintf( "%s", psz_name );
+        text = text.remove( 0, text.lastIndexOf( DIR_SEP ) + 1 );
+        free( psz_name );
+    }
+
     if( old_name != text )
     {
         emit nameChanged( text );




More information about the vlc-devel mailing list