add check for role to data()
[amarok.git] / src / mydirlister.h
blob0afeb696d0946bf41126b0af7953623c6e8df1d2
1 #ifndef MYDIRLISTER_H
2 #define MYDIRLISTER_H
4 //TODO wait for lister to finish, if there are no files shown, but there are
5 // media files in that directory show a longMessage (preferably one that disappears when given a signal)
7 #include "enginecontroller.h"
8 #include "playlistloader.h"
10 #include <kdirlister.h>
11 #include <kfileitem.h>
13 class MyDirLister : public KDirLister {
14 public:
15 MyDirLister( bool delayedMimeTypes ) : KDirLister() { setDelayedMimeTypes( delayedMimeTypes ); }
17 protected:
18 virtual bool matchesMimeFilter( const KFileItem *item ) const {
19 return
20 item->isDir() ||
21 EngineController::canDecode( item->url() ) ||
22 item->url().protocol() == "audiocd" ||
23 PlaylistFile::isPlaylistFile( item->name() ) ||
24 item->name().endsWith( ".mp3", Qt::CaseInsensitive ) || //for now this is less confusing for the user
25 item->name().endsWith( ".aa", Qt::CaseInsensitive ) || //for adding to iPod
26 item->name().endsWith( ".mp4", Qt::CaseInsensitive ) || //for adding to iPod
27 item->name().endsWith( ".m4v", Qt::CaseInsensitive ) || //for adding to iPod
28 item->name().endsWith( ".m4b", Qt::CaseInsensitive ) || //for adding to iPod
29 item->name().endsWith( ".ogg", Qt::CaseInsensitive ) ||
30 item->name().endsWith( ".flac", Qt::CaseInsensitive ) ||
31 item->name().endsWith( ".wma", Qt::CaseInsensitive );
35 #endif