Main Page glibmm Namespaces Book

# Gio::DesktopAppInfo Class Reference

DesktopAppInfo is an implementation of AppInfo based on desktop files. More...

Inheritance diagram for Gio::DesktopAppInfo:

[legend]

List of all members.

## Public Member Functions
virtual | ~DesktopAppInfo ()
GDesktopAppInfo* | gobj ()
| Provides access to the underlying C GObject.
const GDesktopAppInfo* | gobj () const
| Provides access to the underlying C GObject.
GDesktopAppInfo* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool | is_hidden () const
| A desktop file is hidden if the Hidden key in it is set to True.
## Static Public Member Functions
static Glib::RefPtr <DesktopAppInfo> | create (const std::string& desktop_id)
| Creates a new DesktopAppInfo.
static Glib::RefPtr <DesktopAppInfo> | create_from_keyfile (Glib::KeyFile& key_file)
| Creates a new DesktopAppInfo.
static Glib::RefPtr <DesktopAppInfo> | create_from_filename (const std::string& filename)
| Creates a new DesktopAppInfo.
static void | set_desktop_env (const std::string& desktop_env)
| Sets the name of the desktop that the application is running in.
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr<Gio::DesktopAppInfo> | wrap (GDesktopAppInfo* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

DesktopAppInfo is an implementation of AppInfo based on desktop files.

Since glibmm 2.16:

## Constructor & Destructor Documentation

virtual Gio::DesktopAppInfo::~DesktopAppInfo | ( |  | ) | `[virtual]`

## Member Function Documentation

GDesktopAppInfo* Gio::DesktopAppInfo::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::AppInfo.

const GDesktopAppInfo* Gio::DesktopAppInfo::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::AppInfo.

GDesktopAppInfo* Gio::DesktopAppInfo::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

static Glib::RefPtr<DesktopAppInfo> Gio::DesktopAppInfo::create | ( | const std::string & | desktop_id | ) | `[static]`

Creates a new DesktopAppInfo.

Parameters:

  | desktop_id | The desktop file id.

Returns:
  A new DesktopAppInfo, or `0` if no desktop file with that id.

static Glib::RefPtr<DesktopAppInfo> Gio::DesktopAppInfo::create_from_keyfile | ( | Glib::KeyFile& | key_file | ) | `[static]`

Creates a new DesktopAppInfo.

Parameters:

  | key_file | An opened KeyFile.

Returns:
  A new DesktopAppInfo or `0` on error.

Since glibmm 2.18:

static Glib::RefPtr<DesktopAppInfo> Gio::DesktopAppInfo::create_from_filename | ( | const std::string & | filename | ) | `[static]`

Creates a new DesktopAppInfo.

Parameters:

  | filename | The path of a desktop file, in the GLib filename encoding.

Returns:
  A new DesktopAppInfo or `0` on error.

bool Gio::DesktopAppInfo::is_hidden | ( |  | ) | const

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

Returns:
  `true` if hidden, `false` otherwise.

static void Gio::DesktopAppInfo::set_desktop_env | ( | const std::string & | desktop_env | ) | `[static]`

Sets the name of the desktop that the application is running in.

This is used by g_app_info_should_show() to evaluate the `OnlyShowIn` and `NotShowIn` desktop entry fields.

The Desktop Menu specification recognizes the following: <simplelist> <member>GNOME</member> <member>KDE</member> <member>ROX</member> <member>XFCE</member> <member>Old</member> </simplelist>

Should be called only once; subsequent calls are ignored.

Parameters:

  | desktop_env | A string specifying what desktop this is.

## Friends And Related Function Documentation

Glib::RefPtr<Gio::DesktopAppInfo> wrap | ( | GDesktopAppInfo * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- desktopappinfo.h