- 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:
@@ -3239,13 +3239,16 @@ BContainerWindow::AddMimeTypesToMenu(BMenu *menu)
|
||||
|
||||
for (int32 index = 0; index < typeCount; index++) {
|
||||
BMimeType mimeType(PoseView()->MimeTypeAt(index));
|
||||
BMimeType superType;
|
||||
mimeType.GetSupertype(&superType);
|
||||
|
||||
BMenu* superMenu = AddMimeMenu(superType, true, menu, start);
|
||||
if (superMenu != NULL) {
|
||||
// We have a supertype menu.
|
||||
AddMimeMenu(mimeType, false, superMenu, 0);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user