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