diff options
author | Bastien Nocera <hadess@hadess.net> | 2021-02-18 17:16:53 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2021-03-23 14:58:06 +0100 |
commit | 4eabfa997b66ad01feae3a762ab3f29cf0c85cc8 (patch) | |
tree | 958de02a7a170dd456312edbe49c7ae425fb5808 | |
parent | 020a752a9e7107c61f25316623d775962fbc0157 (diff) | |
download | gnome-bluetooth-wip/hadess/rename-agent-func.tar.gz |
agent: Rename "display" function to match BlueZ agent namewip/hadess/rename-agent-func
Rename "Display" function to "DisplayPasskey" to differentiate it from
"DisplayPinCode".
-rw-r--r-- | lib/bluetooth-agent.c | 18 | ||||
-rw-r--r-- | lib/bluetooth-agent.h | 16 | ||||
-rw-r--r-- | lib/bluetooth-settings-widget.c | 15 | ||||
-rw-r--r-- | lib/gnome-bluetooth.map | 2 |
4 files changed, 25 insertions, 26 deletions
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c index d12aa96b..7fadc015 100644 --- a/lib/bluetooth-agent.c +++ b/lib/bluetooth-agent.c @@ -85,8 +85,8 @@ struct _BluetoothAgent { BluetoothAgentPasskeyFunc pincode_func; gpointer pincode_data; - BluetoothAgentDisplayFunc display_func; - gpointer display_data; + BluetoothAgentDisplayPasskeyFunc display_passkey_func; + gpointer display_passkey_data; BluetoothAgentDisplayPinCodeFunc display_pincode_func; gpointer display_pincode_data; @@ -173,15 +173,15 @@ static gboolean bluetooth_agent_display_passkey(BluetoothAgent *agent, { g_autoptr(GDBusProxy) device = NULL; - if (agent->display_func == NULL) + if (agent->display_passkey_func == NULL) return FALSE; device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - agent->display_func(invocation, device, passkey, entered, - agent->display_data); + agent->display_passkey_func(invocation, device, passkey, entered, + agent->display_passkey_data); return TRUE; } @@ -567,13 +567,13 @@ void bluetooth_agent_set_passkey_func(BluetoothAgent *agent, agent->passkey_data = data; } -void bluetooth_agent_set_display_func(BluetoothAgent *agent, - BluetoothAgentDisplayFunc func, gpointer data) +void bluetooth_agent_set_display_passkey_func(BluetoothAgent *agent, + BluetoothAgentDisplayPasskeyFunc func, gpointer data) { g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - agent->display_func = func; - agent->display_data = data; + agent->display_passkey_func = func; + agent->display_passkey_data = data; } void bluetooth_agent_set_display_pincode_func(BluetoothAgent *agent, diff --git a/lib/bluetooth-agent.h b/lib/bluetooth-agent.h index 1727a4ab..5a5055e5 100644 --- a/lib/bluetooth-agent.h +++ b/lib/bluetooth-agent.h @@ -37,11 +37,11 @@ gboolean bluetooth_agent_unregister(BluetoothAgent *agent); typedef void (*BluetoothAgentPasskeyFunc) (GDBusMethodInvocation *invocation, GDBusProxy *device, gpointer data); -typedef void (*BluetoothAgentDisplayFunc) (GDBusMethodInvocation *invocation, - GDBusProxy *device, - guint passkey, - guint entered, - gpointer data); +typedef void (*BluetoothAgentDisplayPasskeyFunc) (GDBusMethodInvocation *invocation, + GDBusProxy *device, + guint passkey, + guint entered, + gpointer data); typedef void (*BluetoothAgentDisplayPinCodeFunc) (GDBusMethodInvocation *invocation, GDBusProxy *device, const char *pincode, @@ -66,9 +66,9 @@ void bluetooth_agent_set_pincode_func (BluetoothAgent *agent, void bluetooth_agent_set_passkey_func (BluetoothAgent *agent, BluetoothAgentPasskeyFunc func, gpointer data); -void bluetooth_agent_set_display_func (BluetoothAgent *agent, - BluetoothAgentDisplayFunc func, - gpointer data); +void bluetooth_agent_set_display_passkey_func (BluetoothAgent *agent, + BluetoothAgentDisplayPasskeyFunc func, + gpointer data); void bluetooth_agent_set_display_pincode_func (BluetoothAgent *agent, BluetoothAgentDisplayPinCodeFunc func, gpointer data); diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c index 8832f31f..961ec0f9 100644 --- a/lib/bluetooth-settings-widget.c +++ b/lib/bluetooth-settings-widget.c @@ -552,19 +552,18 @@ display_passkey_or_pincode_cb (GtkDialog *dialog, g_clear_pointer (&priv->pairing_dialog, gtk_widget_destroy); } -static void -display_callback (GDBusMethodInvocation *invocation, - GDBusProxy *device, - guint pin, - guint entered, - gpointer user_data) +display_passkey_callback (GDBusMethodInvocation *invocation, + GDBusProxy *device, + guint pin, + guint entered, + gpointer user_data) { BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); g_autofree char *pin_str = NULL; g_autofree char *name = NULL; - g_debug ("display_callback (%s, %i, %i)", g_dbus_proxy_get_object_path (device), pin, entered); + g_debug ("display_passkey_callback (%s, %i, %i)", g_dbus_proxy_get_object_path (device), pin, entered); if (priv->pairing_dialog == NULL || bluetooth_pairing_dialog_get_mode (BLUETOOTH_PAIRING_DIALOG (priv->pairing_dialog)) != BLUETOOTH_PAIRING_MODE_PIN_DISPLAY_KEYBOARD) @@ -1844,7 +1843,7 @@ setup_pairing_agent (BluetoothSettingsWidget *self) bluetooth_agent_set_pincode_func (priv->agent, pincode_callback, self); bluetooth_agent_set_passkey_func (priv->agent, passkey_callback, self); - bluetooth_agent_set_display_func (priv->agent, display_callback, self); + bluetooth_agent_set_display_passkey_func (priv->agent, display_passkey_callback, self); bluetooth_agent_set_display_pincode_func (priv->agent, display_pincode_callback, self); bluetooth_agent_set_cancel_func (priv->agent, cancel_callback, self); bluetooth_agent_set_confirm_func (priv->agent, confirm_callback, self); diff --git a/lib/gnome-bluetooth.map b/lib/gnome-bluetooth.map index 274f794a..95bc83dc 100644 --- a/lib/gnome-bluetooth.map +++ b/lib/gnome-bluetooth.map @@ -60,7 +60,7 @@ global: bluetooth_agent_set_cancel_func; bluetooth_agent_error_quark; bluetooth_agent_set_authorize_func; - bluetooth_agent_set_display_func; + bluetooth_agent_set_display_passkey_func; bluetooth_agent_set_display_pincode_func; bluetooth_agent_set_authorize_service_func; bluetooth_settings_widget_get_type; |