From 5990efaa32d2162c7bb8c0c94d924423f6fe85ad Mon Sep 17 00:00:00 2001 From: Kilian Lackhove Date: Wed, 12 Sep 2012 18:35:27 +0200 Subject: [PATCH] lfranchis suggestions --- src/libtomahawk/Result.cpp | 2 +- src/libtomahawk/resolvers/QtScriptResolver.cpp | 7 ++----- src/libtomahawk/resolvers/ScriptResolver.cpp | 9 +++------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/libtomahawk/Result.cpp b/src/libtomahawk/Result.cpp index 4a8bbf03c..4656f8858 100644 --- a/src/libtomahawk/Result.cpp +++ b/src/libtomahawk/Result.cpp @@ -308,7 +308,7 @@ Result::sourceIcon() const QPixmap avatar = collection()->source()->avatar( Source::FancyStyle ); if ( !avatar ) { - avatar = TomahawkUtils::createAvatarFrame( QPixmap( RESPATH "images/user-avatar.png" ) ); + avatar = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultSourceAvatar, TomahawkUtils::AvatarInFrame ); } return avatar; } diff --git a/src/libtomahawk/resolvers/QtScriptResolver.cpp b/src/libtomahawk/resolvers/QtScriptResolver.cpp index 74f2c0d43..c523b2fd9 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.cpp +++ b/src/libtomahawk/resolvers/QtScriptResolver.cpp @@ -327,17 +327,14 @@ QtScriptResolver::init() m_weight = m.value( "weight", 0 ).toUInt(); m_timeout = m.value( "timeout", 25 ).toUInt() * 1000; QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString(); - if ( !m_icon.load( iconPath ) ) - { - iconPath = "none"; - } + int success = m_icon.load( iconPath ); // load config widget and apply settings loadUi(); QVariantMap config = resolverUserConfig(); fillDataInWidgets( config ); - qDebug() << "JS" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon" << iconPath; + qDebug() << "JS" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon" << iconPath << "icon found" << success; m_ready = true; } diff --git a/src/libtomahawk/resolvers/ScriptResolver.cpp b/src/libtomahawk/resolvers/ScriptResolver.cpp index 46e4454fe..b0d034c34 100644 --- a/src/libtomahawk/resolvers/ScriptResolver.cpp +++ b/src/libtomahawk/resolvers/ScriptResolver.cpp @@ -35,7 +35,7 @@ #include #endif -ScriptResolver::ScriptResolver(const QString& exe) +ScriptResolver::ScriptResolver( const QString& exe ) : Tomahawk::ExternalResolverGui( exe ) , m_num_restarts( 0 ) , m_msgsize( 0 ) @@ -376,12 +376,9 @@ ScriptResolver::doSetup( const QVariantMap& m ) m_weight = m.value( "weight", 0 ).toUInt(); m_timeout = m.value( "timeout", 5 ).toUInt() * 1000; QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString(); - if ( !m_icon.load( iconPath ) ) - { - iconPath = "none"; - } + int success = m_icon.load( iconPath ); - qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon" << iconPath; + qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon" << iconPath << "icon found" << success; m_ready = true; m_configSent = false;