From e1e2b03bb713abb5535391937df1ad1003924528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 4 Nov 2006 16:22:58 +0000 Subject: [PATCH] * Added TODO comment about missing vector icon support * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19201 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Mime.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/kits/storage/Mime.cpp b/src/kits/storage/Mime.cpp index f8e8f93078..1fdf1f40b8 100644 --- a/src/kits/storage/Mime.cpp +++ b/src/kits/storage/Mime.cpp @@ -1,7 +1,12 @@ -//---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. -//--------------------------------------------------------------------- +/* + * Copyright 2002-2006, Haiku Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Tyler Dauwalder + * Ingo Weinhold, bonefish@users.sf.net + */ + /*! \file Mime.cpp Mime type C functions implementation. @@ -31,7 +36,8 @@ enum { // do_mime_update //! Helper function that contacts the registrar for mime update calls -status_t do_mime_update(int32 what, const char *path, int recursive, +status_t +do_mime_update(int32 what, const char *path, int recursive, int synchronous, int force) { BEntry root; @@ -121,11 +127,11 @@ update_mime_info(const char *path, int recursive, int synchronous, int force) */ status_t create_app_meta_mime(const char *path, int recursive, int synchronous, - int force) + int force) { // If path is NULL, we are recursive, otherwise no. recursive = !path; - + return do_mime_update(B_REG_MIME_CREATE_APP_META_MIME, path, recursive, synchronous, force); } @@ -149,12 +155,11 @@ create_app_meta_mime(const char *path, int recursive, int synchronous, status_t get_device_icon(const char *dev, void *icon, int32 size) { - status_t err = dev && icon - && (size == B_LARGE_ICON || size == B_MINI_ICON) - ? B_OK : B_BAD_VALUE; - + status_t err = dev && icon && (size == B_LARGE_ICON || size == B_MINI_ICON) + ? B_OK : B_BAD_VALUE; + int fd = -1; - + if (!err) { fd = open(dev, O_RDONLY); err = fd != -1 ? B_OK : B_BAD_VALUE; @@ -210,6 +215,7 @@ get_device_icon(const char *dev, BBitmap *icon, icon_size which) && (icon->Bounds() != rect || icon->ColorSpace() != B_CMAP8)) { error = B_BAD_VALUE; } + // TODO: support bitmap with other color spaces! // get the icon if (error == B_OK) error = get_device_icon(dev, icon->Bits(), which);