From a9a86f8043ed419b7557e60a8059dae6d79a6940 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 11 Jun 2012 21:14:21 +0200 Subject: [PATCH] * Fixed usage of new liblastfm. --- src/Scrobbler.cpp | 4 ++-- src/Scrobbler.h | 4 ++-- src/TomahawkApp.h | 2 +- src/libtomahawk/accounts/lastfm/LastFmConfig.cpp | 12 +++++++----- src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp | 10 ++++++---- src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h | 6 +++--- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/Scrobbler.cpp b/src/Scrobbler.cpp index 8c32851616..6e1b77bc32 100644 --- a/src/Scrobbler.cpp +++ b/src/Scrobbler.cpp @@ -99,9 +99,9 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track ) // liblastfm forces 0-length tracks to scrobble after 4 minutes, stupid. if ( track->duration() == 0 ) - m_scrobblePoint = ScrobblePoint( 30 ); + m_scrobblePoint = lastfm::ScrobblePoint( 30 ); else - m_scrobblePoint = ScrobblePoint( track->duration() / 2 ); + m_scrobblePoint = lastfm::ScrobblePoint( track->duration() / 2 ); } diff --git a/src/Scrobbler.h b/src/Scrobbler.h index d47e34d1fe..5d92bfbb11 100644 --- a/src/Scrobbler.h +++ b/src/Scrobbler.h @@ -20,7 +20,7 @@ #ifndef TOMAHAWK_SCROBBLER_H #define TOMAHAWK_SCROBBLER_H -#include "lastfm/ScrobblePoint" +#include "lastfm/ScrobblePoint.h" #include "Result.h" #include "infosystem/InfoSystem.h" @@ -51,7 +51,7 @@ public slots: void scrobble(); bool m_reachedScrobblePoint; - ScrobblePoint m_scrobblePoint; + lastfm::ScrobblePoint m_scrobblePoint; }; diff --git a/src/TomahawkApp.h b/src/TomahawkApp.h index 41cfae3a9d..417bc30945 100644 --- a/src/TomahawkApp.h +++ b/src/TomahawkApp.h @@ -64,7 +64,7 @@ namespace Tomahawk } #ifdef LIBLASTFM_FOUND -#include +#include #include "Scrobbler.h" #endif diff --git a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp index c9fdcf357f..354f6b92e3 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp +++ b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp @@ -25,8 +25,8 @@ #include "utils/TomahawkUtils.h" #include "utils/Logger.h" #include "lastfm/ws.h" -#include "lastfm/User" -#include "lastfm/XmlQuery" +#include "lastfm/User.h" +#include "lastfm/XmlQuery.h" using namespace Tomahawk::Accounts; @@ -135,7 +135,8 @@ LastFmConfig::onHistoryLoaded() try { - lastfm::XmlQuery lfm = reply->readAll(); + lastfm::XmlQuery lfm; + lfm.parse( reply->readAll() ); foreach ( lastfm::XmlQuery e, lfm.children( "track" ) ) { @@ -170,7 +171,7 @@ LastFmConfig::onHistoryLoaded() } catch( lastfm::ws::ParseError e ) { - tDebug() << "XmlQuery error:" << e.what(); + tDebug() << "XmlQuery error:" << e.message(); finished = true; } @@ -200,7 +201,8 @@ LastFmConfig::onLastFmFinished() } if( authJob->error() == QNetworkReply::NoError ) { - lastfm::XmlQuery lfm = lastfm::XmlQuery( authJob->readAll() ); + lastfm::XmlQuery lfm; + lfm.parse( authJob->readAll() ); if( lfm.children( "error" ).size() > 0 ) { diff --git a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp index 30aed0d060..40f67a9e7b 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp +++ b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp @@ -34,7 +34,7 @@ #include "TomahawkSettings.h" #include -#include +#include #include @@ -871,7 +871,8 @@ LastFmInfoPlugin::onAuthenticated() if ( authJob->error() == QNetworkReply::NoError ) { - lastfm::XmlQuery lfm = lastfm::XmlQuery( authJob->readAll() ); + lastfm::XmlQuery lfm; + lfm.parse( authJob->readAll() ); if ( lfm.children( "error" ).size() > 0 ) { @@ -933,7 +934,8 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply ) QList tracks; try { - lastfm::XmlQuery lfm = reply->readAll(); + lastfm::XmlQuery lfm; + lfm.parse( reply->readAll() ); foreach ( lastfm::XmlQuery xq, lfm.children( "track" ) ) { tracks.append( lastfm::Track( xq ) ); @@ -941,7 +943,7 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply ) } catch ( lastfm::ws::ParseError& e ) { - qWarning() << e.what(); + qWarning() << e.message(); } return tracks; diff --git a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h index f744c740ef..f8bbacd178 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h +++ b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h @@ -24,9 +24,9 @@ #include "infosystem/InfoSystemWorker.h" #include "DllMacro.h" -#include -#include -#include +#include +#include +#include #include