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

Monitor application information for changes. More...

#include <giomm/appinfomonitor.h>

Inheritance diagram for Gio::AppInfoMonitor:
Inheritance graph
[legend]

Public Member Functions

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

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static Glib::RefPtr< AppInfoMonitorget ()
 Gets the AppInfoMonitor for the current thread-default main context. More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gio::AppInfoMonitorwrap (GAppInfoMonitor * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

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. More...
 
 ObjectBase (const char * custom_type_name)
 A derived constructor always overrides this choice. More...
 
 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. More...
 
 ObjectBase (ObjectBase && src) noexcept
 
ObjectBaseoperator= (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()

static 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()

static 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 for changes (ie: newly installed or removed applications).

Since glibmm 2.72:

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gio::AppInfoMonitor > wrap ( GAppInfoMonitor *  object,
bool  take_copy = false 
)
related

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

Parameters
objectThe C instance.
take_copyFalse 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.