From 937908766c218a07e189c84c15a82d1ee62c25bd Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 26 Jun 2012 23:14:43 +0200 Subject: [PATCH] * Assert when trying to setup a query without artist or track. --- src/libtomahawk/Query.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libtomahawk/Query.cpp b/src/libtomahawk/Query.cpp index 32b2b77b5..9139115ec 100644 --- a/src/libtomahawk/Query.cpp +++ b/src/libtomahawk/Query.cpp @@ -82,6 +82,9 @@ PlaybackLog::PlaybackLog( const PlaybackLog& other ) query_ptr Query::get( const QString& artist, const QString& track, const QString& album, const QID& qid, bool autoResolve ) { + Q_ASSERT( !artist.trimmed().isEmpty() ); + Q_ASSERT( !track.trimmed().isEmpty() ); + if ( qid.isEmpty() ) autoResolve = false; @@ -98,6 +101,8 @@ Query::get( const QString& artist, const QString& track, const QString& album, c query_ptr Query::get( const QString& query, const QID& qid ) { + Q_ASSERT( !query.trimmed().isEmpty() ); + query_ptr q = query_ptr( new Query( query, qid ), &QObject::deleteLater ); q->setWeakRef( q.toWeakRef() );