when filtering, we now use GuessMimeType() so that files without BEOS:TYPE set can be scanned as well (the type provided in Filter() is application/octet-stream in this case on R5)
when selected, we only use GuessMimeType() when the type isn't found git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17173 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
dd98ed8dfc
commit
77214f9012
@ -122,6 +122,14 @@ ImageFilePanel::SelectionChanged()
|
||||
mimeType.GetShortDescription(type);
|
||||
// if this fails, the MIME type will be displayed
|
||||
fImageTypeView->SetText(type);
|
||||
} else {
|
||||
BMimeType refType;
|
||||
if (BMimeType::GuessMimeType(&ref, &refType) == B_OK) {
|
||||
refType.GetShortDescription(type);
|
||||
// if this fails, the MIME type will be displayed
|
||||
fImageTypeView->SetText(type);
|
||||
} else
|
||||
fImageTypeView->SetText("");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -156,7 +164,8 @@ CustomRefFilter::Filter(const entry_ref *ref, BNode* node,
|
||||
if (node->IsDirectory())
|
||||
return true;
|
||||
|
||||
BMimeType imageType("image"), refType(filetype);
|
||||
BMimeType imageType("image"), refType;
|
||||
BMimeType::GuessMimeType(ref, &refType);
|
||||
if (imageType.Contains(&refType))
|
||||
return true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user