[gimp/metadata-browser: 36/44] Avoid circular updating of widgets by blocking.



commit f35d3996fe3c5ba9fae6083627475147ae29347d
Author: Roman Joost <roman bromeco de>
Date:   Wed Oct 5 20:41:22 2011 +1000

    Avoid circular updating of widgets by blocking.
    
    If the user changes values in the treeview, we don't want that the
    widget updates the XMPModel again.

 plug-ins/metadata/gimpxmpmodelentry.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/metadata/gimpxmpmodelentry.c b/plug-ins/metadata/gimpxmpmodelentry.c
index 9b194e2..18c0b6c 100644
--- a/plug-ins/metadata/gimpxmpmodelentry.c
+++ b/plug-ins/metadata/gimpxmpmodelentry.c
@@ -87,7 +87,15 @@ static void
 gimp_xmp_model_entry_set_text (GimpXmpModelWidget *widget,
                                const gchar        *tree_value)
 {
+  g_signal_handlers_block_by_func (widget,
+                                   gimp_xmp_model_entry_changed,
+                                   NULL);
+
   gtk_entry_set_text (GTK_ENTRY (widget), tree_value);
+
+  g_signal_handlers_unblock_by_func (widget,
+                                     gimp_xmp_model_entry_changed,
+                                     NULL);
 }
 
 static void



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