Version: 2.3.0 (using 4.4.1 (KDE 4.4.1) "release 225", KDE:KDE4:Factory:Desktop / openSUSE_11.2) Compiler: gcc OS: Linux (x86_64) release 2.6.31.12-0.1-desktop When starting amarok with lastfm plugin opened (it was opened when u closed amarok last time) lastfm plugin doesn't load info such as favorite artists, neighbors, friends... This bug exists since 2.2
Created attachment 41702 [details] screenshot
Everything works fine here. Are you a last.fm subscriber?
Yes :)
Thank yu for the feedback. Can somebody else reproduce this?
I can, I'll look at it soon.
I fixed this locally, but it won't be in until the release after next.
commit e54907db30e3bd7b59fd3b1dac2386b842e17306 Author: Rick W. Chen <stuffcorpse@archlinux.us> Date: Fri May 28 17:15:47 2010 +1200 Fix Last.fm service browser not updating tree view if it's open upon startup BUG: 231044 diff --git a/ChangeLog b/ChangeLog index a593e92..ce352da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ VERSION 2.3.2-Beta 1 CHANGES: BUGFIXES: + * Fixed Last.fm service browser not updating its view if it's open on + startup. (BR 231044) * Fixed clicking on browser categories not honoring mouse settings. (BR 226533) * Fixed usability issue with regards to context menu item order when right clicking in the playlist widget. (BR 198650) diff --git a/src/services/lastfm/LastFmTreeModel.cpp b/src/services/lastfm/LastFmTreeModel.cpp index b679de3..603e260 100644 --- a/src/services/lastfm/LastFmTreeModel.cpp +++ b/src/services/lastfm/LastFmTreeModel.cpp @@ -241,13 +241,14 @@ LastFmTreeModel::changeData ( int row, T& old_data, const T& new_data ) void LastFmTreeModel::emitRowChanged( int parent_row, int child_row ) { - QModelIndex parent; - if (child_row != -1) - parent = index( parent_row, 0 ); - - QModelIndex i = index( child_row, 0, parent ); - - emit dataChanged( i, i ); + QModelIndex parent = index( parent_row, 0 ); + if( child_row != -1 ) + { + QModelIndex i = index( child_row, 0, parent ); + emit dataChanged( i, i ); + } + else + emit dataChanged( parent, parent ); } @@ -284,8 +285,9 @@ LastFmTreeModel::downloadAvatar ( const QString& user, const KUrl& url ) { // debug() << "downloading " << user << "'s avatar @ " << url; AvatarDownloader* downloader = new AvatarDownloader(); - downloader->downloadAvatar ( user, url ); - connect ( downloader, SIGNAL ( signalAvatarDownloaded ( QPixmap ) ), SLOT ( onAvatarDownloaded ( QPixmap ) ) ); + downloader->downloadAvatar( user, url ); + connect( downloader, SIGNAL(avatarDownloaded(const QString&, QPixmap)), + SLOT(onAvatarDownloaded(const QString&, QPixmap)) ); } void @@ -316,21 +318,14 @@ LastFmTreeModel::prepareAvatar ( QPixmap& avatar, int size ) } void -LastFmTreeModel::onAvatarDownloaded ( QPixmap avatar ) +LastFmTreeModel::onAvatarDownloaded( const QString &username, QPixmap avatar ) { // DEBUG_BLOCK - QString const username = static_cast<AvatarDownloader*> ( sender() )->username(); - - if ( !avatar.isNull() && avatar.height() > 0 && avatar.width() > 0 ) + if( !avatar.isNull() && avatar.height() > 0 && avatar.width() > 0 ) { int m = m_avatarSize; - if ( username.toLower() == m_userName.toLower() ) - { - mAvatar = avatar.scaled ( m, m, Qt::KeepAspectRatio, Qt::SmoothTransformation ); - // emitRowChanged( LastFm::MyProfile ); - } - else + if( username != m_userName ) { avatar = avatar.scaled ( m, m, Qt::KeepAspectRatio, Qt::SmoothTransformation ); diff --git a/src/services/lastfm/LastFmTreeModel.h b/src/services/lastfm/LastFmTreeModel.h index b905d4f..20d3f90 100644 --- a/src/services/lastfm/LastFmTreeModel.h +++ b/src/services/lastfm/LastFmTreeModel.h @@ -46,10 +46,10 @@ enum Type // RecentlyPlayed, // RecentlyLoved, // RecentlyBanned, + TopArtists, MyTags, Friends, Neighbors, - TopArtists, // History, @@ -120,11 +120,11 @@ public: virtual QMimeData* mimeData( const QModelIndexList &indices ) const; private slots: - void onAvatarDownloaded ( QPixmap ); - void slotAddNeighbors (); - void slotAddFriends (); - void slotAddTags (); - void slotAddTopArtists (); + void onAvatarDownloaded( const QString& username, QPixmap ); + void slotAddNeighbors(); + void slotAddFriends(); + void slotAddTags(); + void slotAddTopArtists(); private: void setupModelData( LastFmTreeItem *parent );