Commit 439cd43d authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: create a helper function to manage core ArtUrl

decodeArtURL( input_item_t *p_item ) should be self-explanatory.
And use it.
parent e0054371
......@@ -594,13 +594,12 @@ void InputManager::requestArtUpdate()
}
}
void InputManager::UpdateArt()
const QString InputManager::decodeArtURL( input_item_t *p_item )
{
QString url;
assert( p_item );
if( hasInput() )
{
char *psz_art = input_item_GetArtURL( input_GetItem( p_input ) );
char *psz_art = input_item_GetArtURL( p_item );
QString url;
if( psz_art && !strncmp( psz_art, "file://", 7 ) &&
decode_URI( psz_art + 7 ) )
#ifdef WIN32
......@@ -613,7 +612,15 @@ void InputManager::UpdateArt()
url = url.replace( "file://", "" );
/* Taglib seems to define a attachment://, It won't work yet */
url = url.replace( "attachment://", "" );
}
return url;
}
void InputManager::UpdateArt()
{
QString url;
if( hasInput() )
url = decodeArtURL( input_GetItem( p_input ) );
/* the art hasn't changed, no need to update */
if(artUrl == url)
......
......@@ -132,6 +132,7 @@ public:
void requestArtUpdate();
QString getName() { return oldName; }
static const QString decodeArtURL( input_item_t *p_item );
private:
intf_thread_t *p_intf;
......
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