[gnome-builder] foundry: add logging and force invalidate build manager



commit 0666e729ebe996b3be5e0a3384ca773d2c6e71ce
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 21 13:51:51 2019 -0800

    foundry: add logging and force invalidate build manager

 src/libide/foundry/ide-device-manager.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/src/libide/foundry/ide-device-manager.c b/src/libide/foundry/ide-device-manager.c
index bbe30e7e2..cdf415022 100644
--- a/src/libide/foundry/ide-device-manager.c
+++ b/src/libide/foundry/ide-device-manager.c
@@ -638,9 +638,16 @@ 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));
 
+  IDE_ENTRY;
+
   if (g_set_object (&self->device, device))
     {
       const gchar *device_id = NULL;
+      IdeBuildManager *build_manager;
+      IdeContext *context;
+
+      context = ide_object_get_context (IDE_OBJECT (self));
+      build_manager = ide_build_manager_from_context (context);
 
       if (device != NULL)
         device_id = ide_device_get_id (device);
@@ -648,9 +655,15 @@ ide_device_manager_set_device (IdeDeviceManager *self,
       if (device_id == NULL)
         device_id = "local";
 
+      IDE_TRACE_MSG ("Device set to %s", device_id);
+
       ide_device_manager_set_action_state (self, "device", g_variant_new_string (device_id));
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEVICE]);
+
+      ide_build_manager_invalidate (build_manager);
     }
+
+  IDE_EXIT;
 }
 
 static void
@@ -660,6 +673,8 @@ ide_device_manager_action_device (IdeDeviceManager *self,
   const gchar *device_id;
   IdeDevice *device;
 
+  IDE_ENTRY;
+
   g_assert (IDE_IS_DEVICE_MANAGER (self));
   g_assert (param != NULL);
   g_assert (g_variant_is_of_type (param, G_VARIANT_TYPE_STRING));
@@ -667,6 +682,8 @@ ide_device_manager_action_device (IdeDeviceManager *self,
   if (!(device_id = g_variant_get_string (param, NULL)))
     device_id = "local";
 
+  IDE_TRACE_MSG ("Setting device to \"%s\"", device_id);
+
   if ((device = ide_device_manager_get_device_by_id (self, device_id)))
     ide_device_manager_set_device (self, device);
 }


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