From 021ddf0c3b79c971d8805d31b1aea2845fa3f6a3 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Fri, 10 Dec 2010 11:19:15 +0000 Subject: [PATCH] Use BMimeType to compare type instead of doing it ourself. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39802 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/printers/AddPrinterDialog.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/preferences/printers/AddPrinterDialog.cpp b/src/preferences/printers/AddPrinterDialog.cpp index 6d68bb714a..8eccafb4e3 100644 --- a/src/preferences/printers/AddPrinterDialog.cpp +++ b/src/preferences/printers/AddPrinterDialog.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -320,17 +321,17 @@ AddPrinterDialog::_FillMenu(BMenu* menu, const char* path, uint32 what) char type[B_MIME_TYPE_LENGTH + 1]; info.GetType(type); - BString mimeType(type); - if (mimeType.ICompare(B_APP_MIME_TYPE) != 0) - continue; + BMimeType entryType(type); + // filter non executable entries (like "transport" subfolder...) + if (entryType == B_APP_MIME_TYPE) { + BPath path; + if (entry.GetPath(&path) != B_OK) + continue; - BPath path; - if (entry.GetPath(&path) != B_OK) - continue; - - BMessage* msg = new BMessage(what); - msg->AddString("name", path.Leaf()); - menu->AddItem(new BMenuItem(path.Leaf(), msg)); + BMessage* msg = new BMessage(what); + msg->AddString("name", path.Leaf()); + menu->AddItem(new BMenuItem(path.Leaf(), msg)); + } } } }