Commit c7014883 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

qt4: Allow the title to be configured.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 96443b23
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "input_manager.hpp" #include "input_manager.hpp"
#include <vlc_keys.h> #include <vlc_keys.h>
#include <vlc_url.h> #include <vlc_url.h>
#include <vlc_strings.h>
#include <QApplication> #include <QApplication>
...@@ -457,35 +458,18 @@ void InputManager::UpdateName() ...@@ -457,35 +458,18 @@ void InputManager::UpdateName()
/* Update text, name and nowplaying */ /* Update text, name and nowplaying */
QString text; 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 */ /* Try to get the nowplaying */
char *psz_nowplaying = char *format = var_InheritString( p_intf, "input-title-format" );
input_item_GetNowPlaying( input_GetItem( p_input ) ); char *formated = str_format_meta( p_input, format );
if( !EMPTY_STR( psz_nowplaying ) ) text = formated;
{
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 );
}
/* Free everything */ /* Free everything */
free( psz_name ); free( format );
free( psz_nowplaying ); free( formated );
/* If we have Nothing */ /* If we have Nothing */
if( text.isEmpty() ) 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.sprintf( "%s", psz_name );
text = text.remove( 0, text.lastIndexOf( DIR_SEP ) + 1 ); text = text.remove( 0, text.lastIndexOf( DIR_SEP ) + 1 );
free( psz_name ); free( psz_name );
......
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