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