summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2017-05-24 16:35:03 +0200
committerLubomir Rintel <lkundrak@v3.sk>2017-05-31 20:17:54 +0200
commit805d3240f9363f5ea5d57000f2920234bf6cd152 (patch)
treef43a0b2e80507c80228d3f6abe59c56b58ad4d3d
parentaedeb3cbf4fa5857d7784b10d8b20cba798cc7ce (diff)
downloadNetworkManager-805d3240f9363f5ea5d57000f2920234bf6cd152.tar.gz
devices/factory: allow announcing a NULL component
We'll use this to let the devices know they can retry autoactivation because some component became available without actually having any data that would be useful for that device. Adjust the comment.
-rw-r--r--src/devices/nm-device-factory.c1
-rw-r--r--src/devices/nm-device-factory.h14
-rw-r--r--src/devices/nm-device.h8
3 files changed, 13 insertions, 10 deletions
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c
index f512b8b25d..a2447ad66d 100644
--- a/src/devices/nm-device-factory.c
+++ b/src/devices/nm-device-factory.c
@@ -55,7 +55,6 @@ nm_device_factory_emit_component_added (NMDeviceFactory *factory, GObject *compo
gboolean consumed = FALSE;
g_return_val_if_fail (NM_IS_DEVICE_FACTORY (factory), FALSE);
- g_return_val_if_fail (G_IS_OBJECT (component), FALSE);
g_signal_emit (factory, signals[COMPONENT_ADDED], 0, component, &consumed);
return consumed;
diff --git a/src/devices/nm-device-factory.h b/src/devices/nm-device-factory.h
index 7f8175e455..836af5f522 100644
--- a/src/devices/nm-device-factory.h
+++ b/src/devices/nm-device-factory.h
@@ -140,11 +140,15 @@ typedef struct {
* @factory: the #NMDeviceFactory
* @component: a new component which existing devices may wish to claim
*
- * The factory emits this signal when it finds a new component. For example,
- * the WWAN factory may indicate that a new modem is available, which an
- * existing Bluetooth device may wish to claim. If no device claims the
- * component, the plugin is allowed to create a new #NMDevice instance for
- * that component and emit the "device-added" signal.
+ * The factory emits this signal when an appearance of some component
+ * native to it could be interesting to some of the already existing devices.
+ * The devices then indicate if they took interest in claiming the component.
+ *
+ * For example, the WWAN factory may indicate that a new modem is available,
+ * which an existing Bluetooth device may wish to claim. It emits a signal
+ * passing the modem instance around to see if any device claims it.
+ * If no device claims the component, the plugin is allowed to create a new
+ * #NMDevice instance for that component and emit the "device-added" signal.
*
* Returns: %TRUE if the component was claimed by a device, %FALSE if not
*/
diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h
index c91ec2d5ec..cc1510ed7b 100644
--- a/src/devices/nm-device.h
+++ b/src/devices/nm-device.h
@@ -375,10 +375,10 @@ typedef struct {
* @self: the #NMDevice
* @component: the component (device, modem, etc) which was added
*
- * Notifies @self that a new component was added to the Manager. This
- * may include any kind of %GObject subclass, and the device is expected
- * to match only specific components they care about, like %NMModem objects
- * or %NMDevice objects.
+ * Notifies @self that a new component that a device might be interested
+ * in was detected by some device factory. It may include an object of
+ * %GObject subclass to help the devices decide whether it claims that
+ * particular object itself and the emitting factory should not.
*
* Returns: %TRUE if the component was claimed exclusively and no further
* devices should be notified of the new component. %FALSE to indicate