Skip to content

Commit da3c45e

Browse files
committed
Update docs
1 parent 1588de8 commit da3c45e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

source/mimeapps.d

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static if (isFreedesktop)
196196
assert(userMimeAppsListPaths() == ["/home/user/config/unity-mimeapps.list", "/home/user/config/gnome-mimeapps.list", "/home/user/config/mimeapps.list"]);
197197
}
198198

199-
/// ditto, but using user-provided desktop prefixes.
199+
/// ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).
200200
@safe string[] userMimeAppsListPaths(const string[] desktopPrefixes) nothrow
201201
{
202202
string[] toReturn;
@@ -233,7 +233,7 @@ static if (isFreedesktop)
233233
assert(userAppDataMimeAppsListPaths() == ["/home/user/data/applications/unity-mimeapps.list", "/home/user/data/applications/gnome-mimeapps.list", "/home/user/data/applications/mimeapps.list"]);
234234
}
235235

236-
/// ditto, but using user-provided desktop prefixes.
236+
/// ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).
237237
@safe string[] userAppDataMimeAppsListPaths(const string[] desktopPrefixes) nothrow
238238
{
239239
string[] toReturn;
@@ -269,7 +269,7 @@ static if (isFreedesktop)
269269
assert(vendorMimeAppsListPaths() == ["/etc/xdg/unity-mimeapps.list", "/etc/xdg/gnome-mimeapps.list", "/etc/xdg/mimeapps.list"]);
270270
}
271271

272-
/// ditto, but using user-provided desktop prefixes.
272+
/// ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).
273273
@safe string[] vendorMimeAppsListPaths(const string[] desktopPrefixes) nothrow
274274
{
275275
string[] toReturn;
@@ -313,7 +313,7 @@ static if (isFreedesktop)
313313
"/usr/local/data/applications/mimeapps.list", "/usr/data/applications/mimeapps.list"]);
314314
}
315315

316-
/// ditto, but using user-provided desktop prefixes.
316+
/// ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).
317317
@safe string[] distributionMimeAppsListPaths(const string[] desktopPrefixes) nothrow
318318
{
319319
string[] toReturn;
@@ -346,7 +346,7 @@ static if (isFreedesktop)
346346
return mimeAppsListPaths(getDesktopPrefixesArray());
347347
}
348348

349-
/// ditto, but using user-provided desktop prefixes.
349+
/// ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).
350350
@safe string[] mimeAppsListPaths(const string[] desktopPrefixes) nothrow
351351
{
352352
return userMimeAppsListPaths(desktopPrefixes) ~ vendorMimeAppsListPaths(desktopPrefixes) ~
@@ -1212,7 +1212,7 @@ if(isForwardRange!ListRange && is(ElementType!ListRange : const(MimeAppsListFile
12121212
* desktopFileProvider = Desktop file provider instance. Must be non-null.
12131213
* Returns: Array of found $(D desktopfile.file.DesktopFile) objects capable of opening file of given MIME type or url of given scheme.
12141214
* Note: If no applications found for this mimeType, you may consider to use this function on parent MIME type.
1215-
* See_Also: $(LINK2 https://specifications.freedesktop.org/mime-apps-spec/latest/ar01s03.html, Adding/removing associations), $(D findKnownAssociatedApplications), $(D listAssociatedApplications)
1215+
* See_Also: $(LINK2 https://specifications.freedesktop.org/mime-apps-spec/latest/ar01s04.html, Adding/removing associations), $(D findKnownAssociatedApplications), $(D listAssociatedApplications)
12161216
*/
12171217
const(DesktopFile)[] findAssociatedApplications(ListRange, CacheRange)(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles, IDesktopFileProvider desktopFileProvider)
12181218
if(isForwardRange!ListRange && is(ElementType!ListRange : const(MimeAppsListFile))
@@ -1274,8 +1274,10 @@ version(mimeappsFileTest) unittest
12741274
* mimeInfoCacheFiles = Range of $(D MimeInfoCacheFile) objects to use in searching.
12751275
* desktopFileProvider = Desktop file provider instance. Must be non-null.
12761276
* Returns: Found $(D desktopfile.file.DesktopFile) or null if not found.
1277-
* Note: You probably will need to call this function on parent MIME type if it fails for original mimeType.
1278-
* See_Also: $(LINK2 https://specifications.freedesktop.org/mime-apps-spec/latest/ar01s04.html, Default Application)
1277+
* Note: You may consider calling this function on parent MIME types (recursively until application is found) if it fails for the original mimeType.
1278+
* Retrieving parent MIME types is out of the scope of this library. $(LINK2 https://github.com/FreeSlave/mime, MIME library) is available for that purpose.
1279+
* Check the $(LINK2 https://github.com/FreeSlave/mimeapps/blob/master/examples/open.d, Open example).
1280+
* See_Also: $(LINK2 https://specifications.freedesktop.org/mime-apps-spec/latest/ar01s03.html, Default Application)
12791281
*/
12801282
const(DesktopFile) findDefaultApplication(ListRange, CacheRange)(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles, IDesktopFileProvider desktopFileProvider)
12811283
if(isForwardRange!ListRange && is(ElementType!ListRange : const(MimeAppsListFile))
@@ -1433,9 +1435,9 @@ static if (isFreedesktop)
14331435
* Change MIME Applications Associations for the current user by applying the provided query.
14341436
*
14351437
* For compatibility purposes it overwrites user overrides in the deprecated location too.
1436-
* It will not overwrite desktop-specific overrides.
14371438
*
14381439
* $(BLUE This function is Freedesktop only).
1440+
* Note: It will not overwrite desktop-specific overrides.
14391441
* See_Also: $(D userMimeAppsListPaths), $(D userAppDataMimeAppsListPaths)
14401442
*/
14411443
@safe void updateAssociations(ref scope const AssociationUpdateQuery query)

0 commit comments

Comments
 (0)