From 77214f90121e10616813722a48755450027c00f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 19 Apr 2006 15:28:42 +0000 Subject: [PATCH] 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 --- src/preferences/backgrounds/ImageFilePanel.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/preferences/backgrounds/ImageFilePanel.cpp b/src/preferences/backgrounds/ImageFilePanel.cpp index 279868e6f8..f06160e82c 100644 --- a/src/preferences/backgrounds/ImageFilePanel.cpp +++ b/src/preferences/backgrounds/ImageFilePanel.cpp @@ -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;