fwupd/src/fu-device-private.h
Richard Hughes e48351e260 Set the alternate device ID, not the object itself
If the daemon either de-duplicates or replaces the object passed emitted from
device-added then the object set as the alternate may not be the same instance
as the daemon version. This causes weird things to happen.

To make this less fragile, specify the *ID* of the object that should be the
alternate device, which allows the daemon to do clever things, and then assign
the object from the ID as the last step.

Although fixing no bug, this makes implementing future functionality easier.
2018-06-22 13:28:27 +01:00

28 lines
677 B
C

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#ifndef __FU_DEVICE_PRIVATE_H
#define __FU_DEVICE_PRIVATE_H
#include <fu-device.h>
G_BEGIN_DECLS
GPtrArray *fu_device_get_parent_guids (FuDevice *device);
gboolean fu_device_has_parent_guid (FuDevice *device,
const gchar *guid);
guint fu_device_get_order (FuDevice *device);
void fu_device_set_order (FuDevice *device,
guint order);
void fu_device_set_alternate (FuDevice *device,
FuDevice *alternate);
G_END_DECLS
#endif /* __FU_DEVICE_PRIVATE_H */