From 26791a6b964b22762a4375ea2e50ba59802efc5b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 4 May 2008 13:01:11 +0000 Subject: [PATCH] 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 --- src/kits/storage/Mime.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/kits/storage/Mime.cpp b/src/kits/storage/Mime.cpp index 1fdf1f40b8..c53ab2c47a 100644 --- a/src/kits/storage/Mime.cpp +++ b/src/kits/storage/Mime.cpp @@ -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);