[haiku-commits] r33584 - haiku/trunk/src/apps/mediaplayer/playlist

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 14 Oct 2009 14:23:48 +0200 (CEST)

Author: axeld
Date: 2009-10-14 14:23:48 +0200 (Wed, 14 Oct 2009)
New Revision: 33584
Changeset: http://dev.haiku-os.org/changeset/33584/haiku

Modified:
   haiku/trunk/src/apps/mediaplayer/playlist/Playlist.cpp
   haiku/trunk/src/apps/mediaplayer/playlist/Playlist.h
Log:
* Minor cleanup.


Modified: haiku/trunk/src/apps/mediaplayer/playlist/Playlist.cpp
===================================================================
--- haiku/trunk/src/apps/mediaplayer/playlist/Playlist.cpp      2009-10-14 
12:12:52 UTC (rev 33583)
+++ haiku/trunk/src/apps/mediaplayer/playlist/Playlist.cpp      2009-10-14 
12:23:48 UTC (rev 33584)
@@ -463,22 +463,25 @@
 {
        // recursively append the ref (dive into folders)
        BEntry entry(&ref, true);
-       if (entry.InitCheck() < B_OK || !entry.Exists())
+       if (entry.InitCheck() != B_OK || !entry.Exists())
                return;
 
        if (entry.IsDirectory()) {
                BDirectory dir(&entry);
-               if (dir.InitCheck() < B_OK)
+               if (dir.InitCheck() != B_OK)
                        return;
+
                entry.Unset();
+
                entry_ref subRef;
-               while (dir.GetNextRef(&subRef) == B_OK)
+               while (dir.GetNextRef(&subRef) == B_OK) {
                        AppendToPlaylistRecursive(subRef, playlist);
+               }
        } else if (entry.IsFile()) {
                BString mimeString = _MIMEString(&ref);
                if (_IsMediaFile(mimeString)) {
                        PlaylistItem* item = new (std::nothrow) 
FilePlaylistItem(ref);
-                       if (item == NULL || !playlist->AddItem(item))
+                       if (item != NULL && !playlist->AddItem(item))
                                delete item;
                } else
                        printf("MIME Type = %s\n", mimeString.String());
@@ -490,7 +493,7 @@
 Playlist::AppendPlaylistToPlaylist(const entry_ref& ref, Playlist* playlist)
 {
        BEntry entry(&ref, true);
-       if (entry.InitCheck() < B_OK || !entry.Exists())
+       if (entry.InitCheck() != B_OK || !entry.Exists())
                return;
 
        BString mimeString = _MIMEString(&ref);

Modified: haiku/trunk/src/apps/mediaplayer/playlist/Playlist.h
===================================================================
--- haiku/trunk/src/apps/mediaplayer/playlist/Playlist.h        2009-10-14 
12:12:52 UTC (rev 33583)
+++ haiku/trunk/src/apps/mediaplayer/playlist/Playlist.h        2009-10-14 
12:23:48 UTC (rev 33584)
@@ -97,6 +97,10 @@
                                                                        
Playlist* playlist);
 
 private:
+                                                               Playlist(const 
Playlist& other);
+                       Playlist&                       operator=(const 
Playlist& other);
+                                                                       // 
unimplemented
+
        static  bool                            _IsMediaFile(const BString& 
mimeString);
        static  bool                            _IsTextPlaylist(const BString& 
mimeString);
        static  bool                            _IsBinaryPlaylist(const 
BString& mimeString);


Other related posts: