[gnome-bluetooth] Move AgentError to the shared BluetoothAgent



commit 6c6b73618be165281785370414c0c5f826099535
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Jun 13 19:35:49 2009 +0100

    Move AgentError to the shared BluetoothAgent
    
    So we can use it in the wizard as well.

 applet/agent.c        |   34 ----------------------------------
 lib/bluetooth-agent.c |   27 +++++++++++++++++++++++++++
 lib/bluetooth-agent.h |   10 ++++++++++
 3 files changed, 37 insertions(+), 34 deletions(-)
---
diff --git a/applet/agent.c b/applet/agent.c
index 948ccc0..64fbf81 100644
--- a/applet/agent.c
+++ b/applet/agent.c
@@ -42,40 +42,6 @@
 static BluetoothClient *client;
 static GtkTreeModel *adapter_model;
 
-typedef enum {
-	AGENT_ERROR_REJECT
-} AgentError;
-
-#define AGENT_ERROR (agent_error_quark())
-
-#define AGENT_ERROR_TYPE (agent_error_get_type()) 
-
-static GQuark agent_error_quark(void)
-{
-	static GQuark quark = 0;
-	if (!quark)
-		quark = g_quark_from_static_string("agent");
-
-	return quark;
-}
-
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-static GType agent_error_get_type(void)
-{
-	static GType etype = 0;
-	if (etype == 0) {
-		static const GEnumValue values[] = {
-			ENUM_ENTRY(AGENT_ERROR_REJECT, "Rejected"),
-			{ 0, 0, 0 }
-		};
-
-		etype = g_enum_register_static("agent", values);
-	}
-
-	return etype;
-}
-
 static GList *input_list = NULL;
 
 typedef struct input_data input_data;
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c
index bdc20b6..b88520c 100644
--- a/lib/bluetooth-agent.c
+++ b/lib/bluetooth-agent.c
@@ -528,3 +528,30 @@ void bluetooth_agent_set_cancel_func(BluetoothAgent *agent,
 	priv->cancel_func = func;
 	priv->cancel_data = data;
 }
+
+GQuark bluetooth_agent_error_quark(void)
+{
+	static GQuark quark = 0;
+	if (!quark)
+		quark = g_quark_from_static_string("agent");
+
+	return quark;
+}
+
+#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
+
+GType bluetooth_agent_error_get_type(void)
+{
+	static GType etype = 0;
+	if (etype == 0) {
+		static const GEnumValue values[] = {
+			ENUM_ENTRY(AGENT_ERROR_REJECT, "Rejected"),
+			{ 0, 0, 0 }
+		};
+
+		etype = g_enum_register_static("agent", values);
+	}
+
+	return etype;
+}
+
diff --git a/lib/bluetooth-agent.h b/lib/bluetooth-agent.h
index bc861f5..a212ab5 100644
--- a/lib/bluetooth-agent.h
+++ b/lib/bluetooth-agent.h
@@ -88,6 +88,16 @@ void bluetooth_agent_set_authorize_func(BluetoothAgent *agent,
 void bluetooth_agent_set_cancel_func(BluetoothAgent *agent,
 				BluetoothAgentCancelFunc func, gpointer data);
 
+#define AGENT_ERROR (bluetooth_agent_error_quark())
+#define AGENT_ERROR_TYPE (bluetooth_agent_error_get_type()) 
+
+typedef enum {
+	AGENT_ERROR_REJECT
+} AgentError;
+
+GType bluetooth_agent_error_get_type(void);
+GQuark bluetooth_agent_error_quark(void);
+
 G_END_DECLS
 
 #endif /* __BLUETOOTH_AGENT_H */



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