[gimp] libgimp: remove gimp_get_pdb_error()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimp: remove gimp_get_pdb_error()
- Date: Fri, 16 Aug 2019 21:01:34 +0000 (UTC)
commit 515dcbb1eed8e8fda3dd087dd0fcdcef72f7ad62
Author: Michael Natterer <mitch gimp org>
Date: Fri Aug 16 23:00:46 2019 +0200
libgimp: remove gimp_get_pdb_error()
libgimp/gimp.def | 1 -
libgimp/gimplegacy.c | 87 ----------------------------------------------------
libgimp/gimplegacy.h | 5 ---
3 files changed, 93 deletions(-)
---
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index b47a340c90..b9b9508f28 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -290,7 +290,6 @@ EXPORTS
gimp_get_parasite
gimp_get_parasite_list
gimp_get_pdb
- gimp_get_pdb_error
gimp_get_plug_in
gimp_get_progname
gimp_getpid
diff --git a/libgimp/gimplegacy.c b/libgimp/gimplegacy.c
index ffb48095c9..fe1b988762 100644
--- a/libgimp/gimplegacy.c
+++ b/libgimp/gimplegacy.c
@@ -64,7 +64,6 @@ static gboolean gimp_write (GIOChannel *channel,
gpointer user_data);
static gboolean gimp_flush (GIOChannel *channel,
gpointer user_data);
-static void gimp_set_pdb_error (GimpValueArray *return_vals);
GIOChannel *_gimp_readchannel = NULL;
@@ -75,9 +74,6 @@ static gulong write_buffer_index = 0;
static GimpPlugInInfo PLUG_IN_INFO = { 0, };
-static GimpPDBStatusType pdb_error_status = GIMP_PDB_SUCCESS;
-static gchar *pdb_error_message = NULL;
-
/**
* gimp_main_legacy:
@@ -302,60 +298,9 @@ gimp_run_procedure_array (const gchar *name,
gimp_wire_destroy (&msg);
- gimp_set_pdb_error (return_values);
-
return return_values;
}
-/**
- * gimp_get_pdb_error:
- *
- * Retrieves the error message from the last procedure call.
- *
- * If a procedure call fails, then it might pass an error message with
- * the return values. Plug-ins that are using the libgimp C wrappers
- * don't access the procedure return values directly. Thus libgimp
- * stores the error message and makes it available with this
- * function. The next procedure call unsets the error message again.
- *
- * The returned string is owned by libgimp and must not be freed or
- * modified.
- *
- * Returns: the error message
- *
- * Since: 2.6
- **/
-const gchar *
-gimp_get_pdb_error (void)
-{
- ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
- if (pdb_error_message && strlen (pdb_error_message))
- return pdb_error_message;
-
- switch (pdb_error_status)
- {
- case GIMP_PDB_SUCCESS:
- /* procedure executed successfully */
- return _("success");
-
- case GIMP_PDB_EXECUTION_ERROR:
- /* procedure execution failed */
- return _("execution error");
-
- case GIMP_PDB_CALLING_ERROR:
- /* procedure called incorrectly */
- return _("calling error");
-
- case GIMP_PDB_CANCEL:
- /* procedure execution cancelled */
- return _("cancelled");
-
- default:
- return "invalid return status";
- }
-}
-
void
_gimp_legacy_initialize (const GimpPlugInInfo *info,
GIOChannel *read_channel,
@@ -857,35 +802,3 @@ gimp_flush (GIOChannel *channel,
return TRUE;
}
-
-static void
-gimp_set_pdb_error (GimpValueArray *return_values)
-{
- g_clear_pointer (&pdb_error_message, g_free);
- pdb_error_status = GIMP_PDB_SUCCESS;
-
- if (gimp_value_array_length (return_values) > 0)
- {
- pdb_error_status =
- g_value_get_enum (gimp_value_array_index (return_values, 0));
-
- switch (pdb_error_status)
- {
- case GIMP_PDB_SUCCESS:
- case GIMP_PDB_PASS_THROUGH:
- break;
-
- case GIMP_PDB_EXECUTION_ERROR:
- case GIMP_PDB_CALLING_ERROR:
- case GIMP_PDB_CANCEL:
- if (gimp_value_array_length (return_values) > 1)
- {
- GValue *value = gimp_value_array_index (return_values, 1);
-
- if (G_VALUE_HOLDS_STRING (value))
- pdb_error_message = g_value_dup_string (value);
- }
- break;
- }
- }
-}
diff --git a/libgimp/gimplegacy.h b/libgimp/gimplegacy.h
index 9030764336..83cf460a20 100644
--- a/libgimp/gimplegacy.h
+++ b/libgimp/gimplegacy.h
@@ -259,11 +259,6 @@ void gimp_install_procedure (const gchar *name,
GimpValueArray * gimp_run_procedure_array (const gchar *name,
const GimpValueArray *arguments);
-/* Retrieve the error message and return status for the last procedure
- * call.
- */
-const gchar * gimp_get_pdb_error (void);
-
/* gimp_plugin API that should now be done by using GimpProcedure
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]