diff --git a/src/libtomahawk/contextMenu.cpp b/src/libtomahawk/contextMenu.cpp index 2c86595b2..82053fba2 100644 --- a/src/libtomahawk/contextMenu.cpp +++ b/src/libtomahawk/contextMenu.cpp @@ -58,7 +58,7 @@ ContextMenu::setQueries( const QList& queries ) m_queries.clear(); m_queries << queries; - if ( m_supportedActions & ActionPlay ) + if ( m_supportedActions & ActionPlay && itemCount() == 1 ) m_sigmap->setMapping( addAction( tr( "&Play" ) ), ActionPlay ); if ( m_supportedActions & ActionQueue ) @@ -102,7 +102,7 @@ ContextMenu::setAlbums( const QList& albums ) m_albums.clear(); m_albums << albums; - if ( m_supportedActions & ActionPlay ) + if ( m_supportedActions & ActionPlay && itemCount() == 1 ) m_sigmap->setMapping( addAction( tr( "&Play" ) ), ActionPlay ); if ( m_supportedActions & ActionQueue ) @@ -141,7 +141,7 @@ ContextMenu::setArtists( const QList& artists ) m_artists.clear(); m_artists << artists; - if ( m_supportedActions & ActionPlay ) + if ( m_supportedActions & ActionPlay && itemCount() == 1 ) m_sigmap->setMapping( addAction( tr( "&Play" ) ), ActionPlay ); if ( m_supportedActions & ActionQueue ) diff --git a/src/resolvers/qtscriptresolver.cpp b/src/resolvers/qtscriptresolver.cpp index 815e2c0ff..78508728a 100644 --- a/src/resolvers/qtscriptresolver.cpp +++ b/src/resolvers/qtscriptresolver.cpp @@ -24,22 +24,24 @@ #include "sourcelist.h" #include "utils/tomahawkutils.h" -QtScriptResolverHelper::QtScriptResolverHelper( const QString& scriptPath, QObject* parent ): QObject(parent) + +QtScriptResolverHelper::QtScriptResolverHelper( const QString& scriptPath, QObject* parent ) + : QObject( parent ) { m_scriptPath = scriptPath; } + QString QtScriptResolverHelper::readFile( const QString& fileName ) { QString path = QFileInfo( m_scriptPath ).absolutePath(); // remove directories QString cleanedFileName = QFileInfo( fileName ).fileName(); - QString absoluteFilePath = path.append( "/" ).append( cleanedFileName ); QFile file( absoluteFilePath ); - if( !file.exists() ) + if ( !file.exists() ) { return QString(); } diff --git a/src/resolvers/qtscriptresolver.h b/src/resolvers/qtscriptresolver.h index f77c93c02..a9b439176 100644 --- a/src/resolvers/qtscriptresolver.h +++ b/src/resolvers/qtscriptresolver.h @@ -35,7 +35,7 @@ class QtScriptResolver; class QtScriptResolverHelper : public QObject { - Q_OBJECT +Q_OBJECT public: QtScriptResolverHelper( const QString& scriptPath, QObject* parent ); @@ -87,12 +87,13 @@ public: explicit QtScriptResolver( const QString& scriptPath ); virtual ~QtScriptResolver(); - virtual QString name() const { return m_name; } - virtual unsigned int weight() const { return m_weight; } - virtual unsigned int timeout() const { return m_timeout; } + virtual QString name() const { return m_name; } + virtual unsigned int weight() const { return m_weight; } + virtual unsigned int timeout() const { return m_timeout; } virtual QWidget* configUI() const { return 0; } // TODO support properly for qtscript resolvers too! virtual void saveConfig() {} + public slots: virtual void resolve( const Tomahawk::query_ptr& query ); virtual void stop();