Permalink
Browse files

* Fixed usage of new liblastfm.

  • Loading branch information...
1 parent d16c608 commit a9a86f8043ed419b7557e60a8059dae6d79a6940 @muesli muesli committed Jun 11, 2012
View
4 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 );
}
View
4 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;
};
View
2 src/TomahawkApp.h
@@ -64,7 +64,7 @@ namespace Tomahawk
}
#ifdef LIBLASTFM_FOUND
-#include <lastfm/NetworkAccessManager>
+#include <lastfm/NetworkAccessManager.h>
#include "Scrobbler.h"
#endif
View
12 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 )
{
View
10 src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp
@@ -34,7 +34,7 @@
#include "TomahawkSettings.h"
#include <lastfm/ws.h>
-#include <lastfm/XmlQuery>
+#include <lastfm/XmlQuery.h>
#include <qjson/parser.h>
@@ -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,15 +934,16 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply )
QList<lastfm::Track> 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 ) );
}
}
catch ( lastfm::ws::ParseError& e )
{
- qWarning() << e.what();
+ qWarning() << e.message();
}
return tracks;
View
6 src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h
@@ -24,9 +24,9 @@
#include "infosystem/InfoSystemWorker.h"
#include "DllMacro.h"
-#include <lastfm/Track>
-#include <lastfm/Audioscrobbler>
-#include <lastfm/ScrobblePoint>
+#include <lastfm/Track.h>
+#include <lastfm/Audioscrobbler.h>
+#include <lastfm/ScrobblePoint.h>
#include <QObject>

0 comments on commit a9a86f8

Please sign in to comment.