[gnome-bluetooth/wip/hadess/cleanups: 6/9] lib: Namespace BluetoothAgent errors correctly




commit 4378bdb7077eae511fe22a32c72a03b330ea316b
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 17 16:18:30 2021 +0100

    lib: Namespace BluetoothAgent errors correctly

 lib/bluetooth-agent.c | 6 +++---
 lib/bluetooth-agent.h | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c
index 82404766..6185a297 100644
--- a/lib/bluetooth-agent.c
+++ b/lib/bluetooth-agent.c
@@ -427,7 +427,7 @@ handle_method_call (GDBusConnection       *connection,
 
        if (g_str_equal (sender, agent->busname) == FALSE) {
                GError *error;
-               error = g_error_new (AGENT_ERROR, AGENT_ERROR_REJECT,
+               error = g_error_new (BLUETOOTH_AGENT_ERROR, BLUETOOTH_AGENT_ERROR_REJECT,
                                     "Permission Denied");
                g_dbus_method_invocation_take_error(invocation, error);
                return;
@@ -648,11 +648,11 @@ GType bluetooth_agent_error_get_type(void)
        static GType etype = 0;
        if (etype == 0) {
                static const GEnumValue values[] = {
-                       ENUM_ENTRY(AGENT_ERROR_REJECT, "Rejected"),
+                       ENUM_ENTRY(BLUETOOTH_AGENT_ERROR_REJECT, "Rejected"),
                        { 0, 0, 0 }
                };
 
-               etype = g_enum_register_static("agent", values);
+               etype = g_enum_register_static("BluetoothAgentError", values);
        }
 
        return etype;
diff --git a/lib/bluetooth-agent.h b/lib/bluetooth-agent.h
index a758e6f2..1727a4ab 100644
--- a/lib/bluetooth-agent.h
+++ b/lib/bluetooth-agent.h
@@ -85,12 +85,12 @@ 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())
+#define BLUETOOTH_AGENT_ERROR (bluetooth_agent_error_quark())
+#define BLUETOOTH_AGENT_ERROR_TYPE (bluetooth_agent_error_get_type())
 
 typedef enum {
-       AGENT_ERROR_REJECT
-} AgentError;
+       BLUETOOTH_AGENT_ERROR_REJECT
+} BluetoothAgentError;
 
 GType  bluetooth_agent_error_get_type (void);
 GQuark bluetooth_agent_error_quark    (void);


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