Commit 3d200ea4 authored by Christian Kellner's avatar Christian Kellner
Browse files

device: helper to set the manger pointer

parent 64bf61a8
......@@ -673,11 +673,22 @@ bolt_device_new_for_udev (BoltManager *mgr,
dev->status = bolt_status_from_udev (udev);
dev->security = security_for_udev (udev);
bolt_device_set_manager (dev, mgr);
return dev;
bolt_device_set_manager (BoltDevice *dev,
BoltManager *mgr)
if (dev->mgr != NULL)
g_object_remove_weak_pointer (G_OBJECT (mgr),
(gpointer *) &dev->mgr);
dev->mgr = mgr;
g_object_add_weak_pointer (G_OBJECT (mgr),
(gpointer *) &dev->mgr);
return dev;
const char *
......@@ -36,6 +36,8 @@ BoltDevice * bolt_device_new_for_udev (BoltManager *manager,
struct udev_device *udev,
GError **error);
void bolt_device_set_manager (BoltDevice *device,
BoltManager *manager);
const char * bolt_device_export (BoltDevice *device,
GDBusConnection *connection,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment