[haiku-development] Re: New Diff to Media player

Fredrik Modéen <fredrik@xxxxxxxxx> wrote:
> I hope my diffs aren't to small and that I should wait until making 
> more
> changes.

+/*static*/ BString
+Playlist::_ReturnMiMEString(const BEntry *entry)
+{
+       BFile file(entry, B_READ_ONLY);
+       BNodeInfo nodeInfo(&file);
+       char mimeString[B_MIME_TYPE_LENGTH];        
+       if (nodeInfo.GetType(mimeString) == B_OK)
+               return BString(mimeString);     
+       else
+               return NULL;
+}

Three things:
1) it's either MIME or Mime, but not MiME - it stands for Multipurpose 
Internet Mail Extensions
2) You didn't take the GuessMimeType() into account as I proposed 
earlier; this would prevent the player from accepting files on CDs and 
DVDs, for example.
3) it makes more sense to pass a BString reference to this method, as 
you'll then save an unnecessary copy.

Bye,
   Axel.



Other related posts: