* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -463,22 +463,25 @@ Playlist::AppendToPlaylistRecursive(const entry_ref& ref, Playlist* playlist)
|
|||||||
{
|
{
|
||||||
// recursively append the ref (dive into folders)
|
// recursively append the ref (dive into folders)
|
||||||
BEntry entry(&ref, true);
|
BEntry entry(&ref, true);
|
||||||
if (entry.InitCheck() < B_OK || !entry.Exists())
|
if (entry.InitCheck() != B_OK || !entry.Exists())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (entry.IsDirectory()) {
|
if (entry.IsDirectory()) {
|
||||||
BDirectory dir(&entry);
|
BDirectory dir(&entry);
|
||||||
if (dir.InitCheck() < B_OK)
|
if (dir.InitCheck() != B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
entry.Unset();
|
entry.Unset();
|
||||||
|
|
||||||
entry_ref subRef;
|
entry_ref subRef;
|
||||||
while (dir.GetNextRef(&subRef) == B_OK)
|
while (dir.GetNextRef(&subRef) == B_OK) {
|
||||||
AppendToPlaylistRecursive(subRef, playlist);
|
AppendToPlaylistRecursive(subRef, playlist);
|
||||||
|
}
|
||||||
} else if (entry.IsFile()) {
|
} else if (entry.IsFile()) {
|
||||||
BString mimeString = _MIMEString(&ref);
|
BString mimeString = _MIMEString(&ref);
|
||||||
if (_IsMediaFile(mimeString)) {
|
if (_IsMediaFile(mimeString)) {
|
||||||
PlaylistItem* item = new (std::nothrow) FilePlaylistItem(ref);
|
PlaylistItem* item = new (std::nothrow) FilePlaylistItem(ref);
|
||||||
if (item == NULL || !playlist->AddItem(item))
|
if (item != NULL && !playlist->AddItem(item))
|
||||||
delete item;
|
delete item;
|
||||||
} else
|
} else
|
||||||
printf("MIME Type = %s\n", mimeString.String());
|
printf("MIME Type = %s\n", mimeString.String());
|
||||||
@@ -490,7 +493,7 @@ Playlist::AppendToPlaylistRecursive(const entry_ref& ref, Playlist* playlist)
|
|||||||
Playlist::AppendPlaylistToPlaylist(const entry_ref& ref, Playlist* playlist)
|
Playlist::AppendPlaylistToPlaylist(const entry_ref& ref, Playlist* playlist)
|
||||||
{
|
{
|
||||||
BEntry entry(&ref, true);
|
BEntry entry(&ref, true);
|
||||||
if (entry.InitCheck() < B_OK || !entry.Exists())
|
if (entry.InitCheck() != B_OK || !entry.Exists())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BString mimeString = _MIMEString(&ref);
|
BString mimeString = _MIMEString(&ref);
|
||||||
|
|||||||
@@ -97,6 +97,10 @@ public:
|
|||||||
Playlist* playlist);
|
Playlist* playlist);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Playlist(const Playlist& other);
|
||||||
|
Playlist& operator=(const Playlist& other);
|
||||||
|
// unimplemented
|
||||||
|
|
||||||
static bool _IsMediaFile(const BString& mimeString);
|
static bool _IsMediaFile(const BString& mimeString);
|
||||||
static bool _IsTextPlaylist(const BString& mimeString);
|
static bool _IsTextPlaylist(const BString& mimeString);
|
||||||
static bool _IsBinaryPlaylist(const BString& mimeString);
|
static bool _IsBinaryPlaylist(const BString& mimeString);
|
||||||
|
|||||||
Reference in New Issue
Block a user