From 195aa27b87cd2f97a02bd71d2fe0d8df26c04bd7 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 22 Nov 2014 23:35:31 +0100 Subject: [PATCH] Access private variable directly instead of using getter --- src/libtomahawk/resolvers/JSResolver.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/resolvers/JSResolver.cpp b/src/libtomahawk/resolvers/JSResolver.cpp index e4e6aab7c..7fbe10f90 100644 --- a/src/libtomahawk/resolvers/JSResolver.cpp +++ b/src/libtomahawk/resolvers/JSResolver.cpp @@ -317,8 +317,10 @@ JSResolver::artists( const Tomahawk::collection_ptr& collection ) return; } + Q_D( const JSResolver ); + if ( !m_collections.contains( collection->name() ) || //if the collection doesn't belong to this resolver - !capabilities().testFlag( Browsable ) ) //or this resolver doesn't even support collections + !d->capabilities.testFlag( Browsable ) ) //or this resolver doesn't even support collections { emit artistsFound( QList< Tomahawk::artist_ptr >() ); return; @@ -351,8 +353,10 @@ JSResolver::albums( const Tomahawk::collection_ptr& collection, const Tomahawk:: return; } + Q_D( const JSResolver ); + if ( !m_collections.contains( collection->name() ) || //if the collection doesn't belong to this resolver - !capabilities().testFlag( Browsable ) ) //or this resolver doesn't even support collections + !d->capabilities.testFlag( Browsable ) ) //or this resolver doesn't even support collections { emit albumsFound( QList< Tomahawk::album_ptr >() ); return; @@ -386,8 +390,10 @@ JSResolver::tracks( const Tomahawk::collection_ptr& collection, const Tomahawk:: return; } + Q_D( const JSResolver ); + if ( !m_collections.contains( collection->name() ) || //if the collection doesn't belong to this resolver - !capabilities().testFlag( Browsable ) ) //or this resolver doesn't even support collections + !d->capabilities.testFlag( Browsable ) ) //or this resolver doesn't even support collections { emit tracksFound( QList< Tomahawk::query_ptr >() ); return; @@ -449,7 +455,9 @@ JSResolver::lookupUrl( const QString& url ) return; } - if ( !capabilities().testFlag( UrlLookup ) ) + Q_D( const JSResolver ); + + if ( !d->capabilities.testFlag( UrlLookup ) ) { emit informationFound( url, QSharedPointer() ); return;