mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-25 15:01:11 +02:00
* Giving domme a style-lesson ;-)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
@@ -35,13 +35,13 @@ class QtScriptResolver;
|
||||
|
||||
class QtScriptResolverHelper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtScriptResolverHelper(const QString& scriptPath, QObject* parent );
|
||||
QtScriptResolverHelper( const QString& scriptPath, QObject* parent );
|
||||
|
||||
public slots:
|
||||
QString readFile(const QString& fileName);
|
||||
QString readFile( const QString& fileName );
|
||||
|
||||
private:
|
||||
QString m_scriptPath;
|
||||
@@ -86,12 +86,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();
|
||||
|
Reference in New Issue
Block a user