findDesktopFile - multiple declarations
Function findDesktopFile
Find desktop file by Desktop File ID. Desktop file ID can be ambiguous when it has hyphen symbol, so this function can try both variants.
string findDesktopFile(Range)
(
string desktopId,
Range appsPaths
)
if (isInputRange!Range && is(ElementType!Range : string));
Parameters
Name | Description |
---|---|
desktopId | Desktop file ID. |
appsPaths | Range of base application paths. |
Returns
The first found existing desktop file, or null if could not find any.
Note
This does not ensure that file is valid .desktop file.
See Also
Example
assert(findDesktopFile("not base/path.desktop", ["/usr/share/applications"]) is null);
assert(findDesktopFile("valid.desktop", (string[]) .init) is null);
Function findDesktopFile
ditto
string findDesktopFile
(
string desktopId
) nothrow @trusted;
Note
This function retrieves applications paths each time it's called and therefore can impact performance. To avoid this issue use the overload with argument.