mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Merge branch 'master' of git://github.com/tomahawk-player/tomahawk
Conflicts: src/resolvers/qtscriptresolver.h
This commit is contained in:
@@ -58,7 +58,7 @@ ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& 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<Tomahawk::album_ptr>& 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<Tomahawk::artist_ptr>& 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 )
|
||||
|
@@ -24,18 +24,20 @@
|
||||
#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 );
|
||||
|
@@ -93,6 +93,7 @@ public:
|
||||
|
||||
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();
|
||||
|
Reference in New Issue
Block a user