Changed the semantics of create_app_meta_mime(): Like update_mime_info()

it does now accept directories and doesn't ignore the "recursive"
parameter anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25308 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-04 13:01:11 +00:00
parent 3a4c7e6e71
commit 26791a6b96

View File

@ -111,11 +111,13 @@ update_mime_info(const char *path, int recursive, int synchronous, int force)
// create_app_meta_mime
/*! Creates a MIME database entry for one or more applications.
\a path should either point to an application file or should be \c NULL.
In the first case a MIME database entry for that application is created,
in the second case entries for all applications are created.
\param path The path to an application file, or \c NULL.
\param recursive Currently unused.
If \a path points to an application file, a MIME DB entry is create for the
application. If it points to a directory and \a recursive is non-null,
entries are created for all application files in the given directory
tree. If path is \c NULL all files are considered; \a recursive is
ignored in this case.
\param path The path to an application file, a directory, or \c NULL.
\param recursive Non-null to trigger recursive behavior.
\param synchronous If non-null create_app_meta_mime() waits until the
operation is finished, otherwise it returns immediately and the
operation is done asynchronously.
@ -129,8 +131,9 @@ status_t
create_app_meta_mime(const char *path, int recursive, int synchronous,
int force)
{
// If path is NULL, we are recursive, otherwise no.
recursive = !path;
// Force recursion when given a NULL path
if (!path)
recursive = true;
return do_mime_update(B_REG_MIME_CREATE_APP_META_MIME, path, recursive,
synchronous, force);