1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-23 01:09:42 +01:00

* Style fixes for a few DbCmds.

This commit is contained in:
Christian Muehlhaeuser 2012-12-03 16:39:40 +01:00
parent 03bf80352c
commit 7de07aabbf
3 changed files with 7 additions and 7 deletions

View File

@ -27,7 +27,7 @@
#include "utils/Logger.h"
DatabaseCommand_AllArtists::DatabaseCommand_AllArtists( const Tomahawk::collection_ptr &collection, QObject *parent )
DatabaseCommand_AllArtists::DatabaseCommand_AllArtists( const Tomahawk::collection_ptr& collection, QObject* parent )
: DatabaseCommand( parent )
, m_collection( collection )
, m_amount( 0 )
@ -46,7 +46,6 @@ void
DatabaseCommand_AllArtists::exec( DatabaseImpl* dbi )
{
TomahawkSqlQuery query = dbi->newquery();
QList<Tomahawk::artist_ptr> al;
QString orderToken, sourceToken, filterToken, tables, joins;
switch ( m_sortOrder )
@ -95,10 +94,10 @@ DatabaseCommand_AllArtists::exec( DatabaseImpl* dbi )
query.prepare( sql );
query.exec();
while( query.next() )
QList<Tomahawk::artist_ptr> al;
while ( query.next() )
{
Tomahawk::artist_ptr artist = Tomahawk::Artist::get( query.value( 0 ).toUInt(), query.value( 1 ).toString() );
al << artist;
}

View File

@ -33,7 +33,8 @@ class DLLEXPORT DatabaseCommand_AllArtists : public DatabaseCommand
{
Q_OBJECT
public:
enum SortOrder {
enum SortOrder
{
None = 0,
ModificationTime = 1
};

View File

@ -30,9 +30,8 @@ void
DatabaseCommand_PlaybackHistory::exec( DatabaseImpl* dbi )
{
TomahawkSqlQuery query = dbi->newquery();
QList<Tomahawk::query_ptr> ql;
QString whereToken;
if ( !source().isNull() )
{
whereToken = QString( "WHERE source %1" ).arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) );
@ -49,6 +48,7 @@ DatabaseCommand_PlaybackHistory::exec( DatabaseImpl* dbi )
query.prepare( sql );
query.exec();
QList<Tomahawk::query_ptr> ql;
while ( query.next() )
{
TomahawkSqlQuery query_track = dbi->newquery();