MIME type or uri scheme handler in question.
Range of MimeAppsListFile objects to use in searching.
Range of MimeInfoCacheFile objects to use in searching.
Desktop file provider instance. Must be non-null.
Found desktopfile.file.DesktopFile or null if not found. Note: You may consider calling this function on parent MIME types (recursively until application is found) if it fails for the original mimeType. Retrieving parent MIME types is out of the scope of this library. MIME library is available for that purpose. Check the Open example.
auto desktopProvider = new DesktopFileProvider(["test/applications"]); auto mimeAppsList = new MimeAppsListFile("test/applications/mimeapps.list"); auto mimeInfoCache = new MimeInfoCacheFile("test/applications/mimeinfo.cache"); assert(findDefaultApplication("text/plain", [null, mimeAppsList], [null, mimeInfoCache], desktopProvider).displayName() == "Geany"); assert(findDefaultApplication("image/png", [mimeAppsList], [mimeInfoCache], desktopProvider).displayName() == "Gwenview"); assert(findDefaultApplication("application/pdf", [mimeAppsList], [mimeInfoCache], desktopProvider).displayName() == "Okular"); assert(findDefaultApplication("application/nonexistent", [mimeAppsList], [mimeInfoCache], desktopProvider) is null); assert(findDefaultApplication("application/x-data", [mimeAppsList], [mimeInfoCache], desktopProvider) is null);
Find default application for given MIME type.