[gimp] app: in gimp_tool_gui_set_response_sensitive(), allow non-existent ID



commit 92216a635ad1f8adf10c39bf075c95c5612ad86f
Author: Ell <ell_se yahoo com>
Date:   Wed Mar 13 04:17:47 2019 -0400

    app: in gimp_tool_gui_set_response_sensitive(), allow non-existent ID
    
    In gimp_tool_gui_set_response_sensitive(), silently ignore non-
    existent response IDs, instead of emitting a CRITICAL, to match the
    behavior of GtkDialog and GimpOverlayDialog.  This simplifies code
    with optional dialog responses.

 app/display/gimptoolgui.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/app/display/gimptoolgui.c b/app/display/gimptoolgui.c
index bbe88e65f0..db56935b33 100644
--- a/app/display/gimptoolgui.c
+++ b/app/display/gimptoolgui.c
@@ -706,7 +706,8 @@ gimp_tool_gui_set_response_sensitive (GimpToolGui *gui,
 
   entry = response_entry_find (private->response_entries, response_id);
 
-  g_return_if_fail (entry != NULL);
+  if (! entry)
+    return;
 
   entry->sensitive = sensitive;
 


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