1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 08:19:42 +01:00

Sort playlists above stations

and the + items last
This commit is contained in:
Leo Franchi 2011-05-19 16:54:05 -04:00
parent 234fdf07ba
commit d0e50a73f0
2 changed files with 9 additions and 2 deletions

View File

@ -132,6 +132,12 @@ CategoryAddItem::dropMimeData( const QMimeData* data, Qt::DropAction action )
return false;
}
int
CategoryAddItem::peerSortValue() const
{
return INT_MAX; // after any siblings
}
/// CategoryItem
@ -173,9 +179,9 @@ int
CategoryItem::peerSortValue() const
{
if( m_category == SourcesModel::PlaylistsCategory )
return 100;
else if( m_category == SourcesModel::StationsCategory )
return -100;
else if( m_category == SourcesModel::StationsCategory )
return 100;
else
return 0;
}

View File

@ -30,6 +30,7 @@ public:
virtual QString text() const;
virtual void activate();
virtual QIcon icon() const;
virtual int peerSortValue() const;
virtual bool willAcceptDrag(const QMimeData* data) const;
virtual bool dropMimeData(const QMimeData* data, Qt::DropAction action);