mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
* Updated Inbox to use new API.
This commit is contained in:
parent
3dab38eade
commit
334951e34c
@ -36,7 +36,7 @@ DatabaseCommand_DeleteInboxEntry::exec( DatabaseImpl* dbi )
|
||||
|
||||
Q_ASSERT( !m_query.isNull() );
|
||||
|
||||
if ( m_query->track().isEmpty() || m_query->artist().isEmpty() )
|
||||
if ( m_query->queryTrack()->track().isEmpty() || m_query->queryTrack()->artist().isEmpty() )
|
||||
{
|
||||
emit done();
|
||||
return;
|
||||
@ -51,8 +51,8 @@ DatabaseCommand_DeleteInboxEntry::exec( DatabaseImpl* dbi )
|
||||
") "
|
||||
")" );
|
||||
query.addBindValue( "Inbox" );
|
||||
query.addBindValue( m_query->track() );
|
||||
query.addBindValue( m_query->artist() );
|
||||
query.addBindValue( m_query->queryTrack()->track() );
|
||||
query.addBindValue( m_query->queryTrack()->artist() );
|
||||
|
||||
query.exec();
|
||||
|
||||
|
@ -72,8 +72,10 @@ InboxModel::mergeSocialActions( QList<Tomahawk::SocialAction> first, QList<Tomah
|
||||
|
||||
|
||||
void
|
||||
InboxModel::insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int row )
|
||||
InboxModel::insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int row, const QList< Tomahawk::PlaybackLog >& logs )
|
||||
{
|
||||
Q_UNUSED( logs ); // <- this is merely to silence GCC
|
||||
|
||||
QList< Tomahawk::plentry_ptr > toInsert;
|
||||
for ( QList< Tomahawk::plentry_ptr >::const_iterator it = entries.constBegin();
|
||||
it != entries.constEnd(); ++it )
|
||||
@ -86,8 +88,8 @@ InboxModel::insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int ro
|
||||
if ( entry->query()->equals( existingEntry->query(), true /*ignoreCase*/) )
|
||||
{
|
||||
//We got a dupe, let's merge the social actions
|
||||
entry->query()->setAllSocialActions( mergeSocialActions( existingEntry->query()->allSocialActions(),
|
||||
entry->query()->allSocialActions() ) );
|
||||
entry->query()->track()->setAllSocialActions( mergeSocialActions( existingEntry->query()->track()->allSocialActions(),
|
||||
entry->query()->track()->allSocialActions() ) );
|
||||
toInsert.erase( jt );
|
||||
break;
|
||||
}
|
||||
@ -101,8 +103,8 @@ InboxModel::insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int ro
|
||||
{
|
||||
if ( plEntry->query()->equals( toInsert.at( i )->query(), true ) )
|
||||
{
|
||||
plEntry->query()->setAllSocialActions( mergeSocialActions( plEntry->query()->allSocialActions(),
|
||||
toInsert.at( i )->query()->allSocialActions() ) );
|
||||
plEntry->query()->track()->setAllSocialActions( mergeSocialActions( plEntry->query()->track()->allSocialActions(),
|
||||
toInsert.at( i )->query()->track()->allSocialActions() ) );
|
||||
toInsert.removeAt( i );
|
||||
|
||||
dataChanged( index( playlistEntries().indexOf( plEntry ), 0, QModelIndex() ),
|
||||
@ -187,7 +189,7 @@ InboxModel::tracksLoaded( QList< Tomahawk::query_ptr > incoming )
|
||||
|
||||
QList< Tomahawk::SocialAction > actions;
|
||||
actions << action;
|
||||
newQuery->setAllSocialActions( actions );
|
||||
newQuery->track()->setAllSocialActions( actions );
|
||||
|
||||
newQuery->setProperty( "data", QVariant() ); //clear
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public slots:
|
||||
* On top of PlaylistModel functionality, adds deduplication/grouping of equivalent tracks
|
||||
* sent from different sources.
|
||||
*/
|
||||
virtual void insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int row = 0 );
|
||||
virtual void insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int row = 0, const QList< Tomahawk::PlaybackLog >& logs = QList< Tomahawk::PlaybackLog >() );
|
||||
|
||||
virtual void removeIndex( const QModelIndex &index, bool moreToCome );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user