summaryrefslogtreecommitdiff
path: root/src/fr-proc-error.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-21 17:12:25 +0100
committerinfirit <[email protected]>2014-11-22 20:25:30 +0100
commitb99f3f5e8080f266affd9734d4f73dac0c67215e (patch)
tree4fe239a05e06136e388c1c31c2c4ef5a52ded7d7 /src/fr-proc-error.c
parent770df1b16c7285cdcb1ba661f6a49ad022d4ac87 (diff)
downloadengrampa-b99f3f5e8080f266affd9734d4f73dac0c67215e.tar.bz2
engrampa-b99f3f5e8080f266affd9734d4f73dac0c67215e.tar.xz
use a boxed type to pass the error to the 'done' signal
Based on FR commit: 4b645f57c856928c508dd74c31e1bfb2132368e1 From: Paolo Bacchilega <[email protected]>
Diffstat (limited to 'src/fr-proc-error.c')
-rw-r--r--src/fr-proc-error.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/fr-proc-error.c b/src/fr-proc-error.c
new file mode 100644
index 0000000..1f61613
--- /dev/null
+++ b/src/fr-proc-error.c
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * File-Roller
+ *
+ * Copyright (C) 2001 The Free Software Foundation, Inc.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include "fr-proc-error.h"
+
+
+static gpointer
+fr_proc_error_copy (gpointer boxed)
+{
+ FrProcError *old_error = boxed;
+ FrProcError *new_error;
+
+ new_error = g_new (FrProcError, 1);
+ new_error->type = old_error->type;
+ new_error->status = old_error->status;
+ new_error->gerror = (old_error->gerror != NULL) ? g_error_copy (old_error->gerror) : NULL;
+
+ return new_error;
+}
+
+
+static void
+fr_proc_error_free (gpointer boxed)
+{
+ FrProcError *error = boxed;
+
+ if (error->gerror != NULL)
+ g_error_free (error->gerror);
+ g_free (error);
+}
+
+
+G_DEFINE_BOXED_TYPE (FrProcError,
+ fr_proc_error,
+ fr_proc_error_copy,
+ fr_proc_error_free)