[balsa/gtk3] Define GQuarks for use as GError domains
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Define GQuarks for use as GError domains
- Date: Sun, 10 Jun 2012 21:50:28 +0000 (UTC)
commit fb64f470b0e2a07d1e9487dabe69b6370215c650
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sun Jun 10 17:48:51 2012 -0400
Define GQuarks for use as GError domains
* libbalsa/libbalsa.c (libbalsa_scanner_error_quark),
(libbalsa_mailbox_error_quark), (libbalsa_image_error_quark):
GQuarks for GError.
* libbalsa/libbalsa.h: export them.
ChangeLog | 7 +++++++
libbalsa/libbalsa.c | 40 ++++++++++++++++++++++++++++++----------
libbalsa/libbalsa.h | 8 ++++----
3 files changed, 41 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bb53787..c684b5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2012-06-10 Peter Bloomfield
+ * libbalsa/libbalsa.c (libbalsa_scanner_error_quark),
+ (libbalsa_mailbox_error_quark), (libbalsa_image_error_quark):
+ GQuarks for GError.
+ * libbalsa/libbalsa.h: export them.
+
+2012-06-10 Peter Bloomfield
+
* libbalsa/imap/pop3.c (pop_imap_error_quark): a GQuark for use
in g_set_error.
* libbalsa/imap/pop3.h: export it.
diff --git a/libbalsa/libbalsa.c b/libbalsa/libbalsa.c
index c81ac13..8db961e 100644
--- a/libbalsa/libbalsa.c
+++ b/libbalsa/libbalsa.c
@@ -890,16 +890,6 @@ libbalsa_get_image_from_face_header(const gchar * content, GError ** err)
return image;
}
-
-GQuark
-libbalsa_image_error_quark(void)
-{
- static GQuark quark = 0;
- if (quark == 0)
- quark = g_quark_from_static_string("libbalsa-image-error-quark");
- return quark;
-}
-
#if HAVE_COMPFACE
GtkWidget *
libbalsa_get_image_from_x_face_header(const gchar * content, GError ** err)
@@ -1024,3 +1014,33 @@ libbalsa_source_view_new(gboolean highlight_phrases)
}
#endif /* HAVE_GTKSOURCEVIEW */
+/*
+ * Error domains for GError:
+ */
+
+GQuark
+libbalsa_scanner_error_quark(void)
+{
+ static GQuark quark = 0;
+ if (quark == 0)
+ quark = g_quark_from_static_string("libbalsa-scanner-error-quark");
+ return quark;
+}
+
+GQuark
+libbalsa_mailbox_error_quark(void)
+{
+ static GQuark quark = 0;
+ if (quark == 0)
+ quark = g_quark_from_static_string("libbalsa-mailbox-error-quark");
+ return quark;
+}
+
+GQuark
+libbalsa_image_error_quark(void)
+{
+ static GQuark quark = 0;
+ if (quark == 0)
+ quark = g_quark_from_static_string("libbalsa-image-error-quark");
+ return quark;
+}
diff --git a/libbalsa/libbalsa.h b/libbalsa/libbalsa.h
index 145c1bd..21248ee 100644
--- a/libbalsa/libbalsa.h
+++ b/libbalsa/libbalsa.h
@@ -78,10 +78,10 @@ typedef struct _LibbalsaVfs LibbalsaVfs;
/*
* Error domains for GError:
*/
-enum {
- LIBBALSA_SCANNER_ERROR,
- LIBBALSA_MAILBOX_ERROR
-};
+GQuark libbalsa_scanner_error_quark(void);
+#define LIBBALSA_SCANNER_ERROR libbalsa_scanner_error_quark()
+GQuark libbalsa_mailbox_error_quark(void);
+#define LIBBALSA_MAILBOX_ERROR libbalsa_mailbox_error_quark()
/*
* Error codes for GError:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]