[gimp] app: don't use the user context in GimpDeviceEditor's container view



commit 64954afa4b714ef270b4beb01b18411d11f7a21b
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 16 22:39:19 2018 +0200

    app: don't use the user context in GimpDeviceEditor's container view
    
    GimpDeviceInfo is a GimpToolPreset now, and using the user context
    would cause the device info selected in the dialog to be set globally
    as tool preset. Use a temporary context instead, the container view
    just needs it because.

 app/widgets/gimpdeviceeditor.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimpdeviceeditor.c b/app/widgets/gimpdeviceeditor.c
index d4854e7..3500b40 100644
--- a/app/widgets/gimpdeviceeditor.c
+++ b/app/widgets/gimpdeviceeditor.c
@@ -28,6 +28,7 @@
 #include "widgets-types.h"
 
 #include "core/gimp.h"
+#include "core/gimpcontext.h"
 #include "core/gimplist.h"
 #include "core/gimpmarshal.h"
 
@@ -216,6 +217,7 @@ gimp_device_editor_constructed (GObject *object)
   GimpDeviceEditor        *editor  = GIMP_DEVICE_EDITOR (object);
   GimpDeviceEditorPrivate *private = GIMP_DEVICE_EDITOR_GET_PRIVATE (editor);
   GimpContainer           *devices;
+  GimpContext             *context;
   GList                   *list;
 
   G_OBJECT_CLASS (parent_class)->constructed (object);
@@ -234,8 +236,10 @@ gimp_device_editor_constructed (GObject *object)
   gimp_container_view_set_container (GIMP_CONTAINER_VIEW (private->treeview),
                                      devices);
 
+  context = gimp_context_new (private->gimp, "device-editor-list", NULL);
   gimp_container_view_set_context (GIMP_CONTAINER_VIEW (private->treeview),
-                                   gimp_get_user_context (private->gimp));
+                                   context);
+  g_object_unref (context);
 
   g_signal_connect (devices, "add",
                     G_CALLBACK (gimp_device_editor_add_device),


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