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
This commit is contained in:
parent
df60b3d51b
commit
021ddf0c3b
@ -22,6 +22,7 @@
|
|||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
|
#include <MimeType.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
|
|
||||||
@ -320,17 +321,17 @@ AddPrinterDialog::_FillMenu(BMenu* menu, const char* path, uint32 what)
|
|||||||
|
|
||||||
char type[B_MIME_TYPE_LENGTH + 1];
|
char type[B_MIME_TYPE_LENGTH + 1];
|
||||||
info.GetType(type);
|
info.GetType(type);
|
||||||
BString mimeType(type);
|
BMimeType entryType(type);
|
||||||
if (mimeType.ICompare(B_APP_MIME_TYPE) != 0)
|
// filter non executable entries (like "transport" subfolder...)
|
||||||
continue;
|
if (entryType == B_APP_MIME_TYPE) {
|
||||||
|
BPath path;
|
||||||
|
if (entry.GetPath(&path) != B_OK)
|
||||||
|
continue;
|
||||||
|
|
||||||
BPath path;
|
BMessage* msg = new BMessage(what);
|
||||||
if (entry.GetPath(&path) != B_OK)
|
msg->AddString("name", path.Leaf());
|
||||||
continue;
|
menu->AddItem(new BMenuItem(path.Leaf(), msg));
|
||||||
|
}
|
||||||
BMessage* msg = new BMessage(what);
|
|
||||||
msg->AddString("name", path.Leaf());
|
|
||||||
menu->AddItem(new BMenuItem(path.Leaf(), msg));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user