[gnome-bluetooth/wip/hadess/fix-keyboard-cancel: 2/7] agent: Rename "display" function to match BlueZ agent name
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/fix-keyboard-cancel: 2/7] agent: Rename "display" function to match BlueZ agent name
- Date: Thu, 18 Feb 2021 17:02:45 +0000 (UTC)
commit f3ec1a60809a763ccff51e9bcbc98463653b9bfc
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 18 17:16:53 2021 +0100
agent: Rename "display" function to match BlueZ agent name
Rename "Display" function to "DisplayPasskey" to differentiate it from
"DisplayPinCode".
lib/bluetooth-agent.c | 18 +++++++++---------
lib/bluetooth-agent.h | 16 ++++++++--------
lib/bluetooth-settings-widget.c | 14 +++++++-------
3 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c
index 53aa8147..16fd00ec 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;
}
@@ -580,13 +580,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 dd4015cb..b0190477 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -524,17 +524,17 @@ pincode_callback (GDBusMethodInvocation *invocation,
}
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);
char *pin_str, *name;
- 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)
@@ -1845,7 +1845,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]