glibmm: Gio::AppInfoMonitor Class Reference

glibmm 2.88.0

Public Member Functions | Static Public Member Functions | Related Symbols | List of all members
Gio::AppInfoMonitor Class Reference

Monitor application information for changes. More...

`#include <giomm/appinfomonitor.h>`

Inheritance diagram for Gio::AppInfoMonitor:
[legend]

## Public Member Functions
| AppInfoMonitor (AppInfoMonitor && src) noexcept
AppInfoMonitor & | operator= (AppInfoMonitor && src) noexcept
| ~AppInfoMonitor () noexcept override
GAppInfoMonitor * | gobj ()
| Provides access to the underlying C GObject.
const GAppInfoMonitor * | gobj () const
| Provides access to the underlying C GObject.
GAppInfoMonitor * | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::SignalProxy< void()> | signal_changed ()
Public Member Functions inherited from Glib::Object
| Object (const Object &)=delete
Object & | operator= (const Object &)=delete
| Object (Object && src) noexcept
Object & | operator= (Object && src) noexcept
void * | get_data (const QueryQuark & key)
void | set_data (const Quark & key, void *data)
void | set_data_with_c_callback (const Quark & key, void *data, GDestroyNotify notify)
void | set_data (const Quark & key, void *data, DestroyNotify notify)
| Prefer set_data_with_c_callback() with a callback with C linkage.
void | remove_data (const QueryQuark & quark)
void * | steal_data (const QueryQuark & quark)
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring & property_name, const Glib::ValueBase & value)
| You probably want to use a specific property_*() accessor method instead.
void | get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const
| You probably want to use a specific property_*() accessor method instead.
template<class PropertyType>
void | set_property (const Glib::ustring & property_name, const PropertyType & value)
| You probably want to use a specific property_*() accessor method instead.
template<class PropertyType>
void | get_property (const Glib::ustring & property_name, PropertyType & value) const
| You probably want to use a specific property_*() accessor method instead.
template<class PropertyType>
PropertyType | get_property (const Glib::ustring & property_name) const
| You probably want to use a specific property_*() accessor method instead.
sigc::connection | connect_property_changed (const Glib::ustring & property_name, const sigc::slot< void()> & slot)
| You can use the signal_changed() signal of the property proxy instead.
sigc::connection | connect_property_changed (const Glib::ustring & property_name, sigc::slot< void()> && slot)
| You can use the signal_changed() signal of the property proxy instead.
void | freeze_notify ()
| Increases the freeze count on object.
void | thaw_notify ()
| Reverts the effect of a previous call to freeze_notify().
virtual void | reference () const
| Increment the reference count for this object.
virtual void | unreference () const
| Decrement the reference count for this object.
GObject * | gobj ()
| Provides access to the underlying C GObject.
const GObject * | gobj () const
| Provides access to the underlying C GObject.
GObject * | gobj_copy () const
| Give a ref-ed copy to someone. Use for direct struct access.

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.
static Glib::RefPtr< AppInfoMonitor > | get ()
| Gets the AppInfoMonitor for the current thread-default main context.

## Related Symbols
(Note that these are not member symbols.)
Glib::RefPtr< Gio::AppInfoMonitor > | wrap (GAppInfoMonitor * object, bool take_copy=false)
| A Glib::wrap() method for this object.
Related Symbols inherited from Glib::Object
Glib::RefPtr< Glib::Object > | wrap (GObject * object, bool take_copy=false)

## Additional Inherited Members
Public Types inherited from Glib::Object
using | DestroyNotify = void (*)(gpointer data)
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams & construct_params)
| Object (GObject * castitem)
| ~Object () noexcept override
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor.
| ObjectBase (const char * custom_type_name)
| A derived constructor always overrides this choice.
| ObjectBase (const std::type_info & custom_type_info)
| This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually.
| ObjectBase (ObjectBase && src) noexcept
ObjectBase & | operator= (ObjectBase && src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject * castitem)
void | initialize_move (GObject * castitem, Glib::ObjectBase * previous_wrapper)

## Detailed Description

Monitor application information for changes.

Gio::AppInfoMonitor is a very simple object used for monitoring the app info database for changes (ie: newly installed or removed applications).

Call get() to get a Gio::AppInfoMonitor and connect to signal_changed().

In the usual case, applications should try to make note of the change (doing things like invalidating caches) but not act on it. In particular, applications should avoid making calls to Gio::AppInfo APIs in response to the change signal, deferring these until the time that the data is actually required. The exception to this case is when application information is actually being displayed on the screen (eg: during a search or when the list of all applications is shown). The reason for this is that changes to the list of installed applications often come in groups (like during system updates) and rescanning the list on every change is pointless and expensive.

Since glibmm 2.72

## Constructor & Destructor Documentation

## ◆ AppInfoMonitor()

Gio::AppInfoMonitor::AppInfoMonitor | ( | AppInfoMonitor && | src | ) |
| noexcept

## ◆ ~AppInfoMonitor()

Gio::AppInfoMonitor::~AppInfoMonitor | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ get()

Glib::RefPtr< AppInfoMonitor > Gio::AppInfoMonitor::get | ( |  | ) |
| static

Gets the AppInfoMonitor for the current thread-default main context.

The AppInfoMonitor will emit a "changed" signal in the thread-default main context whenever the list of installed applications (as reported by Gio::AppInfo::get_all()) may have changed.

You must only drop the last reference on the return value from under the same main context as you created it.

Since glibmm 2.72

Returns
  A reference to a Gio::AppInfoMonitor.

## ◆ get_type()

GType Gio::AppInfoMonitor::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GAppInfoMonitor * Gio::AppInfoMonitor::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GAppInfoMonitor * Gio::AppInfoMonitor::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GAppInfoMonitor * Gio::AppInfoMonitor::gobj_copy | ( |  | ) |

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

## ◆ operator=()

AppInfoMonitor & Gio::AppInfoMonitor::operator= | ( | AppInfoMonitor && | src | ) |
| noexcept

## ◆ signal_changed()

Glib::SignalProxy< void()> Gio::AppInfoMonitor::signal_changed | ( |  | ) |

Slot Prototype:
  void on_my_changed()

Flags: Run First

Signal emitted when the app info database changes, when applications are installed or removed.

Since glibmm 2.72

## Friends And Related Symbol Documentation

## ◆ wrap()

Glib::RefPtr< Gio::AppInfoMonitor > wrap | ( | GAppInfoMonitor * | 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.