DesktopEntry.type - multiple declarations

Function DesktopEntry.type

Type of desktop entry.

DesktopEntry.Type type() pure nothrow @nogc @safe const;

Returns

Type of desktop entry.

Example

string contents = "[Desktop Entry]\nType=Application";
auto desktopFile = new DesktopFile(iniLikeStringReader(contents));
assert(desktopFile.type == Type.Application);

desktopFile.desktopEntry.setEscapedValue("Type", "Link");
assert(desktopFile.type == Type.Link);

desktopFile.desktopEntry.setEscapedValue("Type", "Directory");
assert(desktopFile.type == Type.Directory);

Function DesktopEntry.type

Sets "Type" field to type

DesktopEntry.Type type (
  DesktopEntry.Type t
) @safe;

Note

Setting the Type.Unknown removes type field.

Example

auto desktopFile = new DesktopFile();
desktopFile.type = Type.Application;
assert(desktopFile.desktopEntry.escapedValue("Type") == "Application");
desktopFile.type = Type.Link;
assert(desktopFile.desktopEntry.escapedValue("Type") == "Link");
desktopFile.type = Type.Directory;
assert(desktopFile.desktopEntry.escapedValue("Type") == "Directory");

desktopFile.type = Type.Unknown;
assert(desktopFile.desktopEntry.escapedValue("Type").empty);