gimp r27995 - trunk/app/core
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27995 - trunk/app/core
- Date: Sat, 7 Feb 2009 09:31:01 +0000 (UTC)
Author: martinn
Date: Sat Feb 7 09:31:01 2009
New Revision: 27995
URL: http://svn.gnome.org/viewvc/gimp?rev=27995&view=rev
Log:
Introduce and use gimp_image_map_cancel_any_idle_jobs()
Introduce and use a local helper function
gimp_image_map_cancel_any_idle_jobs() to get a rid of some code
duplication.
Modified:
trunk/app/core/gimpimagemap.c
Modified: trunk/app/core/gimpimagemap.c
==============================================================================
--- trunk/app/core/gimpimagemap.c (original)
+++ trunk/app/core/gimpimagemap.c Sat Feb 7 09:31:01 2009
@@ -99,6 +99,8 @@
static void gimp_image_map_data_written (GObject *operation,
const GeglRectangle *extent,
GimpImageMap *image_map);
+static void gimp_image_map_cancel_any_idle_jobs
+ (GimpImageMap *image_map);
G_DEFINE_TYPE_WITH_CODE (GimpImageMap, gimp_image_map, GIMP_TYPE_OBJECT,
@@ -191,23 +193,7 @@
image_map->undo_tiles = NULL;
}
- if (image_map->idle_id)
- {
- g_source_remove (image_map->idle_id);
- image_map->idle_id = 0;
-
- if (image_map->processor)
- {
- g_object_unref (image_map->processor);
- image_map->processor = NULL;
- }
-
- if (image_map->PRI)
- {
- pixel_regions_process_stop (image_map->PRI);
- image_map->PRI = NULL;
- }
- }
+ gimp_image_map_cancel_any_idle_jobs (image_map);
if (image_map->gegl)
{
@@ -360,23 +346,7 @@
g_return_if_fail (GIMP_IS_IMAGE_MAP (image_map));
/* If we're still working, remove the timer */
- if (image_map->idle_id)
- {
- g_source_remove (image_map->idle_id);
- image_map->idle_id = 0;
-
- if (image_map->processor)
- {
- g_object_unref (image_map->processor);
- image_map->processor = NULL;
- }
-
- if (image_map->PRI)
- {
- pixel_regions_process_stop (image_map->PRI);
- image_map->PRI = NULL;
- }
- }
+ gimp_image_map_cancel_any_idle_jobs (image_map);
/* Make sure the drawable is still valid */
if (! gimp_item_is_attached (GIMP_ITEM (image_map->drawable)))
@@ -623,23 +593,7 @@
{
g_return_if_fail (GIMP_IS_IMAGE_MAP (image_map));
- if (image_map->idle_id)
- {
- g_source_remove (image_map->idle_id);
- image_map->idle_id = 0;
-
- if (image_map->processor)
- {
- g_object_unref (image_map->processor);
- image_map->processor = NULL;
- }
-
- if (image_map->PRI)
- {
- pixel_regions_process_stop (image_map->PRI);
- image_map->PRI = NULL;
- }
- }
+ gimp_image_map_cancel_any_idle_jobs (image_map);
/* Make sure the drawable is still valid */
if (! gimp_item_is_attached (GIMP_ITEM (image_map->drawable)))
@@ -686,23 +640,7 @@
{
g_return_if_fail (GIMP_IS_IMAGE_MAP (image_map));
- if (image_map->idle_id)
- {
- g_source_remove (image_map->idle_id);
- image_map->idle_id = 0;
-
- if (image_map->processor)
- {
- g_object_unref (image_map->processor);
- image_map->processor = NULL;
- }
-
- if (image_map->PRI)
- {
- pixel_regions_process_stop (image_map->PRI);
- image_map->PRI = NULL;
- }
- }
+ gimp_image_map_cancel_any_idle_jobs (image_map);
if (! gimp_item_is_attached (GIMP_ITEM (image_map->drawable)))
return;
@@ -896,3 +834,25 @@
if (image_map->timer)
image_map->pixel_count += extent->width * extent->height;
}
+
+static void
+gimp_image_map_cancel_any_idle_jobs (GimpImageMap *image_map)
+{
+ if (image_map->idle_id)
+ {
+ g_source_remove (image_map->idle_id);
+ image_map->idle_id = 0;
+
+ if (image_map->processor)
+ {
+ g_object_unref (image_map->processor);
+ image_map->processor = NULL;
+ }
+
+ if (image_map->PRI)
+ {
+ pixel_regions_process_stop (image_map->PRI);
+ image_map->PRI = NULL;
+ }
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]