- Better be safe than sorry. Check MIME type and super type after

constructiuon. Thanks Rene for reminding me that BMimeType actually has a
  InitCheck() method. :)




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27224 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Bruno G. Albuquerque
2008-08-28 17:38:52 +00:00
parent ec56835f51
commit 837057611d
+4 -1
View File
@@ -3239,15 +3239,18 @@ BContainerWindow::AddMimeTypesToMenu(BMenu *menu)
for (int32 index = 0; index < typeCount; index++) {
BMimeType mimeType(PoseView()->MimeTypeAt(index));
if (mimeType.InitCheck() == B_OK) {
BMimeType superType;
mimeType.GetSupertype(&superType);
if (superType.InitCheck() == B_OK) {
BMenu* superMenu = AddMimeMenu(superType, true, menu, start);
if (superMenu != NULL) {
// We have a supertype menu.
AddMimeMenu(mimeType, false, superMenu, 0);
}
}
}
}
// remove empty super menus, promote sub-types if needed