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.

  1. string findDesktopFile(string desktopId, Range appsPaths)
    string
    findDesktopFile
    (
    Range
    )
    (
    string desktopId
    ,
    Range appsPaths
    )
    if (
    isInputRange!Range &&
    is(ElementType!Range : string)
    )
  2. string findDesktopFile(string desktopId)

Parameters

desktopId
Type: string

Desktop file ID.

appsPaths
Type: Range

Range of base application paths.

Return Value

Type: string

The first found existing desktop file, or null if could not find any. Note: This does not ensure that file is valid .desktop file.

Examples

assert(findDesktopFile("not base/path.desktop", ["/usr/share/applications"]) is null);
assert(findDesktopFile("valid.desktop", (string[]).init) is null);

See Also

desktopfile.paths.applicationsPaths

Meta