DesktopAppInfo

GDesktopAppInfo is an implementation of GAppInfo based on desktop files.

Note that <gio/gdesktopappinfo.h> belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

Constructors

this
this(GDesktopAppInfo* gDesktopAppInfo, bool ownedRef = false)

Sets our main struct and passes it to the parent class.

this
this(string desktopId)

Creates a new GDesktopAppInfo based on a desktop file id.

this
this(KeyFile keyFile)

Creates a new GDesktopAppInfo

Members

Functions

getActionName
string getActionName(string actionName)

Gets the user-visible display name of the "additional application action" specified by action_name.

getBoolean
bool getBoolean(string key)

Looks up a boolean value in the keyfile backing info.

getCategories
string getCategories()

Gets the categories from the desktop file.

getDesktopAppInfoStruct
GDesktopAppInfo* getDesktopAppInfoStruct(bool transferOwnership = false)

Get the main Gtk struct

getFilename
string getFilename()

When info was created from a known filename, return it. In some situations such as the GDesktopAppInfo returned from g_desktop_app_info_new_from_keyfile(), this function will return NULL.

getGenericName
string getGenericName()

Gets the generic name from the destkop file.

getIsHidden
bool getIsHidden()

A desktop file is hidden if the Hidden key in it is set to True.

getKeywords
string[] getKeywords()

Gets the keywords from the desktop file.

getLocaleString
string getLocaleString(string key)

Looks up a localized string value in the keyfile backing info translated to the current locale.

getNodisplay
bool getNodisplay()

Gets the value of the NoDisplay key, which helps determine if the application info should be shown in menus. See G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().

getShowIn
bool getShowIn(string desktopEnv)

Checks if the application info should be shown in menus that list available applications for a specific name of the desktop, based on the OnlyShowIn and NotShowIn keys.

getStartupWmClass
string getStartupWmClass()

Retrieves the StartupWMClass field from info. This represents the WM_CLASS property of the main window of the application, if launched through info.

getString
string getString(string key)

Looks up a string value in the keyfile backing info.

getStringList
string[] getStringList(string key)

Looks up a string list value in the keyfile backing info.

getStruct
void* getStruct()

the main Gtk struct as a void*

hasKey
bool hasKey(string key)

Returns whether key exists in the "Desktop Entry" group of the keyfile backing info.

launchAction
void launchAction(string actionName, AppLaunchContext launchContext)

Activates the named application action.

launchUrisAsManager
bool launchUrisAsManager(ListG uris, AppLaunchContext launchContext, GSpawnFlags spawnFlags, GSpawnChildSetupFunc userSetup, void* userSetupData, GDesktopAppLaunchCallback pidCallback, void* pidCallbackData)

This function performs the equivalent of g_app_info_launch_uris(), but is intended primarily for operating system components that launch applications. Ordinary applications should use g_app_info_launch_uris().

launchUrisAsManagerWithFds
bool launchUrisAsManagerWithFds(ListG uris, AppLaunchContext launchContext, GSpawnFlags spawnFlags, GSpawnChildSetupFunc userSetup, void* userSetupData, GDesktopAppLaunchCallback pidCallback, void* pidCallbackData, int stdinFd, int stdoutFd, int stderrFd)

Equivalent to g_desktop_app_info_launch_uris_as_manager() but allows you to pass in file descriptors for the stdin, stdout and stderr streams of the launched process.

listActions
string[] listActions()

Returns the list of "additional application actions" supported on the desktop file, as per the desktop file specification.

Static functions

createFromFilename
DesktopAppInfo createFromFilename(string filename)

Creates a new GDesktopAppInfo

getImplementations
ListG getImplementations(string interface_)

Gets all applications that implement interface.

getType
GType getType()
search
string[][] search(string searchString)

Searches desktop files for ones that match search_string.

setDesktopEnv
void setDesktopEnv(string desktopEnv)

Sets the name of the desktop that the application is running in. This is used by g_app_info_should_show() and g_desktop_app_info_get_show_in() to evaluate the OnlyShowIn and NotShowIn desktop entry fields.

Variables

gDesktopAppInfo
GDesktopAppInfo* gDesktopAppInfo;

the main Gtk struct