[gnome-builder/gnome-builder-3-32] foundry: ignore setting to local if self->device is NULL



commit 3663a72176553eb58c752522c5e30a573e960b52
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 15 13:36:06 2019 -0700

    foundry: ignore setting to local if self->device is NULL
    
    Related: #971

 src/libide/foundry/ide-device-manager.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/libide/foundry/ide-device-manager.c b/src/libide/foundry/ide-device-manager.c
index 5253270d2..35b9a3218 100644
--- a/src/libide/foundry/ide-device-manager.c
+++ b/src/libide/foundry/ide-device-manager.c
@@ -640,6 +640,14 @@ ide_device_manager_set_device (IdeDeviceManager *self,
   g_return_if_fail (IDE_IS_DEVICE_MANAGER (self));
   g_return_if_fail (!device || IDE_IS_DEVICE (device));
 
+  /* Short-circuit if we're setting to local and the current
+   * device is already local (null).
+   */
+  if (self->device == NULL &&
+      device != NULL &&
+      ide_str_equal0 ("local", ide_device_get_id (device)))
+    return;
+
   if (g_set_object (&self->device, device))
     {
       const gchar *device_id = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]