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

Respect Result::isPreview() in Query::resultSorter.

This commit is contained in:
Christian Muehlhaeuser
2015-04-02 11:13:05 +02:00
parent f23be98cfa
commit 8e9e8400ff

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Uwe L. Korn <uwelk@xhochy.com> * Copyright 2013, Uwe L. Korn <uwelk@xhochy.com>
* *
@@ -409,7 +409,7 @@ Query::resultSorter( const result_ptr& left, const result_ptr& right )
if ( ls == rs ) if ( ls == rs )
{ {
if ( right->purchaseUrl().isEmpty() ) if ( !right->isPreview() )
{ {
return false; return false;
} }
@@ -422,9 +422,9 @@ Query::resultSorter( const result_ptr& left, const result_ptr& right )
return true; return true;
} }
if ( left->purchaseUrl().isEmpty() != right->purchaseUrl().isEmpty() ) if ( left->isPreview() != right->isPreview() )
{ {
return left->purchaseUrl().isEmpty(); return !left->isPreview();
} }
return ls > rs; return ls > rs;