[vlc-commits] qt4: Allow the title to be configured.
Hugo Beauzée-Luyssen
git at videolan.org
Fri Apr 22 15:12:35 CEST 2011
vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Apr 21 11:49:48 2011 +0200| [c701488385f061ee7bfecc7113c00baf01c9e4c6] | committer: Jean-Baptiste Kempf
qt4: Allow the title to be configured.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c701488385f061ee7bfecc7113c00baf01c9e4c6
---
modules/gui/qt4/input_manager.cpp | 30 +++++++-----------------------
1 files changed, 7 insertions(+), 23 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index dcf68ab..4cadb2f 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -32,6 +32,7 @@
#include "input_manager.hpp"
#include <vlc_keys.h>
#include <vlc_url.h>
+#include <vlc_strings.h>
#include <QApplication>
@@ -457,35 +458,18 @@ void InputManager::UpdateName()
/* Update text, name and nowplaying */
QString text;
- /* Try to get the Title, then the Name */
- char *psz_name = input_item_GetTitleFbName( 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 /* 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 );
- }
+ char *format = var_InheritString( p_intf, "input-title-format" );
+ char *formated = str_format_meta( p_input, format );
+ text = formated;
/* Free everything */
- free( psz_name );
- free( psz_nowplaying );
+ free( format );
+ free( formated );
/* If we have Nothing */
if( text.isEmpty() )
{
- psz_name = input_item_GetURI( input_GetItem( p_input ) );
+ char *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 );
More information about the vlc-commits
mailing list