1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-18 23:17:59 +01:00

Don't return const values

This commit is contained in:
Dominik Schmidt 2015-01-21 23:02:29 +01:00 committed by Dominik Schmidt
parent d7517d8f6d
commit 4cac256ba7
33 changed files with 63 additions and 62 deletions

View File

@ -33,8 +33,8 @@ class DLLEXPORT ResultProvider
public:
virtual ~ResultProvider();
virtual const QString name() const = 0;
virtual const QPixmap icon( const QSize& size ) const = 0;
virtual QString name() const = 0;
virtual QPixmap icon( const QSize& size ) const = 0;
};
}

View File

@ -36,7 +36,7 @@ AccountConfigWidget::checkForErrors()
}
const QStringList
QStringList
AccountConfigWidget::errors() const
{
return m_errors;
@ -64,7 +64,7 @@ AccountConfigWidget::setDataWidgets( const QVariantList& dataWidgets )
}
const QVariantMap
QVariantMap
AccountConfigWidget::readData()
{

View File

@ -31,13 +31,13 @@ public:
explicit AccountConfigWidget( QWidget* parent = nullptr );
virtual void checkForErrors();
virtual const QStringList errors() const;
virtual QStringList errors() const;
virtual void resetErrors();
virtual bool settingsValid() const;
void setDataWidgets( const QVariantList& dataWidgets );
const QVariantMap readData();
QVariantMap readData();
static QVariant widgetData( QWidget* widget, const QString& property );
static void setWidgetData( const QVariant& value, QWidget* widget, const QString& property );
void fillDataInWidgets( const QVariantMap& data );

View File

@ -60,7 +60,7 @@ Collection::setWeakRef( const collection_wptr& weakRef )
}
const collection_wptr
collection_wptr
Collection::weakRef() const
{
return m_ownRef;
@ -74,7 +74,7 @@ Collection::browseCapabilities() const
}
const QString
QString
Collection::name() const
{
return m_name;
@ -102,7 +102,7 @@ Collection::itemName() const
}
const QPixmap
QPixmap
Collection::icon( const QSize& size ) const
{
return ImageRegistry::instance()->pixmap( RESPATH "images/collection.svg", size );
@ -126,7 +126,7 @@ Collection::isLocal() const
}
const source_ptr
source_ptr
Collection::source() const
{
return m_source;

View File

@ -55,7 +55,7 @@ public:
virtual ~Collection();
void setWeakRef( const collection_wptr& weakRef );
const collection_wptr weakRef() const;
collection_wptr weakRef() const;
enum BrowseCapability
{
@ -74,12 +74,12 @@ public:
ScriptCollectionType //performs operations through a resolver
};
virtual const QString name() const override;
virtual QString name() const override;
virtual QString prettyName() const;
virtual QString description() const;
virtual QString itemName() const;
virtual BackendType backendType() const { return NullCollectionType; }
virtual const QPixmap icon( const QSize& size ) const override;
virtual QPixmap icon( const QSize& size ) const override;
virtual QPixmap bigIcon() const; //for the ViewPage header
virtual bool isOnline() const = 0;
@ -142,7 +142,7 @@ public slots:
void delTracks( const QList<unsigned int>& fileids );
protected:
const source_ptr source() const;
source_ptr source() const;
private slots:
void onSynced();

View File

@ -204,7 +204,7 @@ DatabaseCollection::trackCount() const
}
const QPixmap
QPixmap
DatabaseCollection::icon( const QSize& size ) const
{
return source()->avatar( TomahawkUtils::RoundedCorners, size, true );

View File

@ -63,7 +63,7 @@ public:
Tomahawk::TracksRequest* requestTracks( const Tomahawk::album_ptr& album ) override;
int trackCount() const override;
const QPixmap icon( const QSize& size ) const override;
QPixmap icon( const QSize& size ) const override;
public slots:
virtual void addTracks( const QList<QVariant>& newitems );

View File

@ -77,7 +77,7 @@ DatabaseResolver::gotArtists( const Tomahawk::QID qid, QList< Tomahawk::artist_p
}
const QString
QString
DatabaseResolver::name() const
{
return QString( "DatabaseResolver" );

View File

@ -33,7 +33,7 @@ Q_OBJECT
public:
explicit DatabaseResolver( int weight );
const QString name() const override;
QString name() const override;
virtual unsigned int weight() const { return m_weight; }
virtual unsigned int timeout() const { return 0; }

View File

@ -150,7 +150,7 @@ JSAccount::startJob( ScriptJob* scriptJob )
}
const QVariant
QVariant
JSAccount::syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments )
{
QString eval = QString(

View File

@ -44,7 +44,7 @@ public:
JSAccount( const QString& name );
void startJob( ScriptJob* scriptJob ) override;
const QVariant syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments ) override;
QVariant syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments ) override;
/**
* Evaluate JavaScript on the WebKit thread

View File

@ -116,7 +116,7 @@ JSResolver::capabilities() const
}
const QString
QString
JSResolver::name() const
{
Q_D( const JSResolver );
@ -125,7 +125,7 @@ JSResolver::name() const
}
const QPixmap
QPixmap
JSResolver::icon( const QSize& size ) const
{
Q_D( const JSResolver );

View File

@ -55,8 +55,8 @@ public:
Capabilities capabilities() const override;
const QString name() const override;
const QPixmap icon( const QSize& size ) const override;
QString name() const override;
QPixmap icon( const QSize& size ) const override;
unsigned int weight() const override;
unsigned int timeout() const override;

View File

@ -19,7 +19,7 @@
#include <QPixmap>
const QPixmap
QPixmap
Tomahawk::Resolver::icon( const QSize& ) const
{
return QPixmap();

View File

@ -47,7 +47,7 @@ public:
virtual unsigned int weight() const = 0;
virtual unsigned int timeout() const = 0;
virtual const QPixmap icon( const QSize& size ) const override;
virtual QPixmap icon( const QSize& size ) const override;
public slots:
virtual void resolve( const Tomahawk::query_ptr& query ) = 0;

View File

@ -81,7 +81,7 @@ ScriptAccount::isStopped()
}
const QString
QString
ScriptAccount::name() const
{
return m_name;
@ -95,7 +95,7 @@ ScriptAccount::setIcon(const QPixmap& icon)
}
const QPixmap
QPixmap
ScriptAccount::icon() const
{
return m_icon;
@ -109,7 +109,7 @@ ScriptAccount::setFilePath( const QString& filePath )
}
const QString
QString
ScriptAccount::filePath() const
{
return m_filePath;
@ -335,7 +335,7 @@ ScriptAccount::parseResultVariantList( const QVariantList& reslist )
}
const QSharedPointer< ScriptCollection >
QSharedPointer< ScriptCollection >
ScriptAccount::scriptCollection( const QString& id ) const
{
return m_collectionFactory->scriptPlugins().value( id );

View File

@ -54,16 +54,16 @@ public:
bool isStopped();
const QString name() const;
QString name() const;
void setIcon( const QPixmap& icon );
const QPixmap icon() const;
QPixmap icon() const;
void setFilePath( const QString& filePath );
const QString filePath() const;
QString filePath() const;
ScriptJob* invoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments );
virtual const QVariant syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments ) = 0;
virtual QVariant syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments ) = 0;
virtual void startJob( ScriptJob* scriptJob ) = 0;
@ -75,7 +75,7 @@ public:
QList< Tomahawk::result_ptr > parseResultVariantList( const QVariantList& reslist );
const QSharedPointer< ScriptCollection > scriptCollection( const QString& id ) const;
QSharedPointer< ScriptCollection > scriptCollection( const QString& id ) const;
private slots:
void onJobDeleted( const QString& jobId );

View File

@ -121,7 +121,7 @@ ScriptCollection::setIcon( const QPixmap& icon )
}
const QPixmap
QPixmap
ScriptCollection::icon( const QSize& size ) const
{
if ( !size.isEmpty() && !m_icon.isNull() )
@ -211,7 +211,7 @@ ScriptCollection::trackCount() const
}
const QVariantMap
QVariantMap
ScriptCollection::readMetaData()
{
return scriptObject()->syncInvoke( "collection" ).toMap();

View File

@ -74,7 +74,7 @@ public:
void fetchIcon( const QString& iconUrl );
void setIcon( const QPixmap& icon );
const QPixmap icon( const QSize& size ) const override;
QPixmap icon( const QSize& size ) const override;
QPixmap bigIcon() const override;
void setDescription( const QString& text );
@ -87,7 +87,7 @@ public:
void setTrackCount( int count );
int trackCount() const override;
const QVariantMap readMetaData();
QVariantMap readMetaData();
void parseMetaData();
void parseMetaData( const QVariantMap& metadata );

View File

@ -54,28 +54,28 @@ ScriptJob::error() const
}
const scriptobject_ptr
scriptobject_ptr
ScriptJob::scriptObject() const
{
return m_scriptObject;
}
const QString
QString
ScriptJob::id() const
{
return m_id;
}
const QString
QString
ScriptJob::methodName() const
{
return m_methodName;
}
const QVariantMap
QVariantMap
ScriptJob::arguments() const
{
return m_arguments;

View File

@ -43,10 +43,10 @@ public:
bool error() const;
const QString id() const;
const scriptobject_ptr scriptObject() const;
const QString methodName() const;
const QVariantMap arguments() const;
QString id() const;
scriptobject_ptr scriptObject() const;
QString methodName() const;
QVariantMap arguments() const;
public slots:
void reportResults( const QVariantMap& data = QVariantMap() );

View File

@ -43,7 +43,7 @@ ScriptObject::setWeakRef(const scriptobject_wptr& weakRef)
}
const scriptobject_wptr
scriptobject_wptr
ScriptObject::weakRef() const
{
Q_D( const ScriptObject );
@ -61,7 +61,7 @@ ScriptObject::invoke( const QString& methodName, const QVariantMap& arguments )
}
const QVariant
QVariant
ScriptObject::syncInvoke(const QString& methodName, const QVariantMap& arguments)
{
Q_D( ScriptObject );

View File

@ -45,14 +45,14 @@ public:
QString id() const;
void setWeakRef( const scriptobject_wptr& weakRef );
const scriptobject_wptr weakRef() const;
scriptobject_wptr weakRef() const;
ScriptJob* invoke( const QString& methodName, const QVariantMap& arguments = QVariantMap() );
/**
* Avoid using this if possible, it's blocking and can only be used from the gui thread
*/
const QVariant syncInvoke( const QString& methodName, const QVariantMap& arguments = QVariantMap() );
QVariant syncInvoke( const QString& methodName, const QVariantMap& arguments = QVariantMap() );
protected:
void startJob( ScriptJob* scriptJob );

View File

@ -32,7 +32,7 @@ ScriptPlugin::~ScriptPlugin()
}
const scriptobject_ptr
scriptobject_ptr
ScriptPlugin::scriptObject() const
{
return m_scriptObject;

View File

@ -35,7 +35,7 @@ public:
ScriptPlugin( const scriptobject_ptr& object );
virtual ~ScriptPlugin();
const scriptobject_ptr scriptObject() const;
scriptobject_ptr scriptObject() const;
protected: // TODO: pimple
scriptobject_ptr m_scriptObject;

View File

@ -64,7 +64,7 @@ public:
}
virtual const QSharedPointer<T> createPlugin( const scriptobject_ptr&, ScriptAccount* )
virtual QSharedPointer<T> createPlugin( const scriptobject_ptr&, ScriptAccount* )
{
return QSharedPointer<T>();
}

View File

@ -555,7 +555,7 @@ ScriptResolver::setIcon( const QPixmap& icon )
}
const QPixmap
QPixmap
ScriptResolver::icon( const QSize& size ) const
{
if ( !size.isEmpty() )

View File

@ -44,8 +44,8 @@ public:
virtual ~ScriptResolver();
static ExternalResolver* factory( const QString& accountId, const QString& exe, const QStringList& );
const QString name() const Q_DECL_OVERRIDE { return m_name; }
const QPixmap icon( const QSize& size ) const Q_DECL_OVERRIDE;
QString name() const Q_DECL_OVERRIDE { return m_name; }
QPixmap icon( const QSize& size ) const Q_DECL_OVERRIDE;
unsigned int weight() const Q_DECL_OVERRIDE { return m_weight; }
virtual unsigned int preference() const { return m_preference; }
unsigned int timeout() const Q_DECL_OVERRIDE { return m_timeout; }

View File

@ -27,7 +27,8 @@ Tomahawk::SyncScriptJob::SyncScriptJob( const QVariantMap& resultData )
}
void Tomahawk::SyncScriptJob::start()
void
Tomahawk::SyncScriptJob::start()
{
QMetaObject::invokeMethod( this, "reportResults", Qt::QueuedConnection, Q_ARG( QVariantMap, m_data ) );
}

View File

@ -37,7 +37,7 @@ void ScriptCollectionFactory::removePlugin( const QSharedPointer<ScriptCollectio
SourceList::instance()->removeScriptCollection( collection );
}
const QSharedPointer< ScriptCollection > ScriptCollectionFactory::createPlugin( const scriptobject_ptr& object, ScriptAccount* scriptAccount )
QSharedPointer< ScriptCollection > ScriptCollectionFactory::createPlugin( const scriptobject_ptr& object, ScriptAccount* scriptAccount )
{
const QVariantMap collectionInfo = object->syncInvoke( "collection" ).toMap();

View File

@ -33,7 +33,7 @@ class ScriptCollection;
class DLLEXPORT ScriptCollectionFactory : public ScriptPluginFactory< ScriptCollection >
{
const QSharedPointer< ScriptCollection > createPlugin( const scriptobject_ptr&, ScriptAccount* ) override;
QSharedPointer< ScriptCollection > createPlugin( const scriptobject_ptr&, ScriptAccount* ) override;
void addPlugin( const QSharedPointer< ScriptCollection >& scriptPlugin ) const override;
void removePlugin( const QSharedPointer< ScriptCollection >& scriptPlugin ) const override;
};

View File

@ -32,7 +32,7 @@ void ScriptInfoPluginFactory::removePlugin( const QSharedPointer< ScriptInfoPlug
Tomahawk::InfoSystem::InfoSystem::instance()->removeInfoPlugin( infoPlugin.data() );
}
const QSharedPointer< ScriptInfoPlugin > ScriptInfoPluginFactory::createPlugin( const scriptobject_ptr& object, ScriptAccount* scriptAccount )
QSharedPointer< ScriptInfoPlugin > ScriptInfoPluginFactory::createPlugin( const scriptobject_ptr& object, ScriptAccount* scriptAccount )
{
// create infoplugin instance
ScriptInfoPlugin* scriptInfoPlugin = new ScriptInfoPlugin( object, scriptAccount->name() );

View File

@ -30,7 +30,7 @@ class ScriptAccount;
class DLLEXPORT ScriptInfoPluginFactory : public ScriptPluginFactory< ScriptInfoPlugin >
{
const QSharedPointer< ScriptInfoPlugin > createPlugin( const scriptobject_ptr&, ScriptAccount* ) override;
QSharedPointer< ScriptInfoPlugin > createPlugin( const scriptobject_ptr&, ScriptAccount* ) override;
void addPlugin( const QSharedPointer< ScriptInfoPlugin >& scriptPlugin ) const override;
void removePlugin( const QSharedPointer< ScriptInfoPlugin >& scriptPlugin ) const override;
};