gimp r27628 - in trunk: . app/core app/gui app/menus app/paint app/tools app/vectors app/widgets



Author: neo
Date: Wed Nov 12 10:56:06 2008
New Revision: 27628
URL: http://svn.gnome.org/viewvc/gimp?rev=27628&view=rev

Log:
2008-11-12  Sven Neumann  <sven gimp org>

	* app/core/Makefile.am
	* app/core/gimperror.[ch]: added GIMP_ERROR as general error 
domain.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimpselection.c
	* app/core/gimptooloptions.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpheal.c
	* app/paint/gimppaintcore-stroke.c
	* app/paint/gimpperspectiveclone.c
	* app/paint/gimpsourcecore.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdesaturatetool.c
	* app/tools/gimpgegltool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimpthresholdtool.c
	* app/vectors/gimpvectors-import.c: use GIMP_ERROR as error 
domain
	instead of 0, which is not accepted by g_set_error_literal().

	* app/gui/session.c
	* app/menus/menus.c
	* app/vectors/gimpvectors-export.c
	* app/widgets/gimpdevices.c: use G_FILE_ERROR as error domain 
for
	file errors.



Added:
   trunk/app/core/gimperror.c
   trunk/app/core/gimperror.h
Modified:
   trunk/ChangeLog
   trunk/app/core/Makefile.am
   trunk/app/core/gimpchannel.c
   trunk/app/core/gimpdrawable-bucket-fill.c
   trunk/app/core/gimpimage-convert.c
   trunk/app/core/gimpimage-merge.c
   trunk/app/core/gimpimage.c
   trunk/app/core/gimplayer-floating-sel.c
   trunk/app/core/gimplayer.c
   trunk/app/core/gimplayermask.c
   trunk/app/core/gimpselection.c
   trunk/app/core/gimptooloptions.c
   trunk/app/gui/session.c
   trunk/app/menus/menus.c
   trunk/app/paint/gimpbrushcore.c
   trunk/app/paint/gimpclone.c
   trunk/app/paint/gimpheal.c
   trunk/app/paint/gimppaintcore-stroke.c
   trunk/app/paint/gimpperspectiveclone.c
   trunk/app/paint/gimpsourcecore.c
   trunk/app/tools/gimpblendtool.c
   trunk/app/tools/gimpbrightnesscontrasttool.c
   trunk/app/tools/gimpcolorbalancetool.c
   trunk/app/tools/gimpcolorizetool.c
   trunk/app/tools/gimpcurvestool.c
   trunk/app/tools/gimpdesaturatetool.c
   trunk/app/tools/gimpgegltool.c
   trunk/app/tools/gimphuesaturationtool.c
   trunk/app/tools/gimplevelstool.c
   trunk/app/tools/gimpposterizetool.c
   trunk/app/tools/gimpthresholdtool.c
   trunk/app/vectors/gimpvectors-export.c
   trunk/app/vectors/gimpvectors-import.c
   trunk/app/widgets/gimpdevices.c

Modified: trunk/app/core/Makefile.am
==============================================================================
--- trunk/app/core/Makefile.am	(original)
+++ trunk/app/core/Makefile.am	Wed Nov 12 10:56:06 2008
@@ -164,6 +164,8 @@
 	gimpdrawablestack.h			\
 	gimpdrawableundo.c			\
 	gimpdrawableundo.h			\
+	gimperror.c				\
+	gimperror.h				\
 	gimpfilloptions.c			\
 	gimpfilloptions.h			\
 	gimpfloatingselundo.c			\

Modified: trunk/app/core/gimpchannel.c
==============================================================================
--- trunk/app/core/gimpchannel.c	(original)
+++ trunk/app/core/gimpchannel.c	Wed Nov 12 10:56:06 2008
@@ -43,6 +43,7 @@
 #include "gimp-utils.h"
 #include "gimpcontainer.h"
 #include "gimpdrawable-convert.h"
+#include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-quick-mask.h"
 #include "gimpimage-undo.h"
@@ -715,7 +716,7 @@
                                &n_segs_in, &n_segs_out,
                                0, 0, 0, 0))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Cannot stroke empty channel."));
       return FALSE;
     }

Modified: trunk/app/core/gimpdrawable-bucket-fill.c
==============================================================================
--- trunk/app/core/gimpdrawable-bucket-fill.c	(original)
+++ trunk/app/core/gimpdrawable-bucket-fill.c	Wed Nov 12 10:56:06 2008
@@ -38,6 +38,7 @@
 #include "gimpcontext.h"
 #include "gimpdrawable.h"
 #include "gimpdrawable-bucket-fill.h"
+#include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-contiguous-region.h"
 #include "gimppattern.h"
@@ -87,7 +88,7 @@
 
       if (! pattern)
         {
-          g_set_error_literal (error, 0, 0,
+          g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			       _("No patterns available for this operation."));
           return FALSE;
         }

Added: trunk/app/core/gimperror.c
==============================================================================
--- (empty file)
+++ trunk/app/core/gimperror.c	Wed Nov 12 10:56:06 2008
@@ -0,0 +1,37 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <glib-object.h>
+
+#include "gimperror.h"
+
+
+/**
+ * gimp_error_quark:
+ *
+ * This function is never called directly. Use GIMP_ERROR() instead.
+ *
+ * Return value: the #GQuark that defines the general GIMP error domain.
+ **/
+GQuark
+gimp_error_quark (void)
+{
+  return g_quark_from_static_string ("gimp-error-quark");
+}

Added: trunk/app/core/gimperror.h
==============================================================================
--- (empty file)
+++ trunk/app/core/gimperror.h	Wed Nov 12 10:56:06 2008
@@ -0,0 +1,34 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GIMP_ERROR_H__
+#define __GIMP_ERROR_H__
+
+
+typedef enum
+{
+  GIMP_FAILED,  /* generic error condition */
+} GimpErrorCode;
+
+
+#define GIMP_ERROR (gimp_error_quark ())
+
+GQuark  gimp_error_quark (void) G_GNUC_CONST;
+
+
+#endif /* __GIMP_ERROR_H__ */

Modified: trunk/app/core/gimpimage-convert.c
==============================================================================
--- trunk/app/core/gimpimage-convert.c	(original)
+++ trunk/app/core/gimpimage-convert.c	Wed Nov 12 10:56:06 2008
@@ -148,6 +148,7 @@
 #include "gimpcontainer.h"
 #include "gimpdrawable.h"
 #include "gimpdrawable-convert.h"
+#include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-colormap.h"
 #include "gimpimage-undo.h"
@@ -787,7 +788,7 @@
 
       if (custom_palette->n_colors < 1)
         {
-          g_set_error_literal (error, 0, 0,
+          g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			       _("Cannot convert image: palette is empty."));
           return FALSE;
         }

Modified: trunk/app/core/gimpimage-merge.c
==============================================================================
--- trunk/app/core/gimpimage-merge.c	(original)
+++ trunk/app/core/gimpimage-merge.c	Wed Nov 12 10:56:06 2008
@@ -37,6 +37,7 @@
 #include "gimp.h"
 #include "gimpcontainer.h"
 #include "gimpcontext.h"
+#include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-colorhash.h"
 #include "gimpimage-merge.h"
@@ -285,7 +286,7 @@
     }
   else
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Not enough visible paths for a merge. "
 			     "There must be at least two."));
       return NULL;

Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c	(original)
+++ trunk/app/core/gimpimage.c	Wed Nov 12 10:56:06 2008
@@ -40,6 +40,7 @@
 #include "gimpcontext.h"
 #include "gimpdrawablestack.h"
 #include "gimpgrid.h"
+#include "gimperror.h"
 #include "gimpguide.h"
 #include "gimpimage.h"
 #include "gimpimage-colorhash.h"
@@ -3150,7 +3151,8 @@
 
   if (index == 0)
     {
-      g_set_error_literal (error, 0, 0, _("Layer cannot be raised higher."));
+      g_set_error_literal (error,  GIMP_ERROR, GIMP_FAILED,
+			   _("Layer cannot be raised higher."));
       return FALSE;
     }
 
@@ -3174,7 +3176,8 @@
 
   if (index == gimp_container_num_children (image->layers) - 1)
     {
-      g_set_error_literal (error, 0, 0, _("Layer cannot be lowered more."));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Layer cannot be lowered more."));
       return FALSE;
     }
 
@@ -3379,7 +3382,8 @@
 
   if (index == 0)
     {
-      g_set_error_literal (error, 0, 0, _("Channel cannot be raised higher."));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Channel cannot be raised higher."));
       return FALSE;
     }
 
@@ -3415,7 +3419,8 @@
 
   if (index == gimp_container_num_children (image->channels) - 1)
     {
-      g_set_error_literal (error, 0, 0, _("Channel cannot be lowered more."));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Channel cannot be lowered more."));
       return FALSE;
     }
 
@@ -3585,7 +3590,8 @@
 
   if (index == 0)
     {
-      g_set_error_literal (error, 0, 0, _("Path cannot be raised higher."));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Path cannot be raised higher."));
       return FALSE;
     }
 
@@ -3620,7 +3626,8 @@
 
   if (index == gimp_container_num_children (image->vectors) - 1)
     {
-      g_set_error_literal (error, 0, 0, _("Path cannot be lowered more."));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Path cannot be lowered more."));
       return FALSE;
     }
 

Modified: trunk/app/core/gimplayer-floating-sel.c
==============================================================================
--- trunk/app/core/gimplayer-floating-sel.c	(original)
+++ trunk/app/core/gimplayer-floating-sel.c	Wed Nov 12 10:56:06 2008
@@ -31,6 +31,7 @@
 #include "paint-funcs/paint-funcs.h"
 
 #include "gimp.h"
+#include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
@@ -133,7 +134,7 @@
   /*  Check if the floating layer belongs to a channel...  */
   if (GIMP_IS_CHANNEL (layer->fs.drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Cannot create a new layer from the floating "
 			     "selection because it belongs to a layer mask "
 			     "or channel."));

Modified: trunk/app/core/gimplayer.c
==============================================================================
--- trunk/app/core/gimplayer.c	(original)
+++ trunk/app/core/gimplayer.c	Wed Nov 12 10:56:06 2008
@@ -41,6 +41,7 @@
 #include "gimpcontainer.h"
 #include "gimpdrawable-convert.h"
 #include "gimpdrawable-invert.h"
+#include "gimperror.h"
 #include "gimpimage-undo-push.h"
 #include "gimpimage-undo.h"
 #include "gimpimage.h"
@@ -667,7 +668,7 @@
     {
       if (GIMP_IS_CHANNEL (layer->fs.drawable))
         {
-          g_set_error_literal (error, 0, 0,
+          g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			       _("Cannot create a new layer from the floating "
 				 "selection because it belongs to a layer mask "
 				 "or channel."));
@@ -1286,7 +1287,7 @@
 
   if (layer->mask)
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Unable to add a layer mask since "
 			     "the layer already has one."));
       return NULL;
@@ -1297,7 +1298,7 @@
       (gimp_item_get_height (GIMP_ITEM (layer)) !=
        gimp_item_get_height (GIMP_ITEM (mask))))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Cannot add layer mask of different "
 			     "dimensions than specified layer."));
       return NULL;

Modified: trunk/app/core/gimplayermask.c
==============================================================================
--- trunk/app/core/gimplayermask.c	(original)
+++ trunk/app/core/gimplayermask.c	Wed Nov 12 10:56:06 2008
@@ -27,6 +27,7 @@
 
 #include "core-types.h"
 
+#include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-undo-push.h"
 #include "gimplayer.h"
@@ -157,7 +158,8 @@
 {
   /* reject renaming, layer masks are always named "<layer name> mask"  */
 
-  g_set_error (error, 0, 0, _("Cannot rename layer masks."));
+  g_set_error (error, GIMP_ERROR, GIMP_FAILED,
+	       _("Cannot rename layer masks."));
 
   return FALSE;
 }

Modified: trunk/app/core/gimpselection.c
==============================================================================
--- trunk/app/core/gimpselection.c	(original)
+++ trunk/app/core/gimpselection.c	Wed Nov 12 10:56:06 2008
@@ -32,6 +32,7 @@
 
 #include "gimp.h"
 #include "gimpcontext.h"
+#include "gimperror.h"
 #include "gimpimage.h"
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
@@ -271,7 +272,7 @@
                                &num_dummy_in, &num_dummy_out,
                                0, 0, 0, 0))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("There is no selection to stroke."));
       return FALSE;
     }
@@ -659,7 +660,7 @@
 
   if (non_empty && ((x1 == x2) || (y1 == y2)))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Unable to cut or copy because the "
 			     "selected region is empty."));
       return NULL;
@@ -832,7 +833,7 @@
   if (! gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2) ||
       (x1 == x2 || y1 == y2))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Cannot float selection because the selected "
 			     "region is empty."));
       return NULL;

Modified: trunk/app/core/gimptooloptions.c
==============================================================================
--- trunk/app/core/gimptooloptions.c	(original)
+++ trunk/app/core/gimptooloptions.c	Wed Nov 12 10:56:06 2008
@@ -36,6 +36,7 @@
 #include "core-types.h"
 
 #include "gimp.h"
+#include "gimperror.h"
 #include "gimptoolinfo.h"
 #include "gimptooloptions.h"
 
@@ -228,7 +229,8 @@
   if (g_unlink (filename) != 0 && errno != ENOENT)
     {
       retval = FALSE;
-      g_set_error (error, 0, 0, _("Deleting \"%s\" failed: %s"),
+      g_set_error (error, GIMP_ERROR, GIMP_FAILED,
+		   _("Deleting \"%s\" failed: %s"),
                    gimp_filename_to_utf8 (filename), g_strerror (errno));
     }
 

Modified: trunk/app/gui/session.c
==============================================================================
--- trunk/app/gui/session.c	(original)
+++ trunk/app/gui/session.c	Wed Nov 12 10:56:06 2008
@@ -304,7 +304,8 @@
 
   if (g_unlink (filename) != 0 && errno != ENOENT)
     {
-      g_set_error (error, 0, 0, _("Deleting \"%s\" failed: %s"),
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+		   _("Deleting \"%s\" failed: %s"),
                    gimp_filename_to_utf8 (filename), g_strerror (errno));
       success = FALSE;
     }

Modified: trunk/app/menus/menus.c
==============================================================================
--- trunk/app/menus/menus.c	(original)
+++ trunk/app/menus/menus.c	Wed Nov 12 10:56:06 2008
@@ -438,7 +438,8 @@
     }
   else if (g_unlink (filename) != 0 && errno != ENOENT)
     {
-      g_set_error (error, 0, 0, _("Deleting \"%s\" failed: %s"),
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+		   _("Deleting \"%s\" failed: %s"),
                    gimp_filename_to_utf8 (filename), g_strerror (errno));
       success = FALSE;
     }

Modified: trunk/app/paint/gimpbrushcore.c
==============================================================================
--- trunk/app/paint/gimpbrushcore.c	(original)
+++ trunk/app/paint/gimpbrushcore.c	Wed Nov 12 10:56:06 2008
@@ -34,6 +34,7 @@
 
 #include "core/gimpbrush.h"
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 #include "core/gimpmarshal.h"
 
@@ -349,7 +350,7 @@
 
   if (! core->main_brush)
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("No brushes available for use with this tool."));
       return FALSE;
     }

Modified: trunk/app/paint/gimpclone.c
==============================================================================
--- trunk/app/paint/gimpclone.c	(original)
+++ trunk/app/paint/gimpclone.c	Wed Nov 12 10:56:06 2008
@@ -34,6 +34,7 @@
 
 #include "core/gimp.h"
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 #include "core/gimppattern.h"
 #include "core/gimppickable.h"
@@ -136,7 +137,7 @@
     {
       if (! gimp_context_get_pattern (GIMP_CONTEXT (options)))
         {
-          g_set_error_literal (error, 0, 0,
+          g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			       _("No patterns available for use with this tool."));
           return FALSE;
         }

Modified: trunk/app/paint/gimpheal.c
==============================================================================
--- trunk/app/paint/gimpheal.c	(original)
+++ trunk/app/paint/gimpheal.c	Wed Nov 12 10:56:06 2008
@@ -32,10 +32,11 @@
 #include "base/pixel-region.h"
 #include "base/temp-buf.h"
 
-#include "core/gimppickable.h"
-#include "core/gimpimage.h"
-#include "core/gimpdrawable.h"
 #include "core/gimpbrush.h"
+#include "core/gimpdrawable.h"
+#include "core/gimperror.h"
+#include "core/gimpimage.h"
+#include "core/gimppickable.h"
 
 #include "gimpheal.h"
 #include "gimpsourceoptions.h"
@@ -150,7 +151,7 @@
 
   if (! source_core->set_source && gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Healing does not operate on indexed layers."));
       return FALSE;
     }

Modified: trunk/app/paint/gimppaintcore-stroke.c
==============================================================================
--- trunk/app/paint/gimppaintcore-stroke.c	(original)
+++ trunk/app/paint/gimppaintcore-stroke.c	Wed Nov 12 10:56:06 2008
@@ -25,6 +25,7 @@
 #include "base/boundary.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 
 #include "vectors/gimpstroke.h"
 #include "vectors/gimpvectors.h"
@@ -328,11 +329,10 @@
       gimp_paint_core_cleanup (core);
     }
 
-  if (! initialized &&
-      due_to_lack_of_points &&
-      *error == NULL)
+  if (! initialized && due_to_lack_of_points && *error == NULL)
     {
-      g_set_error (error, 0, 0, _("Not enough points to stroke"));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Not enough points to stroke"));
     }
 
   return initialized;

Modified: trunk/app/paint/gimpperspectiveclone.c
==============================================================================
--- trunk/app/paint/gimpperspectiveclone.c	(original)
+++ trunk/app/paint/gimpperspectiveclone.c	Wed Nov 12 10:56:06 2008
@@ -36,6 +36,7 @@
 
 #include "core/gimp.h"
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 #include "core/gimppickable.h"
 #include "core/gimp-transform-region.h"
@@ -158,8 +159,9 @@
 
   if (! source_core->set_source && gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
-			   _("Perspective Clone does not operate on indexed layers."));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Perspective Clone does not operate on "
+			     "indexed layers."));
       return FALSE;
     }
 

Modified: trunk/app/paint/gimpsourcecore.c
==============================================================================
--- trunk/app/paint/gimpsourcecore.c	(original)
+++ trunk/app/paint/gimpsourcecore.c	Wed Nov 12 10:56:06 2008
@@ -30,6 +30,7 @@
 
 #include "core/gimp.h"
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 #include "core/gimppickable.h"
 
@@ -224,7 +225,8 @@
     {
       if (! source_core->src_drawable)
         {
-          g_set_error_literal (error, 0, 0, _("Set a source image first."));
+          g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			       _("Set a source image first."));
           return FALSE;
         }
 

Modified: trunk/app/tools/gimpblendtool.c
==============================================================================
--- trunk/app/tools/gimpblendtool.c	(original)
+++ trunk/app/tools/gimpblendtool.c	Wed Nov 12 10:56:06 2008
@@ -29,6 +29,7 @@
 
 #include "core/gimpdrawable.h"
 #include "core/gimpdrawable-blend.h"
+#include "core/gimperror.h"
 #include "core/gimpgradient.h"
 #include "core/gimpimage.h"
 #include "core/gimpprogress.h"
@@ -159,7 +160,7 @@
 
   if (gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Blend does not operate on indexed layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimpbrightnesscontrasttool.c
==============================================================================
--- trunk/app/tools/gimpbrightnesscontrasttool.c	(original)
+++ trunk/app/tools/gimpbrightnesscontrasttool.c	Wed Nov 12 10:56:06 2008
@@ -34,6 +34,7 @@
 #include "gegl/gimpbrightnesscontrastconfig.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -179,7 +180,7 @@
 
   if (gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Brightness-Contrast does not operate "
 			     "on indexed layers."));
       return FALSE;

Modified: trunk/app/tools/gimpcolorbalancetool.c
==============================================================================
--- trunk/app/tools/gimpcolorbalancetool.c	(original)
+++ trunk/app/tools/gimpcolorbalancetool.c	Wed Nov 12 10:56:06 2008
@@ -33,6 +33,7 @@
 #include "gegl/gimpcolorbalanceconfig.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -159,7 +160,7 @@
 
   if (! gimp_drawable_is_rgb (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Color Balance operates only on RGB color layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimpcolorizetool.c
==============================================================================
--- trunk/app/tools/gimpcolorizetool.c	(original)
+++ trunk/app/tools/gimpcolorizetool.c	Wed Nov 12 10:56:06 2008
@@ -33,6 +33,7 @@
 #include "gegl/gimpcolorizeconfig.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -152,8 +153,8 @@
 
   if (! gimp_drawable_is_rgb (drawable))
     {
-      g_set_error (error, 0, 0,
-                   _("Colorize operates only on RGB color layers."));
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+			   _("Colorize operates only on RGB color layers."));
       return FALSE;
     }
 

Modified: trunk/app/tools/gimpcurvestool.c
==============================================================================
--- trunk/app/tools/gimpcurvestool.c	(original)
+++ trunk/app/tools/gimpcurvestool.c	Wed Nov 12 10:56:06 2008
@@ -43,6 +43,7 @@
 #include "core/gimpcurve-map.h"
 #include "core/gimpdrawable.h"
 #include "core/gimpdrawable-histogram.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimpcolorbar.h"
@@ -217,7 +218,7 @@
 
   if (gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Curves does not operate on indexed layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimpdesaturatetool.c
==============================================================================
--- trunk/app/tools/gimpdesaturatetool.c	(original)
+++ trunk/app/tools/gimpdesaturatetool.c	Wed Nov 12 10:56:06 2008
@@ -32,6 +32,7 @@
 #include "gegl/gimpdesaturateconfig.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -121,7 +122,7 @@
 
   if (! gimp_drawable_is_rgb (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Desaturate does only operate on RGB layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimpgegltool.c
==============================================================================
--- trunk/app/tools/gimpgegltool.c	(original)
+++ trunk/app/tools/gimpgegltool.c	Wed Nov 12 10:56:06 2008
@@ -32,6 +32,7 @@
 #include "tools-types.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 #include "core/gimpimagemap.h"
 
@@ -154,7 +155,7 @@
 
   if (gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("GEGL operations do not operate on indexed layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimphuesaturationtool.c
==============================================================================
--- trunk/app/tools/gimphuesaturationtool.c	(original)
+++ trunk/app/tools/gimphuesaturationtool.c	Wed Nov 12 10:56:06 2008
@@ -34,6 +34,7 @@
 #include "gegl/gimpoperationhuesaturation.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -167,7 +168,7 @@
 
   if (! gimp_drawable_is_rgb (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Hue-Saturation operates only on RGB color layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimplevelstool.c
==============================================================================
--- trunk/app/tools/gimplevelstool.c	(original)
+++ trunk/app/tools/gimplevelstool.c	Wed Nov 12 10:56:06 2008
@@ -40,6 +40,7 @@
 
 #include "core/gimpdrawable.h"
 #include "core/gimpdrawable-histogram.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimpcolorbar.h"
@@ -224,7 +225,7 @@
 
   if (gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Levels does not operate on indexed layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimpposterizetool.c
==============================================================================
--- trunk/app/tools/gimpposterizetool.c	(original)
+++ trunk/app/tools/gimpposterizetool.c	Wed Nov 12 10:56:06 2008
@@ -33,6 +33,7 @@
 #include "gegl/gimpposterizeconfig.h"
 
 #include "core/gimpdrawable.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -147,7 +148,7 @@
 
   if (gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Posterize does not operate on indexed layers."));
       return FALSE;
     }

Modified: trunk/app/tools/gimpthresholdtool.c
==============================================================================
--- trunk/app/tools/gimpthresholdtool.c	(original)
+++ trunk/app/tools/gimpthresholdtool.c	Wed Nov 12 10:56:06 2008
@@ -33,6 +33,7 @@
 
 #include "core/gimpdrawable.h"
 #include "core/gimpdrawable-histogram.h"
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 
 #include "widgets/gimphelp-ids.h"
@@ -157,7 +158,7 @@
 
   if (gimp_drawable_is_indexed (drawable))
     {
-      g_set_error_literal (error, 0, 0,
+      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
 			   _("Threshold does not operate on indexed layers."));
       return FALSE;
     }

Modified: trunk/app/vectors/gimpvectors-export.c
==============================================================================
--- trunk/app/vectors/gimpvectors-export.c	(original)
+++ trunk/app/vectors/gimpvectors-export.c	Wed Nov 12 10:56:06 2008
@@ -79,7 +79,8 @@
   file = g_fopen (filename, "w");
   if (!file)
     {
-      g_set_error (error, 0, 0, _("Could not open '%s' for writing: %s"),
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+		   _("Could not open '%s' for writing: %s"),
                    gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
@@ -92,7 +93,8 @@
 
   if (fclose (file))
     {
-      g_set_error (error, 0, 0, _("Error while writing '%s': %s"),
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+		   _("Error while writing '%s': %s"),
                    gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }

Modified: trunk/app/vectors/gimpvectors-import.c
==============================================================================
--- trunk/app/vectors/gimpvectors-import.c	(original)
+++ trunk/app/vectors/gimpvectors-import.c	Wed Nov 12 10:56:06 2008
@@ -43,6 +43,7 @@
 
 #include "config/gimpxmlparser.h"
 
+#include "core/gimperror.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-undo.h"
 
@@ -333,10 +334,12 @@
       else
         {
           if (filename)
-            g_set_error (error, 0, 0, _("No paths found in '%s'"),
+            g_set_error (error, GIMP_ERROR, GIMP_FAILED,
+			 _("No paths found in '%s'"),
                          gimp_filename_to_utf8 (filename));
           else
-            g_set_error (error, 0, 0, _("No paths found in the buffer"));
+            g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+				 _("No paths found in the buffer"));
 
           success = FALSE;
         }

Modified: trunk/app/widgets/gimpdevices.c
==============================================================================
--- trunk/app/widgets/gimpdevices.c	(original)
+++ trunk/app/widgets/gimpdevices.c	Wed Nov 12 10:56:06 2008
@@ -255,7 +255,8 @@
 
   if (g_unlink (filename) != 0 && errno != ENOENT)
     {
-      g_set_error (error, 0, 0, _("Deleting \"%s\" failed: %s"),
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+		   _("Deleting \"%s\" failed: %s"),
                    gimp_filename_to_utf8 (filename), g_strerror (errno));
       success = FALSE;
     }



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