Bug 140197 - 'del' doesn't work in the main playlist after right-clicking in files browser
Summary: 'del' doesn't work in the main playlist after right-clicking in files browser
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 17:18 UTC by richlv
Modified: 2007-01-22 06:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description richlv 2007-01-17 17:18:16 UTC
Version:           svn 623546 (using KDE KDE 3.5.4)
Installed from:    Slackware Packages
OS:                Linux

have some track in the playlist, go to 'files' browser.
right click on any file, dismiss the menu.

attempt to delete any track in the main playlist with keyboard key 'delete/del' - it does not work anymore.

restarting amarok or switching to another browser makes 'del' work again (but switching to files browser in the same session makes it unusable again)
Comment 1 Ian Monroe 2007-01-22 06:27:52 UTC
SVN commit 626089 by ianmonroe:

Fixed regression: the DEL key no longer worked in the
playlist after opening the File Browser context menu. 

BUG: 140197


 M  +2 -0      ChangeLog  
 M  +15 -10    src/mydiroperator.cpp  
 M  +2 -0      src/mydiroperator.h  


--- trunk/extragear/multimedia/amarok/ChangeLog #626088:626089
@@ -98,6 +98,8 @@
     * Amarok now saves playlists with relative paths by default.
 
   BUGFIXES:
+    * Fixed regression: the DEL key no longer worked in the 
+      playlist after opening the File Browser context menu. (BR 140197)
     * Smart playlists now work correctly with "is not" filters containing
       numbers. Patch by Felix Rotthowe <felix.rotthowe@cs.uni-dortmund.de>. 
     * Context browser would not display updated covers correctly. (BR 130518)
--- trunk/extragear/multimedia/amarok/src/mydiroperator.cpp #626088:626089
@@ -9,16 +9,7 @@
 {
     m_medium = medium;
     setDirLister( new MyDirLister( true ) );
-    //the delete key event was being eaten with the file browser open
-    //so folks couldn't use the del key to remove items from the playlist
-    //refer to KDirOperator::setupActions() to understand this code
-    KActionCollection* dirActionCollection = static_cast<KActionCollection*>(KDirOperator::child("KDirOperator::myActionCollection"));
-    if(dirActionCollection)
-    {
-        KAction* trash = dirActionCollection->action("trash");
-        if(trash)
-            trash->setEnabled(false);
-    }
+    reenableDeleteKey();
 }
 
 void
@@ -39,4 +30,18 @@
     setURL(tmp, true);
 }
 
+
+//BEGIN private methods
+void
+MyDirOperator::reenableDeleteKey()
+{
+    KActionCollection* dirActionCollection = static_cast<KActionCollection*>(KDirOperator::child("KDirOperator::myActionCollection"));
+    if( dirActionCollection )
+    {
+        KAction* trash = dirActionCollection->action("trash");
+        if(trash)
+            trash->setEnabled(false);
+    }
+}
+//END private methods
 #include "mydiroperator.moc"
--- trunk/extragear/multimedia/amarok/src/mydiroperator.h #626088:626089
@@ -20,12 +20,14 @@
         //reimplemented due to a bug in KDirOperator::activatedMenu ( KDE 3.4.2 ) - See Bug #103305
         virtual void activatedMenu (const KFileItem *, const QPoint &pos) {
             updateSelectionDependentActions();
+            reenableDeleteKey();
             static_cast<KActionMenu*>(actionCollection()->action("popupMenu"))->popupMenu()->popup( pos );
         }
         void myHome();
         void myCdUp();
 
     private:
+        void reenableDeleteKey();
     Medium *m_medium;
 
 };