diff options
Diffstat (limited to 'amarok/src')
-rw-r--r-- | amarok/src/collectiondb.cpp | 9 | ||||
-rw-r--r-- | amarok/src/collectiondb.h | 3 | ||||
-rw-r--r-- | amarok/src/scrobbler.h | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/amarok/src/collectiondb.cpp b/amarok/src/collectiondb.cpp index 29db57eb..e618ae60 100644 --- a/amarok/src/collectiondb.cpp +++ b/amarok/src/collectiondb.cpp @@ -224,8 +224,8 @@ CollectionDB::CollectionDB() , m_aftEnabledPersistentTables() , m_moveFileJobCancelled( false ) { - // We have our own thread manager - disableThreadPostedEvents(true); + // Enable cross thread requests for scrobbler + connect(this, SIGNAL(startScrobblerSimilarArtistsFetch(const TQString &)), Scrobbler::instance(), SLOT(similarArtists(const TQString &))); DEBUG_BLOCK @@ -4364,8 +4364,9 @@ CollectionDB::similarArtists( const TQString &artist, uint count ) values = query( TQString( "SELECT suggestion FROM related_artists WHERE artist = '%1' ORDER BY %2 LIMIT %3 OFFSET 0;" ) .arg( escapeString( artist ), randomFunc(), TQString::number( count ) ) ); - if ( values.isEmpty() ) - Scrobbler::instance()->similarArtists( artist ); + if ( values.isEmpty() ) { + startScrobblerSimilarArtistsFetch( artist ); + } return values; } diff --git a/amarok/src/collectiondb.h b/amarok/src/collectiondb.h index 8244ed77..b9a42d53 100644 --- a/amarok/src/collectiondb.h +++ b/amarok/src/collectiondb.h @@ -227,6 +227,9 @@ class LIBAMAROK_EXPORT CollectionDB : public TQObject, public EngineObserver void tagsChanged( const TQString &oldArtist, const TQString &oldAlbum ); void imageFetched( const TQString &remoteURL ); //for fetching remote podcast images + // Cross-thread communication + void startScrobblerSimilarArtistsFetch(const TQString &); + public: CollectionDB(); ~CollectionDB(); diff --git a/amarok/src/scrobbler.h b/amarok/src/scrobbler.h index eaa038b7..5fb8e140 100644 --- a/amarok/src/scrobbler.h +++ b/amarok/src/scrobbler.h @@ -34,7 +34,6 @@ class Scrobbler : public TQObject, public EngineObserver public: static Scrobbler *instance(); - void similarArtists( const TQString & /*artist*/ ); void applySettings(); signals: @@ -42,6 +41,7 @@ class Scrobbler : public TQObject, public EngineObserver public slots: void subTrack( long currentPos, long startPos, long endPos ); // cuefiles can update length without track change + void similarArtists( const TQString & /*artist*/ ); protected: Scrobbler(); |