1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-05 08:32:42 +02:00

When getting a query from a result, add the result itself to the query.

Fixes TWK-231
This commit is contained in:
Leo Franchi 2011-06-17 11:43:14 -04:00
parent 19acd9d47f
commit 994ed90ed6
2 changed files with 8 additions and 3 deletions

View File

@ -371,8 +371,10 @@ PlaylistModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int r
Tomahawk::result_ptr* result = reinterpret_cast<Tomahawk::result_ptr*>(qptr);
if ( result && !result->isNull() )
{
qDebug() << "Dropped result item:" << result->data()->artist() << "-" << result->data()->track() << action;
queries << result->data()->toQuery();
qDebug() << "Dropped result item:" << result->data()->artist() << "-" << result->data()->track();
query_ptr q = result->data()->toQuery();
q->addResults( QList< result_ptr >() << *result );
queries << q;
}
}
}

View File

@ -16,6 +16,7 @@
#include "playlistitems.h"
#include "query.h"
#include "utils/tomahawkutils.h"
#include "viewmanager.h"
#include "playlist/dynamic/GeneratorInterface.h"
@ -150,7 +151,9 @@ PlaylistItem::dropMimeData( const QMimeData* data, Qt::DropAction action )
if ( result && !result->isNull() )
{
qDebug() << "Dropped result item:" << result->data()->artist() << "-" << result->data()->track();
queries << result->data()->toQuery();
query_ptr q = result->data()->toQuery();
q->addResults( QList< result_ptr >() << *result );
queries << q;
}
}
}