core: add NMDBusTrackObjPath helper
When one D-Bus object exposes (the path of) another D-Bus object, we want that the path property gets cleared before the other object gets unexported(). That essentially requires to register to the "exported-changed" signal. Add a helper struct NMDBusTrackObjPath to help with this.
This commit is contained in:
@@ -179,4 +179,34 @@ void nm_dbus_utils_g_value_set_object_path_from_hash (GValue *value,
|
||||
GHashTable *hash,
|
||||
gboolean expect_all_exported);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
gpointer const obj;
|
||||
gpointer _obj;
|
||||
};
|
||||
GObject *_notify_target;
|
||||
const GParamSpec *_notify_pspec;
|
||||
gulong _notify_signal_id;
|
||||
union {
|
||||
const bool visible;
|
||||
bool _visible;
|
||||
};
|
||||
} NMDBusTrackObjPath;
|
||||
|
||||
void nm_dbus_track_obj_path_init (NMDBusTrackObjPath *track,
|
||||
GObject *target,
|
||||
const GParamSpec *pspec);
|
||||
|
||||
void nm_dbus_track_obj_path_deinit (NMDBusTrackObjPath *track);
|
||||
|
||||
void nm_dbus_track_obj_path_notify (const NMDBusTrackObjPath *track);
|
||||
|
||||
const char *nm_dbus_track_obj_path_get (const NMDBusTrackObjPath *track);
|
||||
|
||||
void nm_dbus_track_obj_path_set (NMDBusTrackObjPath *track,
|
||||
gpointer obj,
|
||||
gboolean visible);
|
||||
|
||||
#endif /* __NM_DBUS_UTILS_H__ */
|
||||
|
Reference in New Issue
Block a user