[gnome-builder] file: ignore false notify



commit 3f3ffe3a8579e8d1a2d9e7d1ae992c5b091e0cec
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 11 20:28:48 2016 +0300

    file: ignore false notify
    
    We will only notify when going to TRUE, so we can simplify this code
    path.

 libide/ide-file.c |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/libide/ide-file.c b/libide/ide-file.c
index fbaf4e4..9c61bbd 100644
--- a/libide/ide-file.c
+++ b/libide/ide-file.c
@@ -240,8 +240,9 @@ ide_file_set_path (IdeFile     *self,
 static void
 ide_file__file_settings_settled_cb (IdeFileSettings *file_settings,
                                     GParamSpec      *pspec,
-                                    GTask           *task)
+                                    gpointer         user_data)
 {
+  g_autoptr(GTask) task = user_data;
   IdeFile *self;
 
   IDE_ENTRY;
@@ -251,20 +252,11 @@ ide_file__file_settings_settled_cb (IdeFileSettings *file_settings,
   self = g_task_get_source_object (task);
   g_assert (IDE_IS_FILE (self));
 
-  if (ide_file_settings_get_settled (file_settings))
-    {
-      g_signal_handlers_disconnect_by_func (file_settings,
-                                            G_CALLBACK (ide_file__file_settings_settled_cb),
-                                            task);
-
-      if (self->file_settings == NULL)
-        self->file_settings = g_object_ref (file_settings);
-
-      g_task_return_pointer (task, g_object_ref (file_settings), g_object_unref);
-      g_object_unref (task);
-
-      IDE_EXIT;
-    }
+  g_signal_handlers_disconnect_by_func (file_settings,
+                                        G_CALLBACK (ide_file__file_settings_settled_cb),
+                                        task);
+  g_set_object (&self->file_settings, file_settings);
+  g_task_return_pointer (task, g_object_ref (file_settings), g_object_unref);
 
   IDE_EXIT;
 }


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