Bug 140588

Summary: Refresh context menu after updating collection
Product: [Applications] amarok Reporter: Matt Howe <mdhowe>
Component: generalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: wishlist CC: richlv
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Matt Howe 2007-01-25 06:05:58 UTC
Version:           SVN (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages
OS:                Linux

It would be nice if the context menu refreshed after updating the collection, so new albums appear in the 'Your Newest Albums' section.
Comment 1 Martin Aumueller 2007-01-28 02:57:45 UTC
SVN commit 627767 by aumuell:

update context browser after collection scan
BUG: 140588


 M  +2 -0      ChangeLog  
 M  +7 -2      src/contextbrowser.cpp  
 M  +1 -1      src/contextbrowser.h  


--- trunk/extragear/multimedia/amarok/ChangeLog #627766:627767
@@ -47,6 +47,8 @@
       you move and rename them.
 
   CHANGES:
+    * Update context browser when a change in the collection has been detected.
+      (BR 140588)
     * Ignore leading 'The ' when sorting playlist by artist. (BR 139829)
     * Smart Playlists now have 'does not start with' and 'does not end with' 
       options, as well as a dropdown for mount points. (BR 139552)
--- trunk/extragear/multimedia/amarok/src/contextbrowser.cpp #627766:627767
@@ -344,7 +344,7 @@
     connect( m_wikiForwardPopup, SIGNAL(activated( int )), SLOT(wikiForwardPopupActivated( int )) );
 
     connect( CollectionDB::instance(), SIGNAL( scanStarted() ), SLOT( collectionScanStarted() ) );
-    connect( CollectionDB::instance(), SIGNAL( scanDone( bool ) ), SLOT( collectionScanDone() ) );
+    connect( CollectionDB::instance(), SIGNAL( scanDone( bool ) ), SLOT( collectionScanDone( bool ) ) );
     connect( CollectionDB::instance(), SIGNAL( databaseEngineChanged() ), SLOT( renderView() ) );
     connect( CollectionDB::instance(), SIGNAL( coverFetched( const QString&, const QString& ) ),
              this, SLOT( coverFetched( const QString&, const QString& ) ) );
@@ -573,7 +573,7 @@
 }
 
 
-void ContextBrowser::collectionScanDone()
+void ContextBrowser::collectionScanDone( bool changed )
 {
     if ( CollectionDB::instance()->isEmpty() )
     {
@@ -586,6 +586,11 @@
         m_emptyDB = false;
         PlaylistWindow::self()->showBrowser("CollectionBrowser");
     }
+    else if( changed && currentPage() == m_contextTab )
+    {
+        m_dirtyCurrentTrackPage = true;
+        showCurrentTrack();
+    }
 }
 
 
--- trunk/extragear/multimedia/amarok/src/contextbrowser.h #627766:627767
@@ -61,7 +61,7 @@
     public slots:
         void openURLRequest(const KURL &url );
         void collectionScanStarted();
-        void collectionScanDone();
+        void collectionScanDone( bool changed );
         void renderView();
         void lyricsChanged( const QString& );
         void lyricsScriptChanged();
Comment 2 Matt Howe 2007-01-28 03:00:54 UTC
Thanks for the quick resolution!
Comment 3 Martin Aumueller 2007-01-29 09:27:19 UTC
*** Bug 128442 has been marked as a duplicate of this bug. ***