mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 20:00:13 +02:00
Move implementations out of the header
This commit is contained in:
@@ -140,6 +140,34 @@ PlayableModel::parent( const QModelIndex& child ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlayableModel::isReadOnly() const
|
||||||
|
{
|
||||||
|
return m_readOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PlayableModel::setReadOnly( bool b )
|
||||||
|
{
|
||||||
|
m_readOnly = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlayableModel::isLoading() const
|
||||||
|
{
|
||||||
|
return m_loading;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
PlayableModel::title() const
|
||||||
|
{
|
||||||
|
return m_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant
|
QVariant
|
||||||
PlayableModel::artistData( const artist_ptr& artist, int role ) const
|
PlayableModel::artistData( const artist_ptr& artist, int role ) const
|
||||||
{
|
{
|
||||||
@@ -400,6 +428,27 @@ PlayableModel::flags( const QModelIndex& index ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QPersistentModelIndex
|
||||||
|
PlayableModel::currentItem()
|
||||||
|
{
|
||||||
|
return m_currentIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QID
|
||||||
|
PlayableModel::currentItemUuid()
|
||||||
|
{
|
||||||
|
return m_currentUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PlaylistModes::RepeatMode
|
||||||
|
PlayableModel::repeatMode() const
|
||||||
|
{
|
||||||
|
return Tomahawk::PlaylistModes::NoRepeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
PlayableModel::mimeTypes() const
|
PlayableModel::mimeTypes() const
|
||||||
{
|
{
|
||||||
@@ -693,6 +742,13 @@ PlayableModel::removeIndexes( const QList<QPersistentModelIndex>& indexes )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PlayableItem*
|
||||||
|
PlayableModel::rootItem() const
|
||||||
|
{
|
||||||
|
return m_rootItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::onPlaybackStarted( const Tomahawk::result_ptr& result )
|
PlayableModel::onPlaybackStarted( const Tomahawk::result_ptr& result )
|
||||||
{
|
{
|
||||||
@@ -951,6 +1007,13 @@ PlayableModel::setTitle( const QString& title )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
PlayableModel::description() const
|
||||||
|
{
|
||||||
|
return m_description;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::setDescription( const QString& description )
|
PlayableModel::setDescription( const QString& description )
|
||||||
{
|
{
|
||||||
@@ -959,6 +1022,13 @@ PlayableModel::setDescription( const QString& description )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QPixmap
|
||||||
|
PlayableModel::icon() const
|
||||||
|
{
|
||||||
|
return m_icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::setIcon( const QPixmap& pixmap )
|
PlayableModel::setIcon( const QPixmap& pixmap )
|
||||||
{
|
{
|
||||||
@@ -967,6 +1037,20 @@ PlayableModel::setIcon( const QPixmap& pixmap )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
PlayableModel::trackCount() const
|
||||||
|
{
|
||||||
|
return rowCount( QModelIndex() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
PlayableModel::itemCount() const
|
||||||
|
{
|
||||||
|
return rowCount( QModelIndex() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::onQueryBecamePlayable( bool playable )
|
PlayableModel::onQueryBecamePlayable( bool playable )
|
||||||
{
|
{
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
#ifndef PLAYABLEMODEL_H
|
#ifndef PLAYABLEMODEL_H
|
||||||
#define PLAYABLEMODEL_H
|
#define PLAYABLEMODEL_H
|
||||||
|
|
||||||
@@ -82,19 +83,19 @@ public:
|
|||||||
virtual QModelIndex index( int row, int column, const QModelIndex& parent ) const;
|
virtual QModelIndex index( int row, int column, const QModelIndex& parent ) const;
|
||||||
virtual QModelIndex parent( const QModelIndex& child ) const;
|
virtual QModelIndex parent( const QModelIndex& child ) const;
|
||||||
|
|
||||||
virtual bool isReadOnly() const { return m_readOnly; }
|
virtual bool isReadOnly() const;
|
||||||
virtual void setReadOnly( bool b ) { m_readOnly = b; }
|
virtual void setReadOnly( bool b );
|
||||||
virtual bool isLoading() const { return m_loading; }
|
virtual bool isLoading() const;
|
||||||
|
|
||||||
virtual QString title() const { return m_title; }
|
virtual QString title() const;
|
||||||
virtual void setTitle( const QString& title );
|
virtual void setTitle( const QString& title );
|
||||||
virtual QString description() const { return m_description; }
|
virtual QString description() const;
|
||||||
virtual void setDescription( const QString& description );
|
virtual void setDescription( const QString& description );
|
||||||
virtual QPixmap icon() const { return m_icon; }
|
virtual QPixmap icon() const;
|
||||||
virtual void setIcon( const QPixmap& pixmap );
|
virtual void setIcon( const QPixmap& pixmap );
|
||||||
|
|
||||||
virtual int trackCount() const { return rowCount( QModelIndex() ); }
|
virtual int trackCount() const;
|
||||||
virtual int itemCount() const { return rowCount( QModelIndex() ); }
|
virtual int itemCount() const;
|
||||||
|
|
||||||
virtual int rowCount( const QModelIndex& parent ) const;
|
virtual int rowCount( const QModelIndex& parent ) const;
|
||||||
virtual int columnCount( const QModelIndex& parent = QModelIndex() ) const;
|
virtual int columnCount( const QModelIndex& parent = QModelIndex() ) const;
|
||||||
@@ -112,10 +113,10 @@ public:
|
|||||||
virtual Qt::DropActions supportedDropActions() const;
|
virtual Qt::DropActions supportedDropActions() const;
|
||||||
virtual Qt::ItemFlags flags( const QModelIndex& index ) const;
|
virtual Qt::ItemFlags flags( const QModelIndex& index ) const;
|
||||||
|
|
||||||
virtual QPersistentModelIndex currentItem() { return m_currentIndex; }
|
virtual QPersistentModelIndex currentItem();
|
||||||
virtual Tomahawk::QID currentItemUuid() { return m_currentUuid; }
|
virtual Tomahawk::QID currentItemUuid();
|
||||||
|
|
||||||
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return Tomahawk::PlaylistModes::NoRepeat; }
|
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const;
|
||||||
virtual bool shuffled() const { return false; }
|
virtual bool shuffled() const { return false; }
|
||||||
|
|
||||||
virtual void ensureResolved();
|
virtual void ensureResolved();
|
||||||
@@ -174,7 +175,7 @@ public slots:
|
|||||||
virtual void setShuffled( bool /*shuffled*/ ) {}
|
virtual void setShuffled( bool /*shuffled*/ ) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PlayableItem* rootItem() const { return m_rootItem; }
|
PlayableItem* rootItem() const;
|
||||||
QModelIndex createIndex( int row, int column, PlayableItem* item = 0 ) const;
|
QModelIndex createIndex( int row, int column, PlayableItem* item = 0 ) const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@@ -391,6 +391,13 @@ PlaylistModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int r
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
playlist_ptr
|
||||||
|
PlaylistModel::playlist() const
|
||||||
|
{
|
||||||
|
return m_playlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlaylistModel::parsedDroppedTracks( QList< query_ptr > tracks )
|
PlaylistModel::parsedDroppedTracks( QList< query_ptr > tracks )
|
||||||
{
|
{
|
||||||
@@ -561,8 +568,36 @@ PlaylistModel::removeIndex( const QModelIndex& index, bool moreToCome )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlaylistModel::waitForRevision( const QString& revisionguid ) const
|
||||||
|
{
|
||||||
|
return m_waitForRevision.contains( revisionguid );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PlaylistModel::removeFromWaitList( const QString& revisionguid )
|
||||||
|
{
|
||||||
|
m_waitForRevision.removeAll( revisionguid );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PlaylistModel::isTemporary() const
|
PlaylistModel::isTemporary() const
|
||||||
{
|
{
|
||||||
return m_isTemporary;
|
return m_isTemporary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlaylistModel::acceptPlayableQueriesOnly() const
|
||||||
|
{
|
||||||
|
return m_acceptPlayableQueriesOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PlaylistModel::setAcceptPlayableQueriesOnly( bool b )
|
||||||
|
{
|
||||||
|
m_acceptPlayableQueriesOnly = b;
|
||||||
|
}
|
||||||
|
@@ -52,13 +52,13 @@ public:
|
|||||||
virtual QMimeData* mimeData( const QModelIndexList& indexes ) const;
|
virtual QMimeData* mimeData( const QModelIndexList& indexes ) const;
|
||||||
virtual bool dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent );
|
virtual bool dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent );
|
||||||
|
|
||||||
Tomahawk::playlist_ptr playlist() const { return m_playlist; }
|
Tomahawk::playlist_ptr playlist() const;
|
||||||
|
|
||||||
virtual void loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEntries = true );
|
virtual void loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEntries = true );
|
||||||
bool isTemporary() const;
|
bool isTemporary() const;
|
||||||
|
|
||||||
bool acceptPlayableQueriesOnly() const { return m_acceptPlayableQueriesOnly; }
|
bool acceptPlayableQueriesOnly() const;
|
||||||
void setAcceptPlayableQueriesOnly( bool b ) { m_acceptPlayableQueriesOnly = b; }
|
void setAcceptPlayableQueriesOnly( bool b );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
@@ -79,8 +79,8 @@ signals:
|
|||||||
void playlistChanged();
|
void playlistChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool waitForRevision( const QString& revisionguid ) const { return m_waitForRevision.contains( revisionguid ); }
|
bool waitForRevision( const QString& revisionguid ) const;
|
||||||
void removeFromWaitList( const QString& revisionguid ) { m_waitForRevision.removeAll( revisionguid ); }
|
void removeFromWaitList( const QString& revisionguid );
|
||||||
|
|
||||||
QList<Tomahawk::plentry_ptr> playlistEntries() const;
|
QList<Tomahawk::plentry_ptr> playlistEntries() const;
|
||||||
|
|
||||||
|
@@ -55,6 +55,20 @@ TopLovedTracksModel::~TopLovedTracksModel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
TopLovedTracksModel::limit() const
|
||||||
|
{
|
||||||
|
return m_limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TopLovedTracksModel::setLimit( unsigned int limit )
|
||||||
|
{
|
||||||
|
m_limit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TopLovedTracksModel::loadTracks()
|
TopLovedTracksModel::loadTracks()
|
||||||
{
|
{
|
||||||
|
@@ -35,8 +35,8 @@ public:
|
|||||||
explicit TopLovedTracksModel( QObject* parent = 0 );
|
explicit TopLovedTracksModel( QObject* parent = 0 );
|
||||||
~TopLovedTracksModel();
|
~TopLovedTracksModel();
|
||||||
|
|
||||||
unsigned int limit() const { return m_limit; }
|
unsigned int limit() const;
|
||||||
void setLimit( unsigned int limit ) { m_limit = limit; }
|
void setLimit( unsigned int limit );
|
||||||
|
|
||||||
bool isTemporary() const;
|
bool isTemporary() const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user