mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
When getting a query from a result, add the result itself to the query.
Fixes TWK-231
This commit is contained in:
@@ -371,8 +371,10 @@ PlaylistModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int r
|
|||||||
Tomahawk::result_ptr* result = reinterpret_cast<Tomahawk::result_ptr*>(qptr);
|
Tomahawk::result_ptr* result = reinterpret_cast<Tomahawk::result_ptr*>(qptr);
|
||||||
if ( result && !result->isNull() )
|
if ( result && !result->isNull() )
|
||||||
{
|
{
|
||||||
qDebug() << "Dropped result item:" << result->data()->artist() << "-" << result->data()->track() << action;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "playlistitems.h"
|
#include "playlistitems.h"
|
||||||
|
|
||||||
|
#include "query.h"
|
||||||
#include "utils/tomahawkutils.h"
|
#include "utils/tomahawkutils.h"
|
||||||
#include "viewmanager.h"
|
#include "viewmanager.h"
|
||||||
#include "playlist/dynamic/GeneratorInterface.h"
|
#include "playlist/dynamic/GeneratorInterface.h"
|
||||||
@@ -150,7 +151,9 @@ PlaylistItem::dropMimeData( const QMimeData* data, Qt::DropAction action )
|
|||||||
if ( result && !result->isNull() )
|
if ( result && !result->isNull() )
|
||||||
{
|
{
|
||||||
qDebug() << "Dropped result item:" << result->data()->artist() << "-" << result->data()->track();
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user