From 62812a05f67589e3192440b990529b0dae884137 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 31 Mar 2015 08:50:20 +0200 Subject: [PATCH] Fixed Query::resultSorter to take previews into account. --- src/libtomahawk/Query.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/Query.cpp b/src/libtomahawk/Query.cpp index c3a8e92a1..c8f6cfef1 100644 --- a/src/libtomahawk/Query.cpp +++ b/src/libtomahawk/Query.cpp @@ -409,10 +409,11 @@ Query::resultSorter( const result_ptr& left, const result_ptr& right ) if ( ls == rs ) { -/* if ( left->collection() && left->collection()->isLocal() ) + if ( right->purchaseUrl().isEmpty() ) { - return true; - }*/ + return false; + } + if ( right->resolvedByCollection() && right->resolvedByCollection()->isLocal() ) { return false; @@ -421,6 +422,11 @@ Query::resultSorter( const result_ptr& left, const result_ptr& right ) return true; } + if ( left->purchaseUrl().isEmpty() != right->purchaseUrl().isEmpty() ) + { + return left->purchaseUrl().isEmpty(); + } + return ls > rs; }