From 0eafeb995d725fcb74d602fdee799dcdeb8e9503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Lindstr=C3=B6m?= Date: Thu, 12 Apr 2012 18:04:51 +0200 Subject: [PATCH] Added ErrorJob --- src/accounts/spotify/SpotifyAccount.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/accounts/spotify/SpotifyAccount.cpp b/src/accounts/spotify/SpotifyAccount.cpp index 0f157075e..9cc4de8df 100644 --- a/src/accounts/spotify/SpotifyAccount.cpp +++ b/src/accounts/spotify/SpotifyAccount.cpp @@ -27,12 +27,19 @@ #include "utils/tomahawkutils.h" #include "actioncollection.h" +#ifndef ENABLE_HEADLESS +#include "jobview/JobStatusView.h" +#include "jobview/JobStatusModel.h" +#include "jobview/ErrorStatusMessage.h" +#endif #include #include using namespace Tomahawk; using namespace Accounts; +class JobStatusView; +class ErrorStatusMessage; static QPixmap* s_icon = 0; @@ -341,9 +348,10 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg else if( msgType == "spotifyError" ) { const QString error = msg.value( "msg" ).toString(); + if( error.isEmpty() ) + error = "Spotify: Got empty error message...Please report"; - qDebug() << Q_FUNC_INFO << " === GOT ERROR " << error; - /// @todo: send to jobview + JobStatusView::instance()->model()->addJob( new ErrorStatusMessage( QString( "Spotify: %1" ).arg( error ) ) ); } }