@@ -196,7 +196,7 @@ static if (isFreedesktop)
196
196
assert (userMimeAppsListPaths() == [" /home/user/config/unity-mimeapps.list" , " /home/user/config/gnome-mimeapps.list" , " /home/user/config/mimeapps.list" ]);
197
197
}
198
198
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) .
200
200
@safe string [] userMimeAppsListPaths(const string [] desktopPrefixes) nothrow
201
201
{
202
202
string [] toReturn;
@@ -233,7 +233,7 @@ static if (isFreedesktop)
233
233
assert (userAppDataMimeAppsListPaths() == [" /home/user/data/applications/unity-mimeapps.list" , " /home/user/data/applications/gnome-mimeapps.list" , " /home/user/data/applications/mimeapps.list" ]);
234
234
}
235
235
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) .
237
237
@safe string [] userAppDataMimeAppsListPaths(const string [] desktopPrefixes) nothrow
238
238
{
239
239
string [] toReturn;
@@ -269,7 +269,7 @@ static if (isFreedesktop)
269
269
assert (vendorMimeAppsListPaths() == [" /etc/xdg/unity-mimeapps.list" , " /etc/xdg/gnome-mimeapps.list" , " /etc/xdg/mimeapps.list" ]);
270
270
}
271
271
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) .
273
273
@safe string [] vendorMimeAppsListPaths(const string [] desktopPrefixes) nothrow
274
274
{
275
275
string [] toReturn;
@@ -313,7 +313,7 @@ static if (isFreedesktop)
313
313
" /usr/local/data/applications/mimeapps.list" , " /usr/data/applications/mimeapps.list" ]);
314
314
}
315
315
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) .
317
317
@safe string [] distributionMimeAppsListPaths(const string [] desktopPrefixes) nothrow
318
318
{
319
319
string [] toReturn;
@@ -346,7 +346,7 @@ static if (isFreedesktop)
346
346
return mimeAppsListPaths (getDesktopPrefixesArray());
347
347
}
348
348
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) .
350
350
@safe string [] mimeAppsListPaths(const string [] desktopPrefixes) nothrow
351
351
{
352
352
return userMimeAppsListPaths (desktopPrefixes) ~ vendorMimeAppsListPaths(desktopPrefixes) ~
@@ -1212,7 +1212,7 @@ if(isForwardRange!ListRange && is(ElementType!ListRange : const(MimeAppsListFile
1212
1212
* desktopFileProvider = Desktop file provider instance. Must be non-null.
1213
1213
* Returns: Array of found $(D desktopfile.file.DesktopFile) objects capable of opening file of given MIME type or url of given scheme.
1214
1214
* 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)
1216
1216
*/
1217
1217
const (DesktopFile)[] findAssociatedApplications (ListRange, CacheRange)(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles, IDesktopFileProvider desktopFileProvider)
1218
1218
if (isForwardRange! ListRange && is (ElementType! ListRange : const (MimeAppsListFile))
@@ -1274,8 +1274,10 @@ version(mimeappsFileTest) unittest
1274
1274
* mimeInfoCacheFiles = Range of $(D MimeInfoCacheFile) objects to use in searching.
1275
1275
* desktopFileProvider = Desktop file provider instance. Must be non-null.
1276
1276
* 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)
1279
1281
*/
1280
1282
const (DesktopFile) findDefaultApplication (ListRange, CacheRange)(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles, IDesktopFileProvider desktopFileProvider)
1281
1283
if (isForwardRange! ListRange && is (ElementType! ListRange : const (MimeAppsListFile))
@@ -1433,9 +1435,9 @@ static if (isFreedesktop)
1433
1435
* Change MIME Applications Associations for the current user by applying the provided query.
1434
1436
*
1435
1437
* For compatibility purposes it overwrites user overrides in the deprecated location too.
1436
- * It will not overwrite desktop-specific overrides.
1437
1438
*
1438
1439
* $(BLUE This function is Freedesktop only).
1440
+ * Note: It will not overwrite desktop-specific overrides.
1439
1441
* See_Also: $(D userMimeAppsListPaths), $(D userAppDataMimeAppsListPaths)
1440
1442
*/
1441
1443
@safe void updateAssociations(ref scope const AssociationUpdateQuery query)
0 commit comments