Bug 229290 - "Add to Playlist" doesn't add playlist file from filebrowser to playlist
Summary: "Add to Playlist" doesn't add playlist file from filebrowser to playlist
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: File Browser (show other bugs)
Version: 2.3-GIT
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 19:53 UTC by Kostya Sha
Modified: 2010-03-15 00:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kostya Sha 2010-03-03 19:53:55 UTC
Steps to reproduce:
1) navigate in filebrowser to catalog with playlist
2) right click on playlist file
3) choose "Add to Playlist" 
Nothing happened. 
P.S. drug'n'drop is working from filebrowser to playlist.
(Build Date: Mar 3 2010)
Comment 1 Myriam Schweingruber 2010-03-03 20:12:51 UTC
Confirmed on current git.
Comment 2 Jakub Wieczorek 2010-03-15 00:10:37 UTC
commit cb3e070f4030836f963bdfba8a4498008003f4d1
Author: Jakub Wieczorek <faw217@gmail.com>
Date:   Mon Mar 15 00:02:10 2010 +0100

    File browser: "Add to Playlist" doesn't add playlist files to the
    playlist.
    
    BUG: 229290

diff --git a/ChangeLog b/ChangeLog
index 43dc098..c9f960b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,8 @@ VERSION 2.3.1-Beta 1
      * Cover fetcher: Fixed a crash involving reappearing cover found dialogs
        and pending cover fetches. (BR 230215)
      * Display tooltips with applet names in the context toolbar. (BR 230736)
+     * File browser: "Add to Playlist" doesn't add playlist files to the playlist.
+       (BR 229290)
 
 
 VERSION 2.3
diff --git a/src/browsers/filebrowser/FileView.cpp b/src/browsers/filebrowser/FileView.cpp
index 3b144b3..312e7b2 100644
--- a/src/browsers/filebrowser/FileView.cpp
+++ b/src/browsers/filebrowser/FileView.cpp
@@ -27,6 +27,7 @@
 #include "DirectoryLoader.h"
 #include "EngineController.h"
 #include "MainWindow.h"
+#include "meta/PlaylistFileSupport.h"
 #include "PaletteHandler.h"
 #include "playlist/PlaylistModelStack.h"
 #include "PopupDropperFactory.h"
@@ -332,11 +333,11 @@ void FileView::addSelectionToPlaylist( bool replace )
         return;
     QList<KUrl> urls;
 
-    foreach( QModelIndex index, indices )
+    foreach( const QModelIndex& index, indices )
     {
         KFileItem file = index.data( KDirModel::FileItemRole ).value<KFileItem>();
         debug() << "file path: " << file.url();
-        if( EngineController::canDecode( file.url() ) || file.isDir() )
+        if( EngineController::canDecode( file.url() ) || Meta::isPlaylist( file.url() ) || file.isDir() )
         {
             urls << file.url();
         }