[balsa/gtk3] Define a GQuark for POP3 error reporting



commit fee407b81a0eebf214470e1f8c99171472dace58
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jun 10 16:02:43 2012 -0400

    Define a GQuark for POP3 error reporting
    
    	* libbalsa/imap/pop3.c (pop_imap_error_quark): a GQuark for use
    	in g_set_error.
    	* libbalsa/imap/pop3.h: export it.

 ChangeLog            |    6 ++++++
 libbalsa/imap/pop3.c |   14 ++++++++++++++
 libbalsa/imap/pop3.h |    7 +++----
 3 files changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 519b388..bb53787 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2012-06-09  Peter Bloomfield
 
 	* libbalsa/mailbox.h: do not export
diff --git a/libbalsa/imap/pop3.c b/libbalsa/imap/pop3.c
index dbe5222..9072ba0 100644
--- a/libbalsa/imap/pop3.c
+++ b/libbalsa/imap/pop3.c
@@ -111,6 +111,20 @@ struct PopHandle_ {
 };
 #define pop_can_do(pop, cap) ((pop)->capabilities[cap])
 
+/*
+ * IMAP_ERROR domain for g_set_error()
+ */
+GQuark
+pop_imap_error_quark(void)
+{
+    static GQuark quark;
+
+    if (!quark)
+        quark = g_quark_from_static_string("imap-pop3-error-quark");
+
+    return quark;
+}
+
 PopHandle *
 pop_new(void)
 {
diff --git a/libbalsa/imap/pop3.h b/libbalsa/imap/pop3.h
index bfdb223..3311833 100644
--- a/libbalsa/imap/pop3.h
+++ b/libbalsa/imap/pop3.h
@@ -35,10 +35,9 @@
  * Error domains for GError: only one for now, more to come.
  */
 
-enum {
-    IMAP_ERROR
-};
- 
+#define IMAP_ERROR pop_imap_error_quark()
+GQuark pop_imap_error_quark(void);
+
 /*
  * Error codes for GError: only one for now, more to come.
  */



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