Get rid of one more user context hack:

2006-10-01  Michael Natterer  <mitch@gimp.org>

	Get rid of one more user context hack:

	* app/dialogs/stroke-dialog.c: attach the saved-stroke-desc to the
	gimp object instead of to the passed context in one function, and
	to the user context in the other (coincidentially these contexts
	were the same).

	* app/actions/select-commands.c
	* app/actions/vectors-commands.c: changed accordingly. Pass the
	callback's context instead of the user context to
	stroke_dialog_new().
This commit is contained in:
Michael Natterer 2006-10-01 11:13:00 +00:00 committed by Michael Natterer
parent 5259a1f998
commit 3b11fa737d
4 changed files with 23 additions and 9 deletions

View File

@ -1,3 +1,17 @@
2006-10-01 Michael Natterer <mitch@gimp.org>
Get rid of one more user context hack:
* app/dialogs/stroke-dialog.c: attach the saved-stroke-desc to the
gimp object instead of to the passed context in one function, and
to the user context in the other (coincidentially these contexts
were the same).
* app/actions/select-commands.c
* app/actions/vectors-commands.c: changed accordingly. Pass the
callback's context instead of the user context to
stroke_dialog_new().
2006-10-01 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpstrokeeditor.c (gimp_stroke_editor_constructor):

View File

@ -308,6 +308,7 @@ select_stroke_last_vals_cmd_callback (GtkAction *action,
GimpContext *context;
GimpStrokeDesc *desc;
return_if_no_image (image, data);
return_if_no_context (context, data);
drawable = gimp_image_active_drawable (image);
@ -317,9 +318,7 @@ select_stroke_last_vals_cmd_callback (GtkAction *action,
return;
}
context = gimp_get_user_context (image->gimp);
desc = g_object_get_data (G_OBJECT (context), "saved-stroke-desc");
desc = g_object_get_data (G_OBJECT (image->gimp), "saved-stroke-desc");
if (desc)
g_object_ref (desc);

View File

@ -379,6 +379,7 @@ vectors_stroke_last_vals_cmd_callback (GtkAction *action,
GimpContext *context;
GimpStrokeDesc *desc;
return_if_no_vectors (image, vectors, data);
return_if_no_context (context, data);
drawable = gimp_image_active_drawable (image);
@ -388,9 +389,8 @@ vectors_stroke_last_vals_cmd_callback (GtkAction *action,
return;
}
context = gimp_get_user_context (image->gimp);
desc = g_object_get_data (G_OBJECT (context), "saved-stroke-desc");
desc = g_object_get_data (G_OBJECT (image->gimp), "saved-stroke-desc");
if (desc)
g_object_ref (desc);

View File

@ -91,7 +91,8 @@ stroke_dialog_new (GimpItem *item,
desc = gimp_stroke_desc_new (context->gimp, context);
saved_desc = g_object_get_data (G_OBJECT (context), "saved-stroke-desc");
saved_desc = g_object_get_data (G_OBJECT (context->gimp),
"saved-stroke-desc");
if (saved_desc)
gimp_config_sync (G_OBJECT (saved_desc), G_OBJECT (desc), 0);
@ -251,7 +252,7 @@ stroke_dialog_response (GtkWidget *widget,
desc = g_object_get_data (G_OBJECT (dialog), "gimp-stroke-desc");
image = gimp_item_get_image (item);
context = gimp_get_user_context (image->gimp);
context = GIMP_VIEWABLE_DIALOG (dialog)->context;
switch (response_id)
{
@ -284,7 +285,7 @@ stroke_dialog_response (GtkWidget *widget,
return;
}
saved_desc = g_object_get_data (G_OBJECT (context),
saved_desc = g_object_get_data (G_OBJECT (context->gimp),
"saved-stroke-desc");
if (saved_desc)
@ -294,7 +295,7 @@ stroke_dialog_response (GtkWidget *widget,
gimp_config_sync (G_OBJECT (desc), G_OBJECT (saved_desc), 0);
g_object_set_data_full (G_OBJECT (context), "saved-stroke-desc",
g_object_set_data_full (G_OBJECT (context->gimp), "saved-stroke-desc",
saved_desc,
(GDestroyNotify) g_object_unref);