Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login

GLib::DesktopAppInfo

class GLib::DesktopAppInfo

GLib::DesktopAppInfo is an implementation of GLib::AppInfo based on desktop files.

Note that GLib::DesktopAppInfo belongs to the Unix-specific GIO interfaces.

Class Methods

GLib::DesktopAppInfo.desktop_env=(desktop_env)
Same as GLib::DesktopAppInfo#set_desktop_env.
  • Returns: desktop_env
GLib::DesktopAppInfo.new(desktop_id)

Creates a new GLib::DesktopAppInfo based on a desktop file ID.

A desktop file ID is the basename of the desktop file, including the .desktop extension. GIO is looking for a desktop file with this name in the applications subdirectories of the XDG data directories (that is, the directories specified in the XDG_DATA_HOME and XDG_DATA_DIRS environment variables). GIO also supports the prefix-to-subdirectory mapping that is described in the Menu Spec (that is, a desktop ID of kde-foo.desktop will match /usr/share/applications/kde/foo.desktop}.

  • desktop_id: The desktop file ID
  • Returns: A new GLib::DesktopAppInfo, or nil if no desktop file with that ID exists
GLib::DesktopAppInfo.new_from_filename(filename)
Creates a new GLib::DesktopAppInfo.
  • filename: The path of a desktop file, in the GLib filename encoding
  • Returns: a new GLib::DesktopAppInfo, or nil on error
GLib::DesktopAppInfo.new_from_keyfile(keyfile)
Creates a new GLib::DesktopAppInfo.
GLib::DesktopAppInfo.set_desktop_env(desktop_env)

Sets the name of the desktop that the application is running in. This is used by GLib::AppInfo#should_show? to evaluate the OnlyShowIn and NotShowIn desktop entry fields.

The Desktop Menu specification recognizes the following values for desktop_env:

  • GNOME
  • KDE
  • ROX
  • XFCE
  • Old

This method should only be called once; subsequent calls are ignored.

  • desktop_env: A String specifying what desktop this is
  • Returns: self
Last modified:2010/12/28 23:35:13
Keyword(s):
References:[Ruby/GIO] [index-ruby-gio2] [index-ruby-glib2] [GLib::DesktopAppInfo]