diff -Nru gnome-bluetooth-3.34.3/.ci/gbt.suppr gnome-bluetooth-3.34.5/.ci/gbt.suppr --- gnome-bluetooth-3.34.3/.ci/gbt.suppr 1970-01-01 00:00:00.000000000 +0000 +++ gnome-bluetooth-3.34.5/.ci/gbt.suppr 2021-03-23 15:09:30.413372300 +0000 @@ -0,0 +1,3 @@ +[suppress_function] +symbol_name_regexp = bluetooth_agent_.* +drop = yes diff -Nru gnome-bluetooth-3.34.3/debian/changelog gnome-bluetooth-3.34.5/debian/changelog --- gnome-bluetooth-3.34.3/debian/changelog 2020-10-02 09:25:06.000000000 +0000 +++ gnome-bluetooth-3.34.5/debian/changelog 2021-03-23 19:39:10.000000000 +0000 @@ -1,3 +1,20 @@ +gnome-bluetooth (3.34.5-1) experimental; urgency=medium + + * New upstream release: + - the "Cancel" button works now when pairing keyboards + (lp: #1845163) + * New upstream release + * debian/libgnome-bluetooth13.symbols: + - updated symbols list for the new version + * debian/control.in: + - updated the build requirements for the new integration tests + * debian/rules: + - don't make the tests fail the build, those are new and depending on + python-dbusmock features that are not available in Debian yet + - use xvfb for the integration tests + + -- Sebastien Bacher Tue, 23 Mar 2021 20:39:10 +0100 + gnome-bluetooth (3.34.3-2) unstable; urgency=medium * debian/gnome-bluetooth.docs: refreshed to follow upstream renaming diff -Nru gnome-bluetooth-3.34.3/debian/control gnome-bluetooth-3.34.5/debian/control --- gnome-bluetooth-3.34.3/debian/control 2020-10-02 09:22:25.000000000 +0000 +++ gnome-bluetooth-3.34.5/debian/control 2021-03-23 19:39:10.000000000 +0000 @@ -18,7 +18,11 @@ libnotify-dev, libudev-dev, libxml2-utils, - meson (>= 0.49.0) + meson (>= 0.49.0), + python3-dbus , + python3-dbusmock , + python3-gi , + xvfb , Rules-Requires-Root: no Standards-Version: 4.4.0 Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-bluetooth diff -Nru gnome-bluetooth-3.34.3/debian/control.in gnome-bluetooth-3.34.5/debian/control.in --- gnome-bluetooth-3.34.3/debian/control.in 2020-10-02 09:22:25.000000000 +0000 +++ gnome-bluetooth-3.34.5/debian/control.in 2021-03-23 19:39:10.000000000 +0000 @@ -14,7 +14,11 @@ libnotify-dev, libudev-dev, libxml2-utils, - meson (>= 0.49.0) + meson (>= 0.49.0), + python3-dbus , + python3-dbusmock , + python3-gi , + xvfb , Rules-Requires-Root: no Standards-Version: 4.4.0 Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-bluetooth diff -Nru gnome-bluetooth-3.34.3/debian/gbp.conf gnome-bluetooth-3.34.5/debian/gbp.conf --- gnome-bluetooth-3.34.3/debian/gbp.conf 2020-10-02 09:22:25.000000000 +0000 +++ gnome-bluetooth-3.34.5/debian/gbp.conf 2021-03-23 19:39:10.000000000 +0000 @@ -11,7 +11,6 @@ [import-orig] postimport = dch -v%(version)s New upstream release; git add debian/changelog; debcommit -upstream-vcs-tag = GNOMEBT_V_%(version%.%_)s [pq] patch-numbers = False diff -Nru gnome-bluetooth-3.34.3/debian/libgnome-bluetooth13.symbols gnome-bluetooth-3.34.5/debian/libgnome-bluetooth13.symbols --- gnome-bluetooth-3.34.3/debian/libgnome-bluetooth13.symbols 2020-10-02 09:22:25.000000000 +0000 +++ gnome-bluetooth-3.34.5/debian/libgnome-bluetooth13.symbols 2021-03-23 19:39:10.000000000 +0000 @@ -1,13 +1,15 @@ libgnome-bluetooth.so.13 libgnome-bluetooth13 #MINVER# * Build-Depends-Package: libgnome-bluetooth-dev + bluetooth_agent_error_get_type@Base 3.34.5 bluetooth_agent_error_quark@Base 3.12.0 + bluetooth_agent_get_type@Base 3.34.5 bluetooth_agent_new@Base 3.12.0 bluetooth_agent_register@Base 3.12.0 bluetooth_agent_set_authorize_func@Base 3.12.0 bluetooth_agent_set_authorize_service_func@Base 3.12.0 bluetooth_agent_set_cancel_func@Base 3.12.0 bluetooth_agent_set_confirm_func@Base 3.12.0 - bluetooth_agent_set_display_func@Base 3.12.0 + bluetooth_agent_set_display_passkey_func@Base 3.34.5 bluetooth_agent_set_display_pincode_func@Base 3.12.0 bluetooth_agent_set_passkey_func@Base 3.12.0 bluetooth_agent_set_pincode_func@Base 3.12.0 @@ -33,6 +35,8 @@ bluetooth_chooser_start_discovery@Base 3.12.0 bluetooth_chooser_stop_discovery@Base 3.12.0 bluetooth_class_to_type@Base 3.12.0 + bluetooth_client_cancel_setup_device@Base 3.34.5 + bluetooth_client_cancel_setup_device_finish@Base 3.34.5 bluetooth_client_connect_service@Base 3.12.0 bluetooth_client_connect_service_finish@Base 3.12.0 bluetooth_client_dump_device@Base 3.12.0 diff -Nru gnome-bluetooth-3.34.3/debian/rules gnome-bluetooth-3.34.5/debian/rules --- gnome-bluetooth-3.34.3/debian/rules 2020-10-02 09:22:25.000000000 +0000 +++ gnome-bluetooth-3.34.5/debian/rules 2021-03-23 19:39:10.000000000 +0000 @@ -24,3 +24,7 @@ override_dh_girepository: dh_girepository -l applet \ /usr/lib/$(DEB_HOST_MULTIARCH)/gnome-bluetooth/ + +override_dh_auto_test: + # don't fail test for now since they rely on a not available dbusmock + env -u LD_PRELOAD xvfb-run -s -noreset dh_auto_test || true diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-agent.c gnome-bluetooth-3.34.5/lib/bluetooth-agent.c --- gnome-bluetooth-3.34.3/lib/bluetooth-agent.c 2020-10-01 09:19:42.287874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-agent.c 2021-03-23 15:09:30.416372300 +0000 @@ -71,12 +71,9 @@ " " ""; -#define BLUETOOTH_AGENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ - BLUETOOTH_TYPE_AGENT, BluetoothAgentPrivate)) +struct _BluetoothAgent { + GObject parent; -typedef struct _BluetoothAgentPrivate BluetoothAgentPrivate; - -struct _BluetoothAgentPrivate { GDBusConnection *conn; gchar *busname; gchar *path; @@ -88,8 +85,8 @@ 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; @@ -110,6 +107,8 @@ gpointer cancel_data; }; +G_DEFINE_TYPE(BluetoothAgent, bluetooth_agent, G_TYPE_OBJECT) + enum { PROP_0, PROP_PATH, @@ -119,12 +118,12 @@ static GParamSpec *props[PROP_LAST]; static GDBusProxy * -get_device_from_path (BluetoothAgentPrivate *priv, - const char *path) +get_device_from_path (BluetoothAgent *agent, + const char *path) { Device1 *device; - device = device1_proxy_new_sync (priv->conn, + device = device1_proxy_new_sync (agent->conn, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, BLUEZ_SERVICE, path, @@ -134,24 +133,19 @@ return G_DBUS_PROXY(device); } -G_DEFINE_TYPE(BluetoothAgent, bluetooth_agent, G_TYPE_OBJECT) - static gboolean bluetooth_agent_request_pincode(BluetoothAgent *agent, const char *path, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - GDBusProxy *device; + g_autoptr(GDBusProxy) device = NULL; - if (priv->pincode_func == NULL) + if (agent->pincode_func == NULL) return FALSE; - device = get_device_from_path (priv, path); + device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - priv->pincode_func(invocation, device, priv->pincode_data); - - g_object_unref(device); + agent->pincode_func(invocation, device, agent->pincode_data); return TRUE; } @@ -159,19 +153,16 @@ static gboolean bluetooth_agent_request_passkey(BluetoothAgent *agent, const char *path, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - GDBusProxy *device; + g_autoptr(GDBusProxy) device = NULL; - if (priv->passkey_func == NULL) + if (agent->passkey_func == NULL) return FALSE; - device = get_device_from_path (priv, path); + device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - priv->passkey_func(invocation, device, priv->passkey_data); - - g_object_unref(device); + agent->passkey_func(invocation, device, agent->passkey_data); return TRUE; } @@ -180,20 +171,17 @@ const char *path, guint passkey, guint16 entered, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - GDBusProxy *device; + g_autoptr(GDBusProxy) device = NULL; - if (priv->display_func == NULL) + if (agent->display_passkey_func == NULL) return FALSE; - device = get_device_from_path (priv, path); + device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - priv->display_func(invocation, device, passkey, entered, - priv->display_data); - - g_object_unref(device); + agent->display_passkey_func(invocation, device, passkey, entered, + agent->display_passkey_data); return TRUE; } @@ -202,20 +190,17 @@ const char *path, const char *pincode, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - GDBusProxy *device; + g_autoptr(GDBusProxy) device = NULL; - if (priv->display_pincode_func == NULL) + if (agent->display_pincode_func == NULL) return FALSE; - device = get_device_from_path (priv, path); + device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - priv->display_pincode_func(invocation, device, pincode, - priv->display_data); - - g_object_unref(device); + agent->display_pincode_func(invocation, device, pincode, + agent->display_pincode_data); return TRUE; } @@ -224,19 +209,16 @@ const char *path, guint passkey, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - GDBusProxy *device; + g_autoptr(GDBusProxy) device = NULL; - if (priv->confirm_func == NULL) + if (agent->confirm_func == NULL) return FALSE; - device = get_device_from_path (priv, path); + device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - priv->confirm_func(invocation, device, passkey, priv->confirm_data); - - g_object_unref(device); + agent->confirm_func(invocation, device, passkey, agent->confirm_data); return TRUE; } @@ -244,19 +226,16 @@ static gboolean bluetooth_agent_request_authorization(BluetoothAgent *agent, const char *path, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - GDBusProxy *device; + g_autoptr(GDBusProxy) device = NULL; - if (priv->authorize_func == NULL) + if (agent->authorize_func == NULL) return FALSE; - device = get_device_from_path (priv, path); + device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - priv->authorize_func(invocation, device, priv->authorize_data); - - g_object_unref(device); + agent->authorize_func(invocation, device, agent->authorize_data); return TRUE; } @@ -265,20 +244,17 @@ const char *path, const char *uuid, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - GDBusProxy *device; + g_autoptr(GDBusProxy) device = NULL; - if (priv->authorize_service_func == NULL) + if (agent->authorize_service_func == NULL) return FALSE; - device = get_device_from_path (priv, path); + device = get_device_from_path (agent, path); if (device == NULL) return FALSE; - priv->authorize_service_func(invocation, device, uuid, - priv->authorize_service_data); - - g_object_unref(device); + agent->authorize_service_func(invocation, device, uuid, + agent->authorize_service_data); return TRUE; } @@ -286,37 +262,32 @@ static gboolean bluetooth_agent_cancel(BluetoothAgent *agent, GDBusMethodInvocation *invocation) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - if (priv->cancel_func == NULL) + if (agent->cancel_func == NULL) return FALSE; - return priv->cancel_func(invocation, priv->cancel_data); + return agent->cancel_func(invocation, agent->cancel_data); } static void -register_agent (BluetoothAgentPrivate *priv) +register_agent (BluetoothAgent *agent) { - GError *error = NULL; + g_autoptr(GError) error = NULL; gboolean ret; - ret = agent_manager1_call_register_agent_sync (priv->agent_manager, - priv->path, + ret = agent_manager1_call_register_agent_sync (agent->agent_manager, + agent->path, "DisplayYesNo", NULL, &error); if (ret == FALSE) { g_printerr ("Agent registration failed: %s\n", error->message); - g_error_free (error); return; } - ret = agent_manager1_call_request_default_agent_sync (priv->agent_manager, - priv->path, + ret = agent_manager1_call_request_default_agent_sync (agent->agent_manager, + agent->path, NULL, &error); - if (ret == FALSE) { + if (ret == FALSE) g_printerr ("Agent registration as default failed: %s\n", error->message); - g_error_free (error); - } } static void @@ -325,20 +296,18 @@ const gchar *name_owner, BluetoothAgent *agent) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); + g_free (agent->busname); + agent->busname = g_strdup (name_owner); - g_free (priv->busname); - priv->busname = g_strdup (name_owner); + agent->agent_manager = agent_manager1_proxy_new_sync (agent->conn, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + BLUEZ_SERVICE, + "/org/bluez", + NULL, + NULL); - priv->agent_manager = agent_manager1_proxy_new_sync (priv->conn, - G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, - BLUEZ_SERVICE, - "/org/bluez", - NULL, - NULL); - - if (priv->reg_id > 0) - register_agent (priv); + if (agent->reg_id > 0) + register_agent (agent); } static void @@ -346,11 +315,8 @@ const gchar *name, BluetoothAgent *agent) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - g_free (priv->busname); - priv->busname = NULL; - g_clear_object (&priv->agent_manager); + g_clear_pointer (&agent->busname, g_free); + g_clear_object (&agent->agent_manager); } static void @@ -360,11 +326,10 @@ GParamSpec *pspec) { BluetoothAgent *agent = BLUETOOTH_AGENT (object); - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE (agent); switch (prop_id) { case PROP_PATH: - g_value_set_string (value, priv->path); + g_value_set_string (value, agent->path); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -378,11 +343,10 @@ GParamSpec *pspec) { BluetoothAgent *agent = BLUETOOTH_AGENT (object); - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE (agent); switch (prop_id) { case PROP_PATH: - priv->path = g_value_dup_string (value); + agent->path = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -391,40 +355,36 @@ static void bluetooth_agent_init(BluetoothAgent *agent) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); - g_assert (priv->introspection_data); - priv->conn = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL); - priv->watch_id = g_bus_watch_name_on_connection (priv->conn, - BLUEZ_SERVICE, - G_BUS_NAME_WATCHER_FLAGS_NONE, - (GBusNameAppearedCallback) name_appeared_cb, - (GBusNameVanishedCallback) name_vanished_cb, - agent, - NULL); + agent->introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); + g_assert (agent->introspection_data); + agent->conn = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL); + agent->watch_id = g_bus_watch_name_on_connection (agent->conn, + BLUEZ_SERVICE, + G_BUS_NAME_WATCHER_FLAGS_NONE, + (GBusNameAppearedCallback) name_appeared_cb, + (GBusNameVanishedCallback) name_vanished_cb, + agent, + NULL); } -static void bluetooth_agent_finalize(GObject *agent) +static void bluetooth_agent_finalize(GObject *object) { - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); + BluetoothAgent *agent = BLUETOOTH_AGENT (object); - bluetooth_agent_unregister (BLUETOOTH_AGENT (agent)); + bluetooth_agent_unregister (agent); - g_bus_unwatch_name (priv->watch_id); - g_free (priv->busname); - g_dbus_node_info_unref (priv->introspection_data); - g_object_unref (priv->conn); + g_bus_unwatch_name (agent->watch_id); + g_free (agent->busname); + g_dbus_node_info_unref (agent->introspection_data); + g_object_unref (agent->conn); - G_OBJECT_CLASS(bluetooth_agent_parent_class)->finalize(agent); + G_OBJECT_CLASS(bluetooth_agent_parent_class)->finalize(object); } static void bluetooth_agent_class_init(BluetoothAgentClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; - g_type_class_add_private(klass, sizeof(BluetoothAgentPrivate)); - object_class->finalize = bluetooth_agent_finalize; object_class->set_property = bluetooth_agent_set_property; object_class->get_property = bluetooth_agent_get_property; @@ -464,11 +424,10 @@ gpointer user_data) { BluetoothAgent *agent = (BluetoothAgent *) user_data; - BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - if (g_str_equal (sender, priv->busname) == FALSE) { - GError *error = NULL; - error = g_error_new (AGENT_ERROR, AGENT_ERROR_REJECT, + if (g_str_equal (sender, agent->busname) == FALSE) { + GError *error; + error = g_error_new (BLUETOOTH_AGENT_ERROR, BLUETOOTH_AGENT_ERROR_REJECT, "Permission Denied"); g_dbus_method_invocation_take_error(invocation, error); return; @@ -530,87 +489,61 @@ gboolean bluetooth_agent_register(BluetoothAgent *agent) { - BluetoothAgentPrivate *priv; - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_val_if_fail (BLUETOOTH_IS_AGENT (agent), FALSE); + g_return_val_if_fail (agent->path != NULL, FALSE); + g_return_val_if_fail (g_variant_is_object_path(agent->path), FALSE); - priv = BLUETOOTH_AGENT_GET_PRIVATE (agent); - - priv->reg_id = g_dbus_connection_register_object (priv->conn, - priv->path, - priv->introspection_data->interfaces[0], - &interface_vtable, - agent, - NULL, - &error); - if (priv->reg_id == 0) { + agent->reg_id = g_dbus_connection_register_object (agent->conn, + agent->path, + agent->introspection_data->interfaces[0], + &interface_vtable, + agent, + NULL, + &error); + if (agent->reg_id == 0) { g_warning ("Failed to register object: %s", error->message); - g_error_free (error); - error = NULL; return FALSE; } - if (priv->agent_manager != NULL) - register_agent (priv); + if (agent->agent_manager != NULL) + register_agent (agent); return TRUE; } -static gboolean -error_matches_remote_error (GError *error, - const char *remote_error) +static void +agent_unregister_cb (GObject *object, + GAsyncResult *res, + gpointer user_data) { - char *str; - gboolean ret; - - if (error == NULL) - return FALSE; - - str = g_dbus_error_get_remote_error (error); - ret = (g_strcmp0 (str, remote_error) == 0); - g_free (str); + g_autoptr(GError) error = NULL; - return ret; + if (!agent_manager1_call_unregister_agent_finish (AGENT_MANAGER1 (object), res, &error)) + g_debug ("Failed to unregister agent: %s", error->message); + else + g_debug ("Unregistered agent successfully"); } gboolean bluetooth_agent_unregister(BluetoothAgent *agent) { - BluetoothAgentPrivate *priv; - GError *error = NULL; - g_return_val_if_fail (BLUETOOTH_IS_AGENT (agent), FALSE); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - if (priv->agent_manager == NULL) + if (agent->agent_manager == NULL) return FALSE; - if (agent_manager1_call_unregister_agent_sync (priv->agent_manager, - priv->path, - NULL, &error) == FALSE) { - /* Ignore errors if the adapter is gone */ - if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD) == FALSE && - error_matches_remote_error (error, "org.bluez.Error.DoesNotExist") == FALSE) { - g_printerr ("Agent unregistration failed: %s '%s'\n", - error->message, - g_quark_to_string (error->domain)); - } - g_error_free(error); - } - - g_object_unref(priv->agent_manager); - priv->agent_manager = NULL; - - g_free(priv->path); - priv->path = NULL; + agent_manager1_call_unregister_agent (agent->agent_manager, + agent->path, + NULL, agent_unregister_cb, NULL); - g_free(priv->busname); - priv->busname = NULL; + g_clear_object (&agent->agent_manager); + g_clear_pointer (&agent->path, g_free); + g_clear_pointer (&agent->busname, g_free); - if (priv->reg_id > 0) { - g_dbus_connection_unregister_object (priv->conn, priv->reg_id); - priv->reg_id = 0; + if (agent->reg_id > 0) { + g_dbus_connection_unregister_object (agent->conn, agent->reg_id); + agent->reg_id = 0; } return TRUE; @@ -619,105 +552,73 @@ void bluetooth_agent_set_pincode_func(BluetoothAgent *agent, BluetoothAgentPasskeyFunc func, gpointer data) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->pincode_func = func; - priv->pincode_data = data; + agent->pincode_func = func; + agent->pincode_data = data; } void bluetooth_agent_set_passkey_func(BluetoothAgent *agent, BluetoothAgentPasskeyFunc func, gpointer data) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->passkey_func = func; - priv->passkey_data = data; + agent->passkey_func = func; + 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) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->display_func = func; - priv->display_data = data; + agent->display_passkey_func = func; + agent->display_passkey_data = data; } void bluetooth_agent_set_display_pincode_func(BluetoothAgent *agent, BluetoothAgentDisplayPinCodeFunc func, gpointer data) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->display_pincode_func = func; - priv->display_pincode_data = data; + agent->display_pincode_func = func; + agent->display_pincode_data = data; } void bluetooth_agent_set_confirm_func(BluetoothAgent *agent, BluetoothAgentConfirmFunc func, gpointer data) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->confirm_func = func; - priv->confirm_data = data; + agent->confirm_func = func; + agent->confirm_data = data; } void bluetooth_agent_set_authorize_func(BluetoothAgent *agent, BluetoothAgentAuthorizeFunc func, gpointer data) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->authorize_func = func; - priv->authorize_data = data; + agent->authorize_func = func; + agent->authorize_data = data; } void bluetooth_agent_set_authorize_service_func(BluetoothAgent *agent, BluetoothAgentAuthorizeServiceFunc func, gpointer data) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->authorize_service_func = func; - priv->authorize_service_data = data; + agent->authorize_service_func = func; + agent->authorize_service_data = data; } void bluetooth_agent_set_cancel_func(BluetoothAgent *agent, BluetoothAgentCancelFunc func, gpointer data) { - BluetoothAgentPrivate *priv; - g_return_if_fail (BLUETOOTH_IS_AGENT (agent)); - priv = BLUETOOTH_AGENT_GET_PRIVATE(agent); - - priv->cancel_func = func; - priv->cancel_data = data; + agent->cancel_func = func; + agent->cancel_data = data; } GQuark bluetooth_agent_error_quark(void) @@ -736,11 +637,11 @@ 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 -Nru gnome-bluetooth-3.34.3/lib/bluetooth-agent.h gnome-bluetooth-3.34.5/lib/bluetooth-agent.h --- gnome-bluetooth-3.34.3/lib/bluetooth-agent.h 2020-10-01 09:19:42.287874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-agent.h 2021-03-23 15:09:30.416372300 +0000 @@ -21,54 +21,27 @@ * */ -#ifndef __BLUETOOTH_AGENT_H -#define __BLUETOOTH_AGENT_H +#pragma once #include #include -G_BEGIN_DECLS - +G_DECLARE_FINAL_TYPE(BluetoothAgent, bluetooth_agent, BLUETOOTH, AGENT, GObject) #define BLUETOOTH_TYPE_AGENT (bluetooth_agent_get_type()) -#define BLUETOOTH_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - BLUETOOTH_TYPE_AGENT, BluetoothAgent)) -#define BLUETOOTH_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - BLUETOOTH_TYPE_AGENT, BluetoothAgentClass)) -#define BLUETOOTH_IS_AGENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - BLUETOOTH_TYPE_AGENT)) -#define BLUETOOTH_IS_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \ - BLUETOOTH_TYPE_AGENT)) -#define BLUETOOTH_GET_AGENT_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \ - BLUETOOTH_TYPE_AGENT, BluetoothAgentClass)) - -typedef struct _BluetoothAgent BluetoothAgent; -typedef struct _BluetoothAgentClass BluetoothAgentClass; - -struct _BluetoothAgent { - GObject parent; -}; - -struct _BluetoothAgentClass { - GObjectClass parent_class; -}; - -GType bluetooth_agent_get_type(void); BluetoothAgent *bluetooth_agent_new(const char *path); -gboolean bluetooth_agent_setup(BluetoothAgent *agent, const char *path); - gboolean bluetooth_agent_register(BluetoothAgent *agent); 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, @@ -93,9 +66,9 @@ 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); @@ -112,16 +85,12 @@ 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); - -G_END_DECLS - -#endif /* __BLUETOOTH_AGENT_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-chooser-button.h gnome-bluetooth-3.34.5/lib/bluetooth-chooser-button.h --- gnome-bluetooth-3.34.3/lib/bluetooth-chooser-button.h 2020-10-01 09:19:42.287874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-chooser-button.h 2021-03-23 15:09:30.416372300 +0000 @@ -16,13 +16,10 @@ * License along with this library; if not, see . */ -#ifndef __BLUETOOTH_CHOOSER_BUTTON_H__ -#define __BLUETOOTH_CHOOSER_BUTTON_H__ +#pragma once #include -G_BEGIN_DECLS - #define BLUETOOTH_TYPE_CHOOSER_BUTTON (bluetooth_chooser_button_get_type ()) #define BLUETOOTH_CHOOSER_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BLUETOOTH_TYPE_CHOOSER_BUTTON, BluetoothChooserButton)) #define BLUETOOTH_IS_CHOOSER_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BLUETOOTH_TYPE_CHOOSER_BUTTON)) @@ -47,7 +44,3 @@ GtkWidget * bluetooth_chooser_button_new (void); gboolean bluetooth_chooser_button_available (BluetoothChooserButton *button); - -G_END_DECLS - -#endif /* __BLUETOOTH_CHOOSER_BUTTON_H__ */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-chooser.c gnome-bluetooth-3.34.5/lib/bluetooth-chooser.c --- gnome-bluetooth-3.34.3/lib/bluetooth-chooser.c 2020-10-01 09:19:42.289874300 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-chooser.c 2021-03-23 15:09:30.416372300 +0000 @@ -686,8 +686,6 @@ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(tree), TRUE); - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW(tree), TRUE); - g_object_set (tree, "show-expanders", FALSE, NULL); g_signal_connect (G_OBJECT (tree), "row-activated", @@ -770,8 +768,6 @@ GtkWidget *vbox; GtkWidget *hbox; - gtk_widget_push_composite_child (); - g_object_set (G_OBJECT (self), "orientation", GTK_ORIENTATION_VERTICAL, NULL); priv->client = bluetooth_client_new (); @@ -843,8 +839,6 @@ G_CALLBACK(filter_type_changed_cb), NULL); g_signal_connect(self, "notify::device-category-filter", G_CALLBACK(filter_category_changed_cb), NULL); - - gtk_widget_pop_composite_child (); } static GObject * diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-chooser-combo.c gnome-bluetooth-3.34.5/lib/bluetooth-chooser-combo.c --- gnome-bluetooth-3.34.3/lib/bluetooth-chooser-combo.c 2020-10-01 09:19:42.287874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-chooser-combo.c 2021-03-23 15:09:30.416372300 +0000 @@ -38,7 +38,9 @@ #include "bluetooth-chooser-private.h" #include "bluetooth-utils.h" -struct _BluetoothChooserComboPrivate { +struct _BluetoothChooserCombo { + GtkWidget parent; + GtkWidget *chooser; GtkWidget *drop_box; GtkWidget *drop; @@ -62,55 +64,47 @@ static int signals[LAST_SIGNAL] = { 0 }; -static void bluetooth_chooser_combo_class_init (BluetoothChooserComboClass * klass); -static void bluetooth_chooser_combo_init (BluetoothChooserCombo * combo); - -static GtkBoxClass *parent_class; - G_DEFINE_TYPE(BluetoothChooserCombo, bluetooth_chooser_combo, GTK_TYPE_BOX); -#define BLUETOOTH_CHOOSER_COMBO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ - BLUETOOTH_TYPE_CHOOSER_COMBO, BluetoothChooserComboPrivate)) - static void bluetooth_chooser_combo_set_device (BluetoothChooserCombo *combo, const char *bdaddr) { - if (bdaddr == NULL || combo->priv->model == NULL) { - g_free (combo->priv->bdaddr); - gtk_widget_set_sensitive (combo->priv->drop_box, FALSE); + if (bdaddr == NULL || combo->model == NULL) { + g_free (combo->bdaddr); + gtk_widget_set_sensitive (combo->drop_box, FALSE); } else { GtkTreeIter iter; gboolean cont = FALSE; - gtk_widget_set_sensitive (combo->priv->drop_box, TRUE); + gtk_widget_set_sensitive (combo->drop_box, TRUE); - g_free (combo->priv->bdaddr); + g_free (combo->bdaddr); if (g_strcmp0 (BLUETOOTH_CHOOSER_COMBO_FIRST_DEVICE, bdaddr) != 0) - combo->priv->bdaddr = g_strdup (bdaddr); + combo->bdaddr = g_strdup (bdaddr); else - combo->priv->bdaddr = NULL; + combo->bdaddr = NULL; - cont = gtk_tree_model_iter_children (combo->priv->model, &iter, NULL); + cont = gtk_tree_model_iter_children (combo->model, &iter, NULL); while (cont == TRUE) { char *value; - gtk_tree_model_get (GTK_TREE_MODEL (combo->priv->model), &iter, + gtk_tree_model_get (GTK_TREE_MODEL (combo->model), &iter, BLUETOOTH_COLUMN_ADDRESS, &value, -1); - if (combo->priv->bdaddr == NULL) { - gtk_tree_selection_select_iter (combo->priv->selection, &iter); - combo->priv->bdaddr = value; + if (combo->bdaddr == NULL) { + gtk_tree_selection_select_iter (combo->selection, &iter); + combo->bdaddr = value; break; } if (g_ascii_strcasecmp(bdaddr, value) == 0) { - gtk_tree_selection_select_iter (combo->priv->selection, &iter); + gtk_tree_selection_select_iter (combo->selection, &iter); g_free (value); break; } g_free (value); - cont = gtk_tree_model_iter_next (GTK_TREE_MODEL (combo->priv->model), &iter); + cont = gtk_tree_model_iter_next (GTK_TREE_MODEL (combo->model), &iter); } } g_object_notify (G_OBJECT (combo), "device"); @@ -121,23 +115,23 @@ { BluetoothChooserCombo *combo = BLUETOOTH_CHOOSER_COMBO (object); - if (combo->priv->model_notify_id != 0) { + if (combo->model_notify_id != 0) { GtkWidget *treeview; - treeview = bluetooth_chooser_get_treeview (BLUETOOTH_CHOOSER (combo->priv->chooser)); - g_signal_handler_disconnect (treeview, combo->priv->model_notify_id); - combo->priv->model_notify_id = 0; + treeview = bluetooth_chooser_get_treeview (BLUETOOTH_CHOOSER (combo->chooser)); + g_signal_handler_disconnect (treeview, combo->model_notify_id); + combo->model_notify_id = 0; } - if (combo->priv->model != NULL) { - g_object_unref (combo->priv->model); - combo->priv->model = NULL; + if (combo->model != NULL) { + g_object_unref (combo->model); + combo->model = NULL; } - if (combo->priv->chooser != NULL) { - g_object_unref (combo->priv->chooser); - combo->priv->chooser = NULL; + if (combo->chooser != NULL) { + g_object_unref (combo->chooser); + combo->chooser = NULL; } - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (bluetooth_chooser_combo_parent_class)->dispose (object); } static void @@ -168,10 +162,10 @@ switch (property_id) { case PROP_CHOOSER: - g_value_set_object (value, combo->priv->chooser); + g_value_set_object (value, combo->chooser); break; case PROP_DEVICE: - g_value_set_string (value, combo->priv->bdaddr); + g_value_set_string (value, combo->bdaddr); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -183,14 +177,10 @@ { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->dispose = bluetooth_chooser_combo_dispose; object_class->set_property = bluetooth_chooser_combo_set_property; object_class->get_property = bluetooth_chooser_combo_get_property; - g_type_class_add_private(klass, sizeof(BluetoothChooserComboPrivate)); - /** * BluetoothChooserCombo::chooser-created: * @self: a #BluetoothChooserCombo widget @@ -204,7 +194,7 @@ g_signal_new ("chooser-created", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (BluetoothChooserComboClass, chooser_created), + 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); @@ -236,12 +226,12 @@ GtkTreeModel *model; g_object_get (gobject, "model", &model, NULL); - gtk_combo_box_set_model (GTK_COMBO_BOX (combo->priv->drop), model); - if (combo->priv->model != NULL) { - g_object_unref (combo->priv->model); - combo->priv->model = NULL; + gtk_combo_box_set_model (GTK_COMBO_BOX (combo->drop), model); + if (combo->model != NULL) { + g_object_unref (combo->model); + combo->model = NULL; } - combo->priv->model = model; + combo->model = model; } static void @@ -252,19 +242,19 @@ GtkTreeIter iter; char *value = NULL; - if (gtk_tree_selection_get_selected (combo->priv->selection, NULL, &iter)) { - gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo->priv->drop), &iter); - if (combo->priv->model != NULL) - gtk_tree_model_get (GTK_TREE_MODEL (combo->priv->model), &iter, + if (gtk_tree_selection_get_selected (combo->selection, NULL, &iter)) { + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo->drop), &iter); + if (combo->model != NULL) + gtk_tree_model_get (GTK_TREE_MODEL (combo->model), &iter, BLUETOOTH_COLUMN_ADDRESS, &value, -1); } else { - if (combo->priv->model != NULL) - gtk_combo_box_set_active (GTK_COMBO_BOX (combo->priv->drop), -1); + if (combo->model != NULL) + gtk_combo_box_set_active (GTK_COMBO_BOX (combo->drop), -1); } - if (g_strcmp0 (combo->priv->bdaddr, value) != 0) { - g_free (combo->priv->bdaddr); - combo->priv->bdaddr = value; + if (g_strcmp0 (combo->bdaddr, value) != 0) { + g_free (combo->bdaddr); + combo->bdaddr = value; g_object_notify (G_OBJECT (combo), "device"); } else { g_free (value); @@ -280,18 +270,18 @@ char *value = NULL; if (gtk_combo_box_get_active_iter (widget, &iter)) { - gtk_tree_selection_select_iter (combo->priv->selection, &iter); - if (combo->priv->model != NULL) - gtk_tree_model_get (GTK_TREE_MODEL (combo->priv->model), &iter, + gtk_tree_selection_select_iter (combo->selection, &iter); + if (combo->model != NULL) + gtk_tree_model_get (GTK_TREE_MODEL (combo->model), &iter, BLUETOOTH_COLUMN_ADDRESS, &value, -1); } else { - if (combo->priv->model != NULL) - gtk_tree_selection_unselect_all (combo->priv->selection); + if (combo->model != NULL) + gtk_tree_selection_unselect_all (combo->selection); } - if (g_strcmp0 (combo->priv->bdaddr, value) != 0) { - g_free (combo->priv->bdaddr); - combo->priv->bdaddr = value; + if (g_strcmp0 (combo->bdaddr, value) != 0) { + g_free (combo->bdaddr); + combo->bdaddr = value; g_object_notify (G_OBJECT (combo), "device"); } else { g_free (value); @@ -304,45 +294,43 @@ GtkWidget *treeview; GtkCellRenderer *renderer; - combo->priv = BLUETOOTH_CHOOSER_COMBO_GET_PRIVATE (combo); - - combo->priv->drop_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_set_homogeneous (GTK_BOX (combo->priv->drop_box), TRUE); - gtk_box_pack_start (GTK_BOX (combo), combo->priv->drop_box, + combo->drop_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_box_set_homogeneous (GTK_BOX (combo->drop_box), TRUE); + gtk_box_pack_start (GTK_BOX (combo), combo->drop_box, TRUE, FALSE, 0); /* Setup the combo itself */ - combo->priv->drop = gtk_combo_box_new (); - gtk_box_pack_start (GTK_BOX (combo->priv->drop_box), combo->priv->drop, + combo->drop = gtk_combo_box_new (); + gtk_box_pack_start (GTK_BOX (combo->drop_box), combo->drop, TRUE, TRUE, 0); renderer = gtk_cell_renderer_pixbuf_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo->priv->drop), + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo->drop), renderer, FALSE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo->priv->drop), + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo->drop), renderer, "icon-name", BLUETOOTH_COLUMN_ICON, NULL); renderer = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo->priv->drop), + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo->drop), renderer, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo->priv->drop), + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo->drop), renderer, "text", BLUETOOTH_COLUMN_ALIAS, NULL); - combo->priv->chooser = bluetooth_chooser_new (); + combo->chooser = bluetooth_chooser_new (); - treeview = bluetooth_chooser_get_treeview (BLUETOOTH_CHOOSER (combo->priv->chooser)); - combo->priv->model_notify_id = g_signal_connect (G_OBJECT (treeview), "notify::model", + treeview = bluetooth_chooser_get_treeview (BLUETOOTH_CHOOSER (combo->chooser)); + combo->model_notify_id = g_signal_connect (G_OBJECT (treeview), "notify::model", G_CALLBACK (treeview_model_notify_cb), combo); treeview_model_notify_cb (G_OBJECT (treeview), NULL, combo); - gtk_combo_box_set_active (GTK_COMBO_BOX (combo->priv->drop), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (combo->drop), 0); - combo->priv->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); - g_signal_connect (G_OBJECT (combo->priv->selection), "changed", + combo->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); + g_signal_connect (G_OBJECT (combo->selection), "changed", G_CALLBACK (treeview_selection_changed_cb), combo); - g_signal_connect (G_OBJECT (combo->priv->drop), "changed", + g_signal_connect (G_OBJECT (combo->drop), "changed", G_CALLBACK (drop_changed_cb), combo); gtk_widget_show_all (GTK_WIDGET (combo)); diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-chooser-combo.h gnome-bluetooth-3.34.5/lib/bluetooth-chooser-combo.h --- gnome-bluetooth-3.34.3/lib/bluetooth-chooser-combo.h 2020-10-01 09:19:42.287874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-chooser-combo.h 2021-03-23 15:09:30.416372300 +0000 @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * (C) Copyright 2007 Bastien Nocera + * (C) Copyright 2007, 2021 Bastien Nocera * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -16,20 +16,12 @@ * License along with this library; if not, see . */ -#ifndef __BLUETOOTH_CHOOSER_COMBO_H__ -#define __BLUETOOTH_CHOOSER_COMBO_H__ +#pragma once #include -G_BEGIN_DECLS - -#define BLUETOOTH_TYPE_CHOOSER_COMBO (bluetooth_chooser_combo_get_type ()) -#define BLUETOOTH_CHOOSER_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BLUETOOTH_TYPE_CHOOSER_COMBO, BluetoothChooserCombo)) -#define BLUETOOTH_IS_CHOOSER_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BLUETOOTH_TYPE_CHOOSER_COMBO)) -#define BLUETOOTH_IS_CHOOSER_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \ - BLUETOOTH_TYPE_CHOOSER_COMBO)) -#define BLUETOOTH_GET_CHOOSER_COMBO_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \ - BLUETOOTH_TYPE_CHOOSER_COMBO, BluetoothChooserComboClass)) +G_DECLARE_FINAL_TYPE(BluetoothChooserCombo, bluetooth_chooser_combo, BLUETOOTH, CHOOSER_COMBO, GtkBox) +#define BLUETOOTH_TYPE_CHOOSER_COMBO (bluetooth_chooser_combo_get_type ()) /** * BLUETOOTH_CHOOSER_COMBO_FIRST_DEVICE: @@ -38,30 +30,4 @@ **/ #define BLUETOOTH_CHOOSER_COMBO_FIRST_DEVICE "00:00:00:00:00:00" -typedef struct _BluetoothChooserComboPrivate BluetoothChooserComboPrivate; -typedef struct _BluetoothChooserComboClass BluetoothChooserComboClass; - -/** - * BluetoothChooserCombo: - * - * The BluetoothChooserCombo struct contains - * only private fields and should not be directly accessed. - */ -typedef struct _BluetoothChooserCombo { - GtkBox parent; - BluetoothChooserComboPrivate *priv; -} BluetoothChooserCombo; - -struct _BluetoothChooserComboClass { - GtkBoxClass parent_class; - - void (*chooser_created) (BluetoothChooserCombo *self, GtkWidget *chooser); -}; - -GType bluetooth_chooser_combo_get_type (void); - GtkWidget * bluetooth_chooser_combo_new (void); - -G_END_DECLS - -#endif /* __BLUETOOTH_CHOOSER_COMBO_H__ */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-chooser.h gnome-bluetooth-3.34.5/lib/bluetooth-chooser.h --- gnome-bluetooth-3.34.3/lib/bluetooth-chooser.h 2020-10-01 09:19:42.289874300 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-chooser.h 2021-03-23 15:09:30.417372200 +0000 @@ -22,14 +22,11 @@ * */ -#ifndef __BLUETOOTH_CHOOSER_H -#define __BLUETOOTH_CHOOSER_H +#pragma once #include #include -G_BEGIN_DECLS - #define BLUETOOTH_TYPE_CHOOSER (bluetooth_chooser_get_type()) #define BLUETOOTH_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ BLUETOOTH_TYPE_CHOOSER, BluetoothChooser)) @@ -80,7 +77,3 @@ void bluetooth_chooser_start_discovery (BluetoothChooser *self); void bluetooth_chooser_stop_discovery (BluetoothChooser *self); - -G_END_DECLS - -#endif /* __BLUETOOTH_CHOOSER_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-chooser-private.h gnome-bluetooth-3.34.5/lib/bluetooth-chooser-private.h --- gnome-bluetooth-3.34.3/lib/bluetooth-chooser-private.h 2020-10-01 09:19:42.289874300 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-chooser-private.h 2021-03-23 15:09:30.416372300 +0000 @@ -21,19 +21,12 @@ * */ -#ifndef __BLUETOOTH_CHOOSER_PRIVATE_H -#define __BLUETOOTH_CHOOSER_PRIVATE_H +#pragma once #include #include #include -G_BEGIN_DECLS - GtkTreeModel *bluetooth_chooser_get_model (BluetoothChooser *self); GtkWidget *bluetooth_chooser_get_treeview (BluetoothChooser *self); gboolean bluetooth_chooser_remove_selected_device (BluetoothChooser *self); - -G_END_DECLS - -#endif /* __BLUETOOTH_CHOOSER_PRIVATE_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-client.c gnome-bluetooth-3.34.5/lib/bluetooth-client.c --- gnome-bluetooth-3.34.3/lib/bluetooth-client.c 2020-10-01 09:19:42.291874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-client.c 2021-03-23 15:09:30.417372200 +0000 @@ -132,22 +132,20 @@ return found; } -static gboolean compare_path(GtkTreeStore *store, - GtkTreeIter *iter, gpointer user_data) +static gboolean +compare_path (GtkTreeStore *store, + GtkTreeIter *iter, + gpointer user_data) { const gchar *path = user_data; - GDBusProxy *object; - gboolean found = FALSE; + g_autoptr(GDBusProxy) object = NULL; - gtk_tree_model_get(GTK_TREE_MODEL(store), iter, - BLUETOOTH_COLUMN_PROXY, &object, -1); - - if (object != NULL) { - found = g_str_equal(path, g_dbus_proxy_get_object_path(object)); - g_object_unref(object); - } + gtk_tree_model_get (GTK_TREE_MODEL(store), iter, + BLUETOOTH_COLUMN_PROXY, &object, + -1); - return found; + return (object != NULL && + g_str_equal (path, g_dbus_proxy_get_object_path (object))); } static gboolean @@ -156,22 +154,19 @@ gpointer user_data) { const char *address = user_data; - char *tmp_address; - gboolean found = FALSE; + g_autofree char *tmp_address = NULL; gtk_tree_model_get (GTK_TREE_MODEL(store), iter, BLUETOOTH_COLUMN_ADDRESS, &tmp_address, -1); - found = g_str_equal (address, tmp_address); - g_free (tmp_address); - - return found; + return (g_strcmp0 (address, tmp_address) == 0); } static gboolean get_iter_from_path (GtkTreeStore *store, - GtkTreeIter *iter, - const char *path) + GtkTreeIter *iter, + const char *path) { + g_return_val_if_fail (path != NULL, FALSE); return iter_search(store, iter, NULL, compare_path, (gpointer) path); } @@ -180,6 +175,7 @@ GtkTreeIter *iter, GDBusProxy *proxy) { + g_return_val_if_fail (proxy != NULL, FALSE); return iter_search(store, iter, NULL, compare_path, (gpointer) g_dbus_proxy_get_object_path (proxy)); } @@ -192,6 +188,9 @@ { GtkTreeIter parent_iter; + g_return_val_if_fail (address != NULL, FALSE); + g_return_val_if_fail (adapter != NULL, FALSE); + if (get_iter_from_proxy (store, &parent_iter, adapter) == FALSE) return FALSE; @@ -468,30 +467,49 @@ } } -static gboolean +static void +adapter_set_powered_cb (GDBusProxy *proxy, + GAsyncResult *res, + gpointer user_data) +{ + g_autoptr(GError) error = NULL; + g_autoptr(GVariant) ret = NULL; + + ret = g_dbus_proxy_call_finish (proxy, res, &error); + if (!ret) { + g_debug ("Error setting property 'Powered' on interface org.bluez.Adapter1: %s (%s, %d)", + error->message, g_quark_to_string (error->domain), error->code); + } +} + +static void adapter_set_powered (BluetoothClient *client, const char *path, gboolean powered) { BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client); - GObject *adapter; + g_autoptr(GObject) adapter = NULL; GtkTreeIter iter; + GVariant *variant; - g_return_val_if_fail (BLUETOOTH_IS_CLIENT (client), FALSE); + g_return_if_fail (BLUETOOTH_IS_CLIENT (client)); if (get_iter_from_path (priv->store, &iter, path) == FALSE) - return FALSE; + return; gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, BLUETOOTH_COLUMN_PROXY, &adapter, -1); if (adapter == NULL) - return FALSE; - - g_object_set (adapter, "powered", powered, NULL); - g_object_unref (adapter); + return; - return TRUE; + variant = g_variant_new_boolean (powered); + g_dbus_proxy_call (G_DBUS_PROXY (adapter), + "org.freedesktop.DBus.Properties.Set", + g_variant_new ("(ssv)", "org.bluez.Adapter1", "Powered", variant), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, (GAsyncReadyCallback) adapter_set_powered_cb, client); } static void @@ -954,86 +972,32 @@ return ret; } -/** - * _bluetooth_client_set_discoverable: - * @client: a #BluetoothClient object - * @discoverable: whether the device should be discoverable - * - * Sets the default adapter's discoverable status. - * - * Return value: Whether setting the state on the default adapter was successful. - **/ -static gboolean -_bluetooth_client_set_discoverable (BluetoothClient *client, - gboolean discoverable) -{ - BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE (client); - GtkTreePath *path; - GObject *adapter; - GtkTreeIter iter; - - g_return_val_if_fail (BLUETOOTH_IS_CLIENT (client), FALSE); - - if (priv->default_adapter == NULL) - return FALSE; - - path = gtk_tree_row_reference_get_path (priv->default_adapter); - gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->store), &iter, path); - gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, - BLUETOOTH_COLUMN_PROXY, &adapter, -1); - gtk_tree_path_free (path); - - if (adapter == NULL) - return FALSE; - - if (discoverable) { - g_object_set (adapter, - "discoverable", discoverable, - "discoverable-timeout", 0, - NULL); - } else { - /* Work-around race in bluetoothd which would reset the discoverable - * flag if a timeout change was requested before discoverable finished - * being set to off: - * https://bugzilla.redhat.com/show_bug.cgi?id=1602985 */ - g_object_set (adapter, - "discoverable", FALSE, - NULL); - } - g_object_unref (adapter); - - return TRUE; -} - static void _bluetooth_client_set_default_adapter_discovering (BluetoothClient *client, gboolean discovering, gboolean discoverable) { BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE (client); - GDBusProxy *adapter; + g_autoptr(GDBusProxy) adapter = NULL; GVariantBuilder builder; adapter = _bluetooth_client_get_default_adapter (client); if (adapter == NULL) return; - g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); - g_variant_builder_add (&builder, "{sv}", - "Discoverable", g_variant_new_boolean (discoverable)); - if (!adapter1_call_set_discovery_filter_sync (ADAPTER1 (adapter), - g_variant_builder_end (&builder), NULL, NULL)) { - /* BlueZ too old? */ - _bluetooth_client_set_discoverable (client, discoverable); + if (discovering) { + g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); + g_variant_builder_add (&builder, "{sv}", + "Discoverable", g_variant_new_boolean (discoverable)); + adapter1_call_set_discovery_filter_sync (ADAPTER1 (adapter), + g_variant_builder_end (&builder), NULL, NULL); } priv->discovery_started = discovering; if (discovering) - adapter1_call_start_discovery_sync (ADAPTER1 (adapter), NULL, NULL); + adapter1_call_start_discovery (ADAPTER1 (adapter), NULL, NULL, NULL); else - adapter1_call_stop_discovery_sync (ADAPTER1 (adapter), NULL, NULL); - - g_object_unref(adapter); + adapter1_call_stop_discovery (ADAPTER1 (adapter), NULL, NULL, NULL); } static gboolean @@ -1356,9 +1320,9 @@ } CreateDeviceData; static void -device_pair_callback (GDBusProxy *proxy, - GAsyncResult *res, - GSimpleAsyncResult *simple) +device_pair_callback (GDBusProxy *proxy, + GAsyncResult *res, + GTask *task) { GError *error = NULL; @@ -1366,43 +1330,42 @@ g_debug ("Pair() failed for %s: %s", g_dbus_proxy_get_object_path (proxy), error->message); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete_in_idle (simple); - - g_object_unref (simple); + g_object_unref (task); } +/** + * bluetooth_client_setup_device_finish: + * @client: + * @res: + * @path: (out): + * @error: + */ gboolean bluetooth_client_setup_device_finish (BluetoothClient *client, GAsyncResult *res, char **path, GError **error) { - GSimpleAsyncResult *simple; + GTask *task; char *object_path; gboolean ret; g_return_val_if_fail (path != NULL, FALSE); - simple = (GSimpleAsyncResult *) res; + task = G_TASK (res); - g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == bluetooth_client_setup_device); + g_warn_if_fail (g_task_get_source_tag (task) == bluetooth_client_setup_device); - ret = g_simple_async_result_get_op_res_gboolean (simple); - object_path = g_strdup (g_object_get_data (G_OBJECT (res), "device-object-path")); + ret = g_task_propagate_boolean (task, error); + object_path = g_strdup (g_task_get_task_data (task)); *path = object_path; g_debug ("bluetooth_client_setup_device_finish() %s (path: %s)", ret ? "success" : "failure", object_path); - - if (ret) - return TRUE; - - g_simple_async_result_propagate_error (simple, error); - return FALSE; + return ret; } void @@ -1414,28 +1377,26 @@ gpointer user_data) { BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client); - GSimpleAsyncResult *simple; - GDBusProxy *device; + GTask *task; + g_autoptr(GDBusProxy) device = NULL; GtkTreeIter iter, adapter_iter; gboolean paired; - GError *err = NULL; g_return_if_fail (BLUETOOTH_IS_CLIENT (client)); + g_return_if_fail (path != NULL); - simple = g_simple_async_result_new (G_OBJECT (client), - callback, - user_data, - bluetooth_client_setup_device); - g_simple_async_result_set_check_cancellable (simple, cancellable); - g_object_set_data_full (G_OBJECT (simple), "device-object-path", - g_strdup (path), (GDestroyNotify) g_free); + task = g_task_new (G_OBJECT (client), + cancellable, + callback, + user_data); + g_task_set_source_tag (task, bluetooth_client_setup_device); + g_task_set_task_data (task, g_strdup (path), (GDestroyNotify) g_free); if (get_iter_from_path (priv->store, &iter, path) == FALSE) { - g_simple_async_result_set_error (simple, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - "Device with object path %s does not exist", - path); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + "Device with object path %s does not exist", + path); + g_object_unref (task); return; } @@ -1446,6 +1407,7 @@ if (paired != FALSE && gtk_tree_model_iter_parent (GTK_TREE_MODEL(priv->store), &adapter_iter, &iter)) { GDBusProxy *adapter; + g_autoptr(GError) err = NULL; gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &adapter_iter, BLUETOOTH_COLUMN_PROXY, &adapter, @@ -1453,10 +1415,8 @@ adapter1_call_remove_device_sync (ADAPTER1 (adapter), path, NULL, &err); - if (err != NULL) { + if (err != NULL) g_warning ("Failed to remove device: %s", err->message); - g_error_free (err); - } g_object_unref (adapter); } @@ -1464,14 +1424,100 @@ device1_call_pair (DEVICE1(device), cancellable, (GAsyncReadyCallback) device_pair_callback, - simple); + task); } else { - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } +} - g_object_unref (device); +/** + * bluetooth_client_cancel_setup_device_finish: + * @client: + * @res: + * @path: (out): + * @error: + */ +gboolean +bluetooth_client_cancel_setup_device_finish (BluetoothClient *client, + GAsyncResult *res, + char **path, + GError **error) +{ + GTask *task; + char *object_path; + gboolean ret; + + g_return_val_if_fail (path != NULL, FALSE); + + task = G_TASK (res); + + g_warn_if_fail (g_task_get_source_tag (task) == bluetooth_client_cancel_setup_device); + + ret = g_task_propagate_boolean (task, error); + object_path = g_strdup (g_task_get_task_data (task)); + *path = object_path; + g_debug ("bluetooth_client_cancel_setup_device_finish() %s (path: %s)", + ret ? "success" : "failure", object_path); + return ret; +} + +static void +device_cancel_pairing_callback (GDBusProxy *proxy, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (device1_call_cancel_pairing_finish (DEVICE1(proxy), res, &error) == FALSE) { + g_debug ("CancelPairing() failed for %s: %s", + g_dbus_proxy_get_object_path (proxy), + error->message); + g_task_return_error (task, error); + } else { + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); +} + +void +bluetooth_client_cancel_setup_device (BluetoothClient *client, + const char *path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client); + GTask *task; + g_autoptr(GDBusProxy) device = NULL; + GtkTreeIter iter; + + g_return_if_fail (BLUETOOTH_IS_CLIENT (client)); + g_return_if_fail (path != NULL); + + task = g_task_new (G_OBJECT (client), + cancellable, + callback, + user_data); + g_task_set_source_tag (task, bluetooth_client_cancel_setup_device); + g_task_set_task_data (task, g_strdup (path), (GDestroyNotify) g_free); + + if (get_iter_from_path (priv->store, &iter, path) == FALSE) { + g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + "Device with object path %s does not exist", + path); + g_object_unref (task); + return; + } + + gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &iter, + BLUETOOTH_COLUMN_PROXY, &device, + -1); + + device1_call_cancel_pairing (DEVICE1(device), + cancellable, + (GAsyncReadyCallback) device_cancel_pairing_callback, + task); } gboolean @@ -1522,52 +1568,48 @@ } static void -connect_callback (GDBusProxy *proxy, - GAsyncResult *res, - GSimpleAsyncResult *simple) +connect_callback (GDBusProxy *proxy, + GAsyncResult *res, + GTask *task) { gboolean retval; GError *error = NULL; - retval = device1_call_connect_finish (DEVICE1(proxy), res, &error); + retval = device1_call_connect_finish (DEVICE1 (proxy), res, &error); if (retval == FALSE) { g_debug ("Connect failed for %s: %s", g_dbus_proxy_get_object_path (proxy), error->message); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { g_debug ("Connect succeeded for %s", g_dbus_proxy_get_object_path (proxy)); - g_simple_async_result_set_op_res_gboolean (simple, retval); + g_task_return_boolean (task, retval); } - g_simple_async_result_complete_in_idle (simple); - - g_object_unref (simple); + g_object_unref (task); } static void disconnect_callback (GDBusProxy *proxy, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { gboolean retval; GError *error = NULL; - retval = device1_call_disconnect_finish (DEVICE1(proxy), res, &error); + retval = device1_call_disconnect_finish (DEVICE1 (proxy), res, &error); if (retval == FALSE) { g_debug ("Disconnect failed for %s: %s", g_dbus_proxy_get_object_path (proxy), error->message); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { g_debug ("Disconnect succeeded for %s", g_dbus_proxy_get_object_path (proxy)); - g_simple_async_result_set_op_res_gboolean (simple, retval); + g_task_return_boolean (task, retval); } - g_simple_async_result_complete_in_idle (simple); - - g_object_unref (simple); + g_object_unref (task); } /** @@ -1593,38 +1635,41 @@ { BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client); GtkTreeIter iter; - GSimpleAsyncResult *simple; - GDBusProxy *device; + GTask *task; + g_autoptr(GDBusProxy) device = NULL; g_return_if_fail (BLUETOOTH_IS_CLIENT (client)); g_return_if_fail (path != NULL); - if (get_iter_from_path (priv->store, &iter, path) == FALSE) + task = g_task_new (G_OBJECT (client), + cancellable, + callback, + user_data); + g_task_set_source_tag (task, bluetooth_client_connect_service); + + if (get_iter_from_path (priv->store, &iter, path) == FALSE) { + g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + "Device with object path %s does not exist", + path); + g_object_unref (task); return; + } gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &iter, BLUETOOTH_COLUMN_PROXY, &device, -1); - simple = g_simple_async_result_new (G_OBJECT (client), - callback, - user_data, - bluetooth_client_connect_service); - g_simple_async_result_set_check_cancellable (simple, cancellable); - if (connect) { device1_call_connect (DEVICE1(device), cancellable, (GAsyncReadyCallback) connect_callback, - simple); + task); } else { device1_call_disconnect (DEVICE1(device), cancellable, (GAsyncReadyCallback) disconnect_callback, - simple); + task); } - - g_object_unref (device); } /** @@ -1642,16 +1687,13 @@ GAsyncResult *res, GError **error) { - GSimpleAsyncResult *simple; + GTask *task; - simple = (GSimpleAsyncResult *) res; + task = G_TASK (res); - g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == bluetooth_client_connect_service); + g_warn_if_fail (g_task_get_source_tag (task) == bluetooth_client_connect_service); - if (g_simple_async_result_get_op_res_gboolean (simple)) - return TRUE; - g_simple_async_result_propagate_error (simple, error); - return FALSE; + return g_task_propagate_boolean (task, error); } #define BOOL_STR(x) (x ? "True" : "False") diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-client.h gnome-bluetooth-3.34.5/lib/bluetooth-client.h --- gnome-bluetooth-3.34.3/lib/bluetooth-client.h 2020-10-01 09:19:42.291874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-client.h 2021-03-23 15:09:30.417372200 +0000 @@ -21,15 +21,12 @@ * */ -#ifndef __BLUETOOTH_CLIENT_H -#define __BLUETOOTH_CLIENT_H +#pragma once #include #include #include -G_BEGIN_DECLS - #define BLUETOOTH_TYPE_CLIENT (bluetooth_client_get_type()) #define BLUETOOTH_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ BLUETOOTH_TYPE_CLIENT, BluetoothClient)) @@ -81,7 +78,3 @@ gboolean bluetooth_client_connect_service_finish (BluetoothClient *client, GAsyncResult *res, GError **error); - -G_END_DECLS - -#endif /* __BLUETOOTH_CLIENT_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-client-private.h gnome-bluetooth-3.34.5/lib/bluetooth-client-private.h --- gnome-bluetooth-3.34.3/lib/bluetooth-client-private.h 2020-10-01 09:19:42.290874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-client-private.h 2021-03-23 15:09:30.417372200 +0000 @@ -21,15 +21,12 @@ * */ -#ifndef __BLUETOOTH_CLIENT_PRIVATE_H -#define __BLUETOOTH_CLIENT_PRIVATE_H +#pragma once #include #include #include -G_BEGIN_DECLS - typedef void (*BluetoothClientSetupFunc) (BluetoothClient *client, const GError *error, const char *device_path); @@ -45,6 +42,16 @@ char **path, GError **error); +void bluetooth_client_cancel_setup_device (BluetoothClient *client, + const char *path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean bluetooth_client_cancel_setup_device_finish (BluetoothClient *client, + GAsyncResult *res, + char **path, + GError **error); + gboolean bluetooth_client_set_trusted(BluetoothClient *client, const char *device, gboolean trusted); @@ -57,7 +64,3 @@ gboolean bluetooth_client_get_connectable(const char **uuids); GDBusProxy *_bluetooth_client_get_default_adapter (BluetoothClient *client); - -G_END_DECLS - -#endif /* __BLUETOOTH_CLIENT_PRIVATE_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-enums.h gnome-bluetooth-3.34.5/lib/bluetooth-enums.h --- gnome-bluetooth-3.34.3/lib/bluetooth-enums.h 2020-10-01 09:19:42.296874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-enums.h 2021-03-23 15:09:30.417372200 +0000 @@ -21,13 +21,10 @@ * */ -#ifndef __BLUETOOTH_ENUMS_H -#define __BLUETOOTH_ENUMS_H +#pragma once #include -G_BEGIN_DECLS - /** * SECTION:bluetooth-enums * @short_description: Bluetooth related enumerations @@ -79,6 +76,7 @@ * @BLUETOOTH_TYPE_DISPLAY: a display * @BLUETOOTH_TYPE_WEARABLE: a wearable computer * @BLUETOOTH_TYPE_TOY: a toy or game + * @BLUETOOTH_TYPE_SPEAKERS: audio speaker or speakers * * The type of a Bluetooth device. See also %BLUETOOTH_TYPE_INPUT and %BLUETOOTH_TYPE_AUDIO **/ @@ -102,10 +100,11 @@ BLUETOOTH_TYPE_SCANNER = 1 << 16, BLUETOOTH_TYPE_DISPLAY = 1 << 17, BLUETOOTH_TYPE_WEARABLE = 1 << 18, - BLUETOOTH_TYPE_TOY = 1 << 19 + BLUETOOTH_TYPE_TOY = 1 << 19, + BLUETOOTH_TYPE_SPEAKERS = 1 << 20, } BluetoothType; -#define _BLUETOOTH_TYPE_NUM_TYPES 20 +#define _BLUETOOTH_TYPE_NUM_TYPES 21 /** * BLUETOOTH_TYPE_INPUT: @@ -118,7 +117,7 @@ * * Use this value to select any Bluetooth audio device where a #BluetoothType enum is required. */ -#define BLUETOOTH_TYPE_AUDIO (BLUETOOTH_TYPE_HEADSET | BLUETOOTH_TYPE_HEADPHONES | BLUETOOTH_TYPE_OTHER_AUDIO) +#define BLUETOOTH_TYPE_AUDIO (BLUETOOTH_TYPE_HEADSET | BLUETOOTH_TYPE_HEADPHONES | BLUETOOTH_TYPE_OTHER_AUDIO | BLUETOOTH_TYPE_SPEAKERS) /** * BluetoothColumn: @@ -181,7 +180,3 @@ BLUETOOTH_STATUS_CONNECTING, BLUETOOTH_STATUS_PLAYING } BluetoothStatus; - -G_END_DECLS - -#endif /* __BLUETOOTH_ENUMS_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-filter-widget.c gnome-bluetooth-3.34.5/lib/bluetooth-filter-widget.c --- gnome-bluetooth-3.34.3/lib/bluetooth-filter-widget.c 2020-10-01 09:19:42.297874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-filter-widget.c 2021-03-23 15:09:30.417372200 +0000 @@ -34,12 +34,9 @@ #include "bluetooth-utils.h" #include "gnome-bluetooth-enum-types.h" -#define BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ - BLUETOOTH_TYPE_FILTER_WIDGET, BluetoothFilterWidgetPrivate)) +struct _BluetoothFilterWidget { + GtkBox parent; -typedef struct _BluetoothFilterWidgetPrivate BluetoothFilterWidgetPrivate; - -struct _BluetoothFilterWidgetPrivate { GtkWidget *device_type_label, *device_type; GtkWidget *device_category_label, *device_category; GtkWidget *title; @@ -84,97 +81,92 @@ } static void -set_combobox_from_filter (BluetoothFilterWidget *self) +set_combobox_from_filter (BluetoothFilterWidget *filter) { - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(self); GtkTreeIter iter; gboolean cont; /* Look for an exact matching filter first */ - cont = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->device_type_filter_model), + cont = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (filter->device_type_filter_model), &iter); while (cont != FALSE) { int mask; - gtk_tree_model_get (GTK_TREE_MODEL (priv->device_type_filter_model), &iter, + gtk_tree_model_get (GTK_TREE_MODEL (filter->device_type_filter_model), &iter, DEVICE_TYPE_FILTER_COL_MASK, &mask, -1); - if (mask == priv->device_type_filter) { - gtk_combo_box_set_active_iter (GTK_COMBO_BOX(priv->device_type), &iter); + if (mask == filter->device_type_filter) { + gtk_combo_box_set_active_iter (GTK_COMBO_BOX(filter->device_type), &iter); return; } - cont = gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->device_type_filter_model), &iter); + cont = gtk_tree_model_iter_next (GTK_TREE_MODEL (filter->device_type_filter_model), &iter); } /* Then a fuzzy match */ - cont = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->device_type_filter_model), + cont = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (filter->device_type_filter_model), &iter); while (cont != FALSE) { int mask; - gtk_tree_model_get (GTK_TREE_MODEL (priv->device_type_filter_model), &iter, + gtk_tree_model_get (GTK_TREE_MODEL (filter->device_type_filter_model), &iter, DEVICE_TYPE_FILTER_COL_MASK, &mask, -1); - if (mask & priv->device_type_filter) { - gtk_combo_box_set_active_iter (GTK_COMBO_BOX(priv->device_type), &iter); + if (mask & filter->device_type_filter) { + gtk_combo_box_set_active_iter (GTK_COMBO_BOX(filter->device_type), &iter); return; } - cont = gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->device_type_filter_model), &iter); + cont = gtk_tree_model_iter_next (GTK_TREE_MODEL (filter->device_type_filter_model), &iter); } /* Then just set the any then */ - gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->device_type_filter_model), &iter); - gtk_combo_box_set_active_iter (GTK_COMBO_BOX(priv->device_type), &iter); + gtk_tree_model_get_iter_first (GTK_TREE_MODEL (filter->device_type_filter_model), &iter); + gtk_combo_box_set_active_iter (GTK_COMBO_BOX(filter->device_type), &iter); } static void filter_category_changed_cb (GtkComboBox *widget, gpointer data) { - BluetoothFilterWidget *self = BLUETOOTH_FILTER_WIDGET (data); - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(self); + BluetoothFilterWidget *filter = BLUETOOTH_FILTER_WIDGET (data); - priv->device_category_filter = gtk_combo_box_get_active (GTK_COMBO_BOX(priv->device_category)); - if (priv->filter) - gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->filter)); - g_object_notify (G_OBJECT(self), "device-category-filter"); + filter->device_category_filter = gtk_combo_box_get_active (GTK_COMBO_BOX(filter->device_category)); + if (filter->filter) + gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter->filter)); + g_object_notify (G_OBJECT(filter), "device-category-filter"); } static void filter_type_changed_cb (GtkComboBox *widget, gpointer data) { - BluetoothFilterWidget *self = BLUETOOTH_FILTER_WIDGET (data); - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(self); + BluetoothFilterWidget *filter = BLUETOOTH_FILTER_WIDGET (data); GtkTreeIter iter; if (gtk_combo_box_get_active_iter (widget, &iter) == FALSE) return; - gtk_tree_model_get (GTK_TREE_MODEL (priv->device_type_filter_model), &iter, - DEVICE_TYPE_FILTER_COL_MASK, &(priv->device_type_filter), + gtk_tree_model_get (GTK_TREE_MODEL (filter->device_type_filter_model), &iter, + DEVICE_TYPE_FILTER_COL_MASK, &(filter->device_type_filter), -1); - if (priv->filter) - gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->filter)); - g_object_notify (G_OBJECT(self), "device-type-filter"); + if (filter->filter) + gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter->filter)); + g_object_notify (G_OBJECT(filter), "device-type-filter"); } /** * bluetooth_filter_widget_set_title: - * @self: a #BluetoothFilterWidget. + * @filter: a #BluetoothFilterWidget. * @title: Title for the #BluetoothFilterWidget. * * Used to set a different title for the #BluetoothFilterWidget than the default. * **/ void -bluetooth_filter_widget_set_title (BluetoothFilterWidget *self, gchar *title) +bluetooth_filter_widget_set_title (BluetoothFilterWidget *filter, gchar *title) { - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(self); - - gtk_label_set_text (GTK_LABEL (priv->title), title); + gtk_label_set_text (GTK_LABEL (filter->title), title); } static void -bluetooth_filter_widget_bind_chooser_single (BluetoothFilterWidget *self, +bluetooth_filter_widget_bind_chooser_single (BluetoothFilterWidget *filter, BluetoothChooser *chooser, const char *property) { @@ -183,13 +175,13 @@ * The bindings will be automatically removed when one of the * objects goes away */ g_object_bind_property ((gpointer) chooser, property, - (gpointer) self, property, + (gpointer) filter, property, G_BINDING_BIDIRECTIONAL); } /** * bluetooth_filter_widget_bind_filter: - * @self: a #BluetoothFilterWidget. + * @filter: a #BluetoothFilterWidget. * @chooser: The #BluetoothChooser widget to bind the filter to. * * Binds a #BluetoothFilterWidget to a #BluetoothChooser such that changing the @@ -199,47 +191,42 @@ * **/ void -bluetooth_filter_widget_bind_filter (BluetoothFilterWidget *self, BluetoothChooser *chooser) +bluetooth_filter_widget_bind_filter (BluetoothFilterWidget *filter, BluetoothChooser *chooser) { - bluetooth_filter_widget_bind_chooser_single (self, chooser, "device-type-filter"); - bluetooth_filter_widget_bind_chooser_single (self, chooser, "device-category-filter"); - bluetooth_filter_widget_bind_chooser_single (self, chooser, "show-device-type"); - bluetooth_filter_widget_bind_chooser_single (self, chooser, "show-device-category"); + bluetooth_filter_widget_bind_chooser_single (filter, chooser, "device-type-filter"); + bluetooth_filter_widget_bind_chooser_single (filter, chooser, "device-category-filter"); + bluetooth_filter_widget_bind_chooser_single (filter, chooser, "show-device-type"); + bluetooth_filter_widget_bind_chooser_single (filter, chooser, "show-device-category"); } static void -bluetooth_filter_widget_init(BluetoothFilterWidget *self) +bluetooth_filter_widget_init(BluetoothFilterWidget *filter) { - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(self); guint i; GtkWidget *label; - GtkWidget *alignment; GtkWidget *table; GtkCellRenderer *renderer; - gtk_widget_push_composite_child (); + g_object_set (G_OBJECT (filter), "orientation", GTK_ORIENTATION_VERTICAL, NULL); - g_object_set (G_OBJECT (self), "orientation", GTK_ORIENTATION_VERTICAL, NULL); + gtk_box_set_homogeneous (GTK_BOX (filter), FALSE); + gtk_box_set_spacing (GTK_BOX (filter), 6); - gtk_box_set_homogeneous (GTK_BOX (self), FALSE); - gtk_box_set_spacing (GTK_BOX (self), 6); - - priv->title = gtk_label_new (""); + filter->title = gtk_label_new (""); /* This is the title of the filter section of the Bluetooth device chooser. * It used to say Show Only Bluetooth Devices With... */ - bluetooth_filter_widget_set_title (self, _("Show:")); - gtk_widget_show (priv->title); - gtk_box_pack_start (GTK_BOX (self), priv->title, TRUE, TRUE, 0); - gtk_misc_set_alignment (GTK_MISC (priv->title), 0, 0.5); - - alignment = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_show (alignment); - gtk_box_pack_start (GTK_BOX (self), alignment, TRUE, TRUE, 0); + bluetooth_filter_widget_set_title (filter, _("Show:")); + gtk_widget_show (filter->title); + gtk_box_pack_start (GTK_BOX (filter), filter->title, TRUE, TRUE, 0); + g_object_set (G_OBJECT (filter->title), + "xalign", 0.0, + "yalign", 0.5, + NULL); table = gtk_grid_new (); gtk_widget_show (table); - gtk_container_add (GTK_CONTAINER (alignment), table); + gtk_box_pack_start (GTK_BOX (filter), table, TRUE, TRUE, 0); gtk_grid_set_row_spacing (GTK_GRID (table), 6); gtk_grid_set_column_spacing (GTK_GRID (table), 12); @@ -248,24 +235,27 @@ gtk_widget_set_no_show_all (label, TRUE); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - priv->device_category_label = label; - - priv->device_category = gtk_combo_box_text_new (); - gtk_widget_set_no_show_all (priv->device_category, TRUE); - gtk_widget_show (priv->device_category); - gtk_grid_attach (GTK_GRID (table), priv->device_category, 1, 0, 1, 1); - gtk_widget_set_tooltip_text (priv->device_category, _("Select the device category to filter")); + g_object_set (G_OBJECT (label), + "xalign", 0.0, + "yalign", 0.5, + NULL); + filter->device_category_label = label; + + filter->device_category = gtk_combo_box_text_new (); + gtk_widget_set_no_show_all (filter->device_category, TRUE); + gtk_widget_show (filter->device_category); + gtk_grid_attach (GTK_GRID (table), filter->device_category, 1, 0, 1, 1); + gtk_widget_set_tooltip_text (filter->device_category, _("Select the device category to filter")); for (i = 0; i < BLUETOOTH_CATEGORY_NUM_CATEGORIES; i++) { - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (priv->device_category), + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (filter->device_category), _(bluetooth_device_category_to_string (i))); } - g_signal_connect (G_OBJECT (priv->device_category), "changed", - G_CALLBACK (filter_category_changed_cb), self); - gtk_combo_box_set_active (GTK_COMBO_BOX (priv->device_category), priv->device_category_filter); - if (priv->show_device_category) { - gtk_widget_show (priv->device_category_label); - gtk_widget_show (priv->device_category); + g_signal_connect (G_OBJECT (filter->device_category), "changed", + G_CALLBACK (filter_category_changed_cb), filter); + gtk_combo_box_set_active (GTK_COMBO_BOX (filter->device_category), filter->device_category_filter); + if (filter->show_device_category) { + gtk_widget_show (filter->device_category_label); + gtk_widget_show (filter->device_category); } /* The device type filter */ @@ -273,29 +263,32 @@ gtk_widget_set_no_show_all (label, TRUE); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - priv->device_type_label = label; + g_object_set (G_OBJECT (label), + "xalign", 0.0, + "yalign", 0.5, + NULL); + filter->device_type_label = label; - priv->device_type_filter_model = GTK_TREE_MODEL (gtk_list_store_new (DEVICE_TYPE_FILTER_NUM_COLS, + filter->device_type_filter_model = GTK_TREE_MODEL (gtk_list_store_new (DEVICE_TYPE_FILTER_NUM_COLS, G_TYPE_STRING, G_TYPE_INT)); - priv->device_type = gtk_combo_box_new_with_model (priv->device_type_filter_model); + filter->device_type = gtk_combo_box_new_with_model (filter->device_type_filter_model); renderer = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->device_type), renderer, TRUE); - gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->device_type), renderer, "text", DEVICE_TYPE_FILTER_COL_NAME); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (filter->device_type), renderer, TRUE); + gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (filter->device_type), renderer, "text", DEVICE_TYPE_FILTER_COL_NAME); - gtk_widget_set_no_show_all (priv->device_type, TRUE); - gtk_widget_show (priv->device_type); - gtk_grid_attach (GTK_GRID (table), priv->device_type, 1, 1, 1, 1); - gtk_widget_set_tooltip_text (priv->device_type, _("Select the device type to filter")); - gtk_list_store_insert_with_values (GTK_LIST_STORE (priv->device_type_filter_model), NULL, G_MAXUINT32, + gtk_widget_set_no_show_all (filter->device_type, TRUE); + gtk_widget_show (filter->device_type); + gtk_grid_attach (GTK_GRID (table), filter->device_type, 1, 1, 1, 1); + gtk_widget_set_tooltip_text (filter->device_type, _("Select the device type to filter")); + gtk_list_store_insert_with_values (GTK_LIST_STORE (filter->device_type_filter_model), NULL, G_MAXUINT32, DEVICE_TYPE_FILTER_COL_NAME, _(bluetooth_type_to_filter_string (BLUETOOTH_TYPE_ANY)), DEVICE_TYPE_FILTER_COL_MASK, BLUETOOTH_TYPE_ANY, -1); - gtk_list_store_insert_with_values (GTK_LIST_STORE (priv->device_type_filter_model), NULL, G_MAXUINT32, + gtk_list_store_insert_with_values (GTK_LIST_STORE (filter->device_type_filter_model), NULL, G_MAXUINT32, DEVICE_TYPE_FILTER_COL_NAME, _("Input devices (mice, keyboards, etc.)"), DEVICE_TYPE_FILTER_COL_MASK, BLUETOOTH_TYPE_INPUT, -1); - gtk_list_store_insert_with_values (GTK_LIST_STORE (priv->device_type_filter_model), NULL, G_MAXUINT32, + gtk_list_store_insert_with_values (GTK_LIST_STORE (filter->device_type_filter_model), NULL, G_MAXUINT32, DEVICE_TYPE_FILTER_COL_NAME, _("Headphones, headsets and other audio devices"), DEVICE_TYPE_FILTER_COL_MASK, BLUETOOTH_TYPE_AUDIO, -1); @@ -304,32 +297,29 @@ int mask = 1 << i; if (mask & BLUETOOTH_TYPE_INPUT || mask & BLUETOOTH_TYPE_AUDIO) continue; - gtk_list_store_insert_with_values (GTK_LIST_STORE (priv->device_type_filter_model), NULL, G_MAXUINT32, + gtk_list_store_insert_with_values (GTK_LIST_STORE (filter->device_type_filter_model), NULL, G_MAXUINT32, DEVICE_TYPE_FILTER_COL_NAME, _(bluetooth_type_to_filter_string (mask)), DEVICE_TYPE_FILTER_COL_MASK, mask, -1); } - g_signal_connect (G_OBJECT (priv->device_type), "changed", - G_CALLBACK(filter_type_changed_cb), self); - set_combobox_from_filter (self); - if (priv->show_device_type) { - gtk_widget_show (priv->device_type_label); - gtk_widget_show (priv->device_type); + g_signal_connect (G_OBJECT (filter->device_type), "changed", + G_CALLBACK(filter_type_changed_cb), filter); + set_combobox_from_filter (filter); + if (filter->show_device_type) { + gtk_widget_show (filter->device_type_label); + gtk_widget_show (filter->device_type); } /* The services filter */ - priv->device_service_filter = NULL; - - gtk_widget_pop_composite_child (); + filter->device_service_filter = NULL; } static void bluetooth_filter_widget_finalize (GObject *object) { - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(object); + BluetoothFilterWidget *filter = BLUETOOTH_FILTER_WIDGET (object); - g_free (priv->device_service_filter); - priv->device_service_filter = NULL; + g_clear_pointer (&filter->device_service_filter, g_free); G_OBJECT_CLASS(bluetooth_filter_widget_parent_class)->finalize(object); } @@ -337,12 +327,9 @@ static void bluetooth_filter_widget_dispose (GObject *object) { - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(object); + BluetoothFilterWidget *filter = BLUETOOTH_FILTER_WIDGET (object); - if (priv->chooser) { - g_object_unref (priv->chooser); - priv->chooser = NULL; - } + g_clear_object (&filter->chooser); G_OBJECT_CLASS(bluetooth_filter_widget_parent_class)->dispose(object); } @@ -360,32 +347,32 @@ bluetooth_filter_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(object); + BluetoothFilterWidget *filter = BLUETOOTH_FILTER_WIDGET (object); switch (prop_id) { case PROP_SHOW_DEVICE_TYPE: - priv->show_device_type = g_value_get_boolean (value); - g_object_set (G_OBJECT (priv->device_type_label), "visible", priv->show_device_type, NULL); - g_object_set (G_OBJECT (priv->device_type), "visible", priv->show_device_type, NULL); + filter->show_device_type = g_value_get_boolean (value); + g_object_set (G_OBJECT (filter->device_type_label), "visible", filter->show_device_type, NULL); + g_object_set (G_OBJECT (filter->device_type), "visible", filter->show_device_type, NULL); break; case PROP_SHOW_DEVICE_CATEGORY: - priv->show_device_category = g_value_get_boolean (value); - g_object_set (G_OBJECT (priv->device_category_label), "visible", priv->show_device_category, NULL); - g_object_set (G_OBJECT (priv->device_category), "visible", priv->show_device_category, NULL); + filter->show_device_category = g_value_get_boolean (value); + g_object_set (G_OBJECT (filter->device_category_label), "visible", filter->show_device_category, NULL); + g_object_set (G_OBJECT (filter->device_category), "visible", filter->show_device_category, NULL); break; case PROP_DEVICE_TYPE_FILTER: - priv->device_type_filter = g_value_get_int (value); + filter->device_type_filter = g_value_get_int (value); set_combobox_from_filter (BLUETOOTH_FILTER_WIDGET (object)); break; case PROP_DEVICE_CATEGORY_FILTER: - priv->device_category_filter = g_value_get_enum (value); - gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_category), priv->device_category_filter); + filter->device_category_filter = g_value_get_enum (value); + gtk_combo_box_set_active (GTK_COMBO_BOX(filter->device_category), filter->device_category_filter); break; case PROP_DEVICE_SERVICE_FILTER: - g_free (priv->device_service_filter); - priv->device_service_filter = g_value_dup_string (value); - if (priv->filter) - gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->filter)); + g_free (filter->device_service_filter); + filter->device_service_filter = g_value_dup_string (value); + if (filter->filter) + gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter->filter)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -397,23 +384,23 @@ bluetooth_filter_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - BluetoothFilterWidgetPrivate *priv = BLUETOOTH_FILTER_WIDGET_GET_PRIVATE(object); + BluetoothFilterWidget *filter = BLUETOOTH_FILTER_WIDGET (object); switch (prop_id) { case PROP_SHOW_DEVICE_TYPE: - g_value_set_boolean (value, priv->show_device_type); + g_value_set_boolean (value, filter->show_device_type); break; case PROP_SHOW_DEVICE_CATEGORY: - g_value_set_boolean (value, priv->show_device_category); + g_value_set_boolean (value, filter->show_device_category); break; case PROP_DEVICE_TYPE_FILTER: - g_value_set_int (value, priv->device_type_filter); + g_value_set_int (value, filter->device_type_filter); break; case PROP_DEVICE_CATEGORY_FILTER: - g_value_set_enum (value, priv->device_category_filter); + g_value_set_enum (value, filter->device_category_filter); break; case PROP_DEVICE_SERVICE_FILTER: - g_value_set_string (value, priv->device_service_filter); + g_value_set_string (value, filter->device_service_filter); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -429,8 +416,6 @@ guint i; int max_filter_val; - g_type_class_add_private(klass, sizeof(BluetoothFilterWidgetPrivate)); - G_OBJECT_CLASS(klass)->dispose = bluetooth_filter_widget_dispose; G_OBJECT_CLASS(klass)->finalize = bluetooth_filter_widget_finalize; diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-filter-widget.h gnome-bluetooth-3.34.5/lib/bluetooth-filter-widget.h --- gnome-bluetooth-3.34.3/lib/bluetooth-filter-widget.h 2020-10-01 09:19:42.297874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-filter-widget.h 2021-03-23 15:09:30.417372200 +0000 @@ -22,46 +22,17 @@ * */ -#ifndef __BLUETOOTH_FILTER_WIDGET_H -#define __BLUETOOTH_FILTER_WIDGET_H +#pragma once #include #include #include -G_BEGIN_DECLS - +G_DECLARE_FINAL_TYPE(BluetoothFilterWidget, bluetooth_filter_widget, BLUETOOTH, FILTER_WIDGET, GtkBox) #define BLUETOOTH_TYPE_FILTER_WIDGET (bluetooth_filter_widget_get_type()) -#define BLUETOOTH_FILTER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - BLUETOOTH_TYPE_FILTER_WIDGET, BluetoothFilterWidget)) -#define BLUETOOTH_FILTER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - BLUETOOTH_TYPE_FILTER_WIDGET, BluetoothFilterWidgetClass)) -#define BLUETOOTH_IS_FILTER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - BLUETOOTH_TYPE_FILTER_WIDGET)) -#define BLUETOOTH_IS_FILTER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \ - BLUETOOTH_TYPE_FILTER_WIDGET)) -#define BLUETOOTH_GET_FILTER_WIDGET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \ - BLUETOOTH_TYPE_FILTER_WIDGET, BluetoothFilterWidgetClass)) - -typedef struct _BluetoothFilterWidget BluetoothFilterWidget; -typedef struct _BluetoothFilterWidgetClass BluetoothFilterWidgetClass; - -struct _BluetoothFilterWidget { - GtkBox parent; -}; - -struct _BluetoothFilterWidgetClass { - GtkBoxClass parent_class; -}; - -GType bluetooth_filter_widget_get_type (void); GtkWidget *bluetooth_filter_widget_new (void); -void bluetooth_filter_widget_set_title (BluetoothFilterWidget *self, gchar *title); - -void bluetooth_filter_widget_bind_filter (BluetoothFilterWidget *self, BluetoothChooser *chooser); - -G_END_DECLS +void bluetooth_filter_widget_set_title (BluetoothFilterWidget *filter, gchar *title); -#endif /* __BLUETOOTH_FILTER_WIDGET_H */ +void bluetooth_filter_widget_bind_filter (BluetoothFilterWidget *filter, BluetoothChooser *chooser); diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-hdy-column.h gnome-bluetooth-3.34.5/lib/bluetooth-hdy-column.h --- gnome-bluetooth-3.34.3/lib/bluetooth-hdy-column.h 2020-10-01 09:19:42.298874100 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-hdy-column.h 2021-03-23 15:09:30.417372200 +0000 @@ -8,8 +8,6 @@ #include -G_BEGIN_DECLS - #define BLUETOOTH_TYPE_HDY_COLUMN (bluetooth_hdy_column_get_type()) G_DECLARE_FINAL_TYPE (BluetoothHdyColumn, bluetooth_hdy_column, BLUETOOTH, HDY_COLUMN, GtkBin) @@ -21,5 +19,3 @@ gint bluetooth_hdy_column_get_linear_growth_width (BluetoothHdyColumn *self); void bluetooth_hdy_column_set_linear_growth_width (BluetoothHdyColumn *self, gint linear_growth_width); - -G_END_DECLS diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-pairing-dialog.h gnome-bluetooth-3.34.5/lib/bluetooth-pairing-dialog.h --- gnome-bluetooth-3.34.3/lib/bluetooth-pairing-dialog.h 2020-10-01 09:19:42.300874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-pairing-dialog.h 2021-03-23 15:09:30.417372200 +0000 @@ -18,13 +18,10 @@ * */ -#ifndef __BLUETOOTH_PAIRING_DIALOG_H -#define __BLUETOOTH_PAIRING_DIALOG_H +#pragma once #include -G_BEGIN_DECLS - #define BLUETOOTH_TYPE_PAIRING_DIALOG (bluetooth_pairing_dialog_get_type()) #define BLUETOOTH_PAIRING_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ BLUETOOTH_TYPE_PAIRING_DIALOG, BluetoothPairingDialog)) @@ -79,7 +76,3 @@ guint entered); char *bluetooth_pairing_dialog_get_pin (BluetoothPairingDialog *self); - -G_END_DECLS - -#endif /* __BLUETOOTH_PAIRING_DIALOG_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-pairing-dialog.ui gnome-bluetooth-3.34.5/lib/bluetooth-pairing-dialog.ui --- gnome-bluetooth-3.34.3/lib/bluetooth-pairing-dialog.ui 2020-10-01 09:19:42.300874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-pairing-dialog.ui 2021-03-23 15:09:30.417372200 +0000 @@ -33,8 +33,8 @@ False 50 50 - 24 - 30 + 48 + 64 vertical diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-settings-obexpush.c gnome-bluetooth-3.34.5/lib/bluetooth-settings-obexpush.c --- gnome-bluetooth-3.34.3/lib/bluetooth-settings-obexpush.c 2020-10-01 09:19:42.301874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-settings-obexpush.c 2021-03-23 15:09:30.418372200 +0000 @@ -85,13 +85,11 @@ if (g_str_equal (action, "display") != FALSE) { GdkDisplay *display; GAppLaunchContext *ctx; - GTimeVal val; - - g_get_current_time (&val); display = gdk_display_get_default (); ctx = G_APP_LAUNCH_CONTEXT (gdk_display_get_app_launch_context (display)); - gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (ctx), val.tv_sec); + gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (ctx), + g_get_monotonic_time () / G_USEC_PER_SEC); if (g_app_info_launch_default_for_uri (file_uri, ctx, NULL) == FALSE) { g_warning ("Failed to launch the file viewer\n"); diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-settings-obexpush.h gnome-bluetooth-3.34.5/lib/bluetooth-settings-obexpush.h --- gnome-bluetooth-3.34.3/lib/bluetooth-settings-obexpush.h 2020-10-01 09:19:42.301874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-settings-obexpush.h 2021-03-23 15:09:30.418372200 +0000 @@ -23,13 +23,10 @@ * */ -#ifndef __OBEX_AGENT_H__ -#define __OBEX_AGENT_H__ +#pragma once #include -G_BEGIN_DECLS - typedef struct _ObexAgent { GObject parent; guint owner_id; @@ -54,7 +51,3 @@ void obex_agent_up (void); void obex_agent_down (void); char *lookup_download_dir (void); - -G_END_DECLS - -#endif diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-settings-row.c gnome-bluetooth-3.34.5/lib/bluetooth-settings-row.c --- gnome-bluetooth-3.34.3/lib/bluetooth-settings-row.c 2020-10-01 09:19:42.301874200 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-settings-row.c 2021-03-23 15:09:30.418372200 +0000 @@ -49,8 +49,10 @@ BluetoothType type; gboolean connected; char *name; + char *alias; char *bdaddr; gboolean legacy_pairing; + gint64 time_created; gboolean pairing; }; @@ -63,9 +65,11 @@ PROP_TYPE, PROP_CONNECTED, PROP_NAME, + PROP_ALIAS, PROP_ADDRESS, PROP_PAIRING, - PROP_LEGACY_PAIRING + PROP_LEGACY_PAIRING, + PROP_TIME_CREATED }; G_DEFINE_TYPE_WITH_PRIVATE(BluetoothSettingsRow, bluetooth_settings_row, GTK_TYPE_LIST_BOX_ROW) @@ -100,6 +104,8 @@ priv->status, "visible", G_BINDING_INVERT_BOOLEAN | G_BINDING_BIDIRECTIONAL); g_object_bind_property (priv->spinner, "active", priv->status, "visible", G_BINDING_INVERT_BOOLEAN | G_BINDING_BIDIRECTIONAL); + + priv->time_created = g_get_monotonic_time(); } static void @@ -110,6 +116,7 @@ g_clear_object (&priv->proxy); g_clear_pointer (&priv->name, g_free); + g_clear_pointer (&priv->alias, g_free); g_clear_pointer (&priv->bdaddr, g_free); G_OBJECT_CLASS(bluetooth_settings_row_parent_class)->finalize(object); @@ -143,6 +150,9 @@ case PROP_NAME: g_value_set_string (value, priv->name); break; + case PROP_ALIAS: + g_value_set_string (value, priv->alias); + break; case PROP_ADDRESS: g_value_set_string (value, priv->bdaddr); break; @@ -152,6 +162,9 @@ case PROP_LEGACY_PAIRING: g_value_set_boolean (value, priv->legacy_pairing); break; + case PROP_TIME_CREATED: + g_value_set_int64 (value, priv->time_created); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; @@ -168,7 +181,7 @@ bluetooth_type_to_string (priv->type)); gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE); } else { - gtk_label_set_text (GTK_LABEL (priv->label), priv->name); + gtk_label_set_text (GTK_LABEL (priv->label), priv->alias); gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE); } } @@ -208,6 +221,11 @@ priv->name = g_value_dup_string (value); update_row (self); break; + case PROP_ALIAS: + g_free (priv->alias); + priv->alias = g_value_dup_string (value); + update_row (self); + break; case PROP_ADDRESS: g_free (priv->bdaddr); priv->bdaddr = g_value_dup_string (value); @@ -261,6 +279,10 @@ g_param_spec_string ("name", NULL, "Name", NULL, G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_ALIAS, + g_param_spec_string ("alias", NULL, + "Alias", + NULL, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_ADDRESS, g_param_spec_string ("address", NULL, "Address", @@ -273,6 +295,10 @@ g_param_spec_boolean ("legacy-pairing", NULL, "Legacy pairing", FALSE, G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_TIME_CREATED, + g_param_spec_int64 ("time-created", NULL, + "Time Created", + G_MININT64, G_MAXINT64, 0, G_PARAM_READABLE)); /* Bind class to template */ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/bluetooth/bluetooth-settings-row.ui"); diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-settings-row.h gnome-bluetooth-3.34.5/lib/bluetooth-settings-row.h --- gnome-bluetooth-3.34.3/lib/bluetooth-settings-row.h 2020-10-01 09:19:42.303874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-settings-row.h 2021-03-23 15:09:30.418372200 +0000 @@ -18,13 +18,10 @@ * */ -#ifndef __BLUETOOTH_SETTINGS_ROW_H -#define __BLUETOOTH_SETTINGS_ROW_H +#pragma once #include -G_BEGIN_DECLS - #define BLUETOOTH_TYPE_SETTINGS_ROW (bluetooth_settings_row_get_type()) #define BLUETOOTH_SETTINGS_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ BLUETOOTH_TYPE_SETTINGS_ROW, BluetoothSettingsRow)) @@ -57,7 +54,3 @@ GType bluetooth_settings_row_get_type (void); GtkWidget *bluetooth_settings_row_new (void); - -G_END_DECLS - -#endif /* __BLUETOOTH_SETTINGS_ROW_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-settings-widget.c gnome-bluetooth-3.34.5/lib/bluetooth-settings-widget.c --- gnome-bluetooth-3.34.3/lib/bluetooth-settings-widget.c 2020-10-01 09:19:42.305874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-settings-widget.c 2021-03-23 15:09:30.418372200 +0000 @@ -186,7 +186,7 @@ BluetoothSettingsWidget *self; BluetoothSettingsWidgetPrivate *priv; gboolean success; - GError *error = NULL; + g_autoptr(GError) error = NULL; ConnectData *data = (ConnectData *) user_data; success = bluetooth_client_connect_service_finish (BLUETOOTH_CLIENT (source_object), @@ -212,7 +212,6 @@ set_connecting_page (self, CONNECTING_NOTEBOOK_PAGE_SWITCH); } - g_clear_error (&error); remove_connecting (self, data->bdaddr); //FIXME show an error if it failed? @@ -221,7 +220,6 @@ NULL); out: - g_clear_error (&error); g_free (data->bdaddr); g_free (data); } @@ -262,8 +260,8 @@ BluetoothType *type) { BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self); - GVariant *value; - char *bdaddr; + g_autoptr(GVariant) value = NULL; + g_autofree char *bdaddr = NULL; g_return_val_if_fail (name != NULL, FALSE); @@ -273,11 +271,11 @@ return FALSE; } *name = g_variant_dup_string (value, NULL); - g_variant_unref (value); + g_clear_pointer (&value, g_variant_unref); value = g_dbus_proxy_get_cached_property (device, "Address"); bdaddr = g_variant_dup_string (value, NULL); - g_variant_unref (value); + g_clear_pointer (&value, g_variant_unref); if (ret_bdaddr) *ret_bdaddr = g_strdup (bdaddr); @@ -286,7 +284,6 @@ value = g_dbus_proxy_get_cached_property (device, "Class"); if (value != NULL) { *type = bluetooth_class_to_type (g_variant_get_uint32 (value)); - g_variant_unref (value); } else { *type = GPOINTER_TO_UINT (g_hash_table_lookup (priv->devices_type, bdaddr)); if (*type == 0) @@ -294,8 +291,6 @@ } } - g_free (bdaddr); - return TRUE; } @@ -326,13 +321,12 @@ for (i = 0; i < PIN_NUM_DIGITS; i++) { int r; - char *c; + g_autofree char *c = NULL; r = g_random_int_range (1, 5); c = g_strdup_printf ("%d", r); g_string_append (pin, c); - g_free (c); g_string_append (pin_display, arrows[r]); } @@ -364,7 +358,7 @@ if (response == GTK_RESPONSE_ACCEPT) { const char *name; - char *pin; + g_autofree char *pin = NULL; BluetoothPairingMode mode; mode = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (dialog), "mode")); @@ -379,7 +373,6 @@ } bluetooth_pairing_dialog_set_mode (BLUETOOTH_PAIRING_DIALOG (priv->pairing_dialog), mode, pin, name); - g_free (pin); g_signal_connect (G_OBJECT (priv->pairing_dialog), "response", G_CALLBACK (display_cb), user_data); } else { @@ -431,22 +424,22 @@ BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); BluetoothType type; - char *name, *bdaddr; + g_autofree char *name = NULL; + g_autofree char *bdaddr = NULL; guint max_digits; gboolean confirm_pin = TRUE; - char *default_pin; - char *display_pin = NULL; + g_autofree char *default_pin = NULL; + g_autofree char *display_pin = NULL; BluetoothPairingMode mode; gboolean remote_initiated; g_debug ("pincode_callback (%s)", g_dbus_proxy_get_object_path (device)); if (!get_properties_for_device (self, device, &name, &bdaddr, &type)) { - char *msg; + g_autofree char *msg = NULL; msg = g_strdup_printf ("Missing information for %s", g_dbus_proxy_get_object_path (device)); g_dbus_method_invocation_return_dbus_error (invocation, "org.bluez.Error.Rejected", msg); - g_free (msg); return; } @@ -507,7 +500,7 @@ BLUETOOTH_PAIRING_MODE_YES_NO, default_pin, name); - g_object_set_data_full (G_OBJECT (invocation), "pin", g_strdup (default_pin), g_free); + g_object_set_data_full (G_OBJECT (invocation), "pin", g_steal_pointer (&default_pin), g_free); g_object_set_data_full (G_OBJECT (invocation), "device", g_object_ref (device), g_object_unref); g_object_set_data (G_OBJECT (priv->pairing_dialog), "invocation", invocation); @@ -515,26 +508,63 @@ G_CALLBACK (confirm_remote_pin_cb), user_data); } - g_free (name); - g_free (bdaddr); - g_free (default_pin); - g_free (display_pin); - gtk_widget_show (priv->pairing_dialog); } static void -display_callback (GDBusMethodInvocation *invocation, - GDBusProxy *device, - guint pin, - guint entered, - gpointer user_data) +cancel_setup_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + g_autoptr(GError) error = NULL; + g_autofree char *path = NULL; + gboolean ret; + + ret = bluetooth_client_cancel_setup_device_finish (BLUETOOTH_CLIENT (source_object), + res, &path, &error); + if (!ret) + g_debug ("Setup cancellation for '%s' failed: %s", path, error->message); + else + g_debug ("Setup cancellation for '%s' success", path); +} + +static void +display_passkey_or_pincode_cb (GtkDialog *dialog, + int response, + gpointer user_data) +{ + BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); + + if (response == GTK_RESPONSE_CANCEL || + response == GTK_RESPONSE_DELETE_EVENT) { + g_autofree char *path = NULL; + + path = g_object_steal_data (G_OBJECT (dialog), "path"); + bluetooth_client_cancel_setup_device (priv->client, + path, + priv->cancellable, + cancel_setup_cb, + user_data); + } else { + g_assert_not_reached (); + } + + g_clear_pointer (&priv->pairing_dialog, gtk_widget_destroy); +} + +static void +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_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) @@ -548,8 +578,11 @@ name); bluetooth_pairing_dialog_set_pin_entered (BLUETOOTH_PAIRING_DIALOG (priv->pairing_dialog), entered); - g_free (pin_str); - g_free (name); + g_signal_connect (G_OBJECT (priv->pairing_dialog), "response", + G_CALLBACK (display_passkey_or_pincode_cb), user_data); + g_object_set_data_full (G_OBJECT (priv->pairing_dialog), + "path", g_strdup (g_dbus_proxy_get_object_path (device)), + g_free); gtk_widget_show (priv->pairing_dialog); } @@ -563,18 +596,18 @@ BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); BluetoothType type; - char *display_pin = NULL; - char *name, *bdaddr; - char *db_pin; + g_autofree char *display_pin = NULL; + g_autofree char *name = NULL; + g_autofree char *bdaddr = NULL; + g_autofree char *db_pin = NULL; g_debug ("display_pincode_callback (%s, %s)", g_dbus_proxy_get_object_path (device), pincode); if (!get_properties_for_device (self, device, &name, &bdaddr, &type)) { - char *msg; + g_autofree char *msg = NULL; msg = g_strdup_printf ("Missing information for %s", g_dbus_proxy_get_object_path (device)); g_dbus_method_invocation_return_dbus_error (invocation, "org.bluez.Error.Rejected", msg); - g_free (msg); return; } @@ -587,23 +620,21 @@ if (g_strcmp0 (db_pin, "KEYBOARD") == 0) { /* Should work, follow through */ } else if (g_strcmp0 (db_pin, "ICADE") == 0) { - char *msg; + g_autofree char *msg = NULL; msg = g_strdup_printf ("Generated pincode for %s when it shouldn't have", name); g_dbus_method_invocation_return_dbus_error (invocation, "org.bluez.Error.Rejected", msg); - g_free (msg); - goto bail; + return; } else if (g_strcmp0 (db_pin, "0000") == 0) { g_debug ("Ignoring generated keyboard PIN '%s', should get 0000 soon", pincode); g_dbus_method_invocation_return_value (invocation, NULL); - goto bail; + return; } else if (g_strcmp0 (db_pin, "NULL") == 0) { - char *msg; + g_autofree char *msg = NULL; msg = g_strdup_printf ("Attempting pairing for %s that doesn't support pairing", name); g_dbus_method_invocation_return_dbus_error (invocation, "org.bluez.Error.Rejected", msg); - g_free (msg); - goto bail; + return; } setup_pairing_dialog (BLUETOOTH_SETTINGS_WIDGET (user_data)); @@ -613,15 +644,14 @@ BLUETOOTH_PAIRING_MODE_PIN_DISPLAY_KEYBOARD, display_pin, name); + g_signal_connect (G_OBJECT (priv->pairing_dialog), "response", + G_CALLBACK (display_passkey_or_pincode_cb), user_data); + g_object_set_data_full (G_OBJECT (priv->pairing_dialog), + "path", g_strdup (g_dbus_proxy_get_object_path (device)), + g_free); gtk_widget_show (priv->pairing_dialog); g_dbus_method_invocation_return_value (invocation, NULL); - -bail: - g_free (db_pin); - g_free (display_pin); - g_free (bdaddr); - g_free (name); } static void @@ -683,7 +713,8 @@ { BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); - char *name, *pin_str; + g_autofree char *name = NULL; + g_autofree char *pin_str = NULL; g_debug ("confirm_callback (%s, %i)", g_dbus_proxy_get_object_path (device), pin); @@ -700,9 +731,6 @@ g_object_set_data (G_OBJECT (priv->pairing_dialog), "invocation", invocation); gtk_widget_show (priv->pairing_dialog); - - g_free (pin_str); - g_free (name); } static void @@ -712,7 +740,7 @@ { BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); - char *name; + g_autofree char *name = NULL; g_debug ("authorize_callback (%s)", g_dbus_proxy_get_object_path (device)); @@ -727,8 +755,6 @@ g_object_set_data (G_OBJECT (priv->pairing_dialog), "invocation", invocation); gtk_widget_show (priv->pairing_dialog); - - g_free (name); } static void @@ -748,11 +774,10 @@ bluetooth_client_set_trusted (priv->client, g_dbus_proxy_get_object_path (device), TRUE); g_dbus_method_invocation_return_value (invocation, NULL); } else { - char *msg; + g_autofree char *msg = NULL; msg = g_strdup_printf ("Rejecting service auth (HID): not paired or trusted"); g_dbus_method_invocation_return_dbus_error (invocation, "org.bluez.Error.Rejected", msg); - g_free (msg); } g_clear_pointer (&priv->pairing_dialog, gtk_widget_destroy); } @@ -765,7 +790,6 @@ { BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); - char *msg; GVariant *value; gboolean paired, trusted; @@ -789,10 +813,10 @@ } if (g_strcmp0 (bluetooth_uuid_to_string (uuid), "HumanInterfaceDeviceService") != 0) { + g_autofree char *msg = NULL; msg = g_strdup_printf ("Rejecting service auth (%s) for %s: not HID", uuid, g_dbus_proxy_get_object_path (device)); g_dbus_method_invocation_return_dbus_error (invocation, "org.bluez.Error.Rejected", msg); - g_free (msg); return; } @@ -800,7 +824,7 @@ if (paired || trusted) { g_dbus_method_invocation_return_value (invocation, NULL); } else { - char *name; + g_autofree char *name = NULL; setup_pairing_dialog (BLUETOOTH_SETTINGS_WIDGET (user_data)); get_properties_for_device (self, device, &name, NULL, NULL); @@ -814,8 +838,6 @@ g_object_set_data (G_OBJECT (priv->pairing_dialog), "invocation", invocation); gtk_widget_show (priv->pairing_dialog); - - g_free (name); } } @@ -858,7 +880,7 @@ SetupConnectData *data = (SetupConnectData *) user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (data->self); - bluetooth_client_connect_service (priv->client, data->device, TRUE, NULL, connect_callback, data); + bluetooth_client_connect_service (priv->client, data->device, TRUE, priv->cancellable, connect_callback, data); data->timeout_id = 0; return G_SOURCE_REMOVE; @@ -871,22 +893,20 @@ { SetupConnectData *data = (SetupConnectData *) user_data; BluetoothSettingsWidgetPrivate *priv; - GError *error = NULL; + g_autoptr(GError) error = NULL; gboolean success; success = bluetooth_client_connect_service_finish (BLUETOOTH_CLIENT (source_object), res, &error); if (success == FALSE) { if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free (error); goto bail; } else if (g_timer_elapsed (data->timer, NULL) < CONNECT_TIMEOUT) { g_assert (data->timeout_id == 0); data->timeout_id = g_timeout_add (500, connect_timeout_cb, data); - g_error_free (error); return; } - g_debug ("Failed to connect to device %s", data->device); + g_debug ("Failed to connect to device %s: %s", data->device, error->message); } turn_off_pairing (data->self, data->device); @@ -913,9 +933,9 @@ BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self); SetupConnectData *data; - GError *error = NULL; + g_autoptr(GError) error = NULL; gboolean ret; - char *path; + g_autofree char *path = NULL; ret = bluetooth_client_setup_device_finish (BLUETOOTH_CLIENT (source_object), res, &path, &error); @@ -923,13 +943,10 @@ /* Create failed */ if (ret == FALSE) { //char *text; - char *dbus_error; + g_autofree char *dbus_error = NULL; - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free (error); - g_free (path); + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; - } priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); @@ -956,10 +973,6 @@ //g_free (text); } - g_free (dbus_error); - g_error_free (error); - g_free (path); - g_object_set (G_OBJECT (priv->client), "default-adapter-discovering", has_default_adapter (self), NULL); @@ -976,11 +989,11 @@ data = g_new0 (SetupConnectData, 1); data->self = user_data; - data->device = path; + data->device = g_steal_pointer (&path); data->timer = g_timer_new (); bluetooth_client_connect_service (BLUETOOTH_CLIENT (source_object), - path, TRUE, priv->cancellable, connect_callback, data); + data->device, TRUE, priv->cancellable, connect_callback, data); //gtk_assistant_set_current_page (window_assistant, PAGE_FINISHING); } @@ -992,7 +1005,7 @@ GParamSpec *pspec, gpointer user_data) { - char *name; + g_autofree char *name = NULL; g_object_get (G_OBJECT (gobject), "name", &name, @@ -1002,7 +1015,6 @@ g_debug ("Pairing device name is now '%s'", name); start_pairing (user_data, GTK_LIST_BOX_ROW (gobject)); - g_free (name); g_signal_handlers_disconnect_by_func (gobject, device_name_appeared, user_data); } @@ -1012,10 +1024,11 @@ GtkListBoxRow *row) { BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self); - GDBusProxy *proxy; + g_autoptr(GDBusProxy) proxy = NULL; gboolean pair = TRUE; BluetoothType type; - char *bdaddr, *name; + g_autofree char *bdaddr = NULL; + g_autofree char *name = NULL; gboolean legacy_pairing; const char *pincode; @@ -1032,9 +1045,6 @@ g_debug ("No name yet, will start pairing later"); g_signal_connect (G_OBJECT (row), "notify::name", G_CALLBACK (device_name_appeared), self); - g_object_unref (proxy); - g_free (bdaddr); - g_free (name); return; } @@ -1065,7 +1075,6 @@ priv->cancellable, (GAsyncReadyCallback) create_callback, self); - g_object_unref (proxy); } static gboolean @@ -1114,7 +1123,7 @@ gboolean ret; BluetoothType type; gboolean connected, paired; - char **uuids, *bdaddr, *name, *icon; + char **uuids, *bdaddr, *alias, *icon; guint i; model = bluetooth_client_get_device_model (priv->client); @@ -1144,7 +1153,7 @@ gtk_tree_model_get (model, &iter, BLUETOOTH_COLUMN_ADDRESS, &bdaddr, - BLUETOOTH_COLUMN_NAME, &name, + BLUETOOTH_COLUMN_ALIAS, &alias, BLUETOOTH_COLUMN_ICON, &icon, BLUETOOTH_COLUMN_PAIRED, &paired, BLUETOOTH_COLUMN_CONNECTED, &connected, @@ -1165,9 +1174,9 @@ gtk_widget_hide (WID ("send_button")); /* Name */ - gtk_window_set_title (GTK_WINDOW (priv->properties_dialog), name); + gtk_window_set_title (GTK_WINDOW (priv->properties_dialog), alias); g_free (priv->selected_name); - priv->selected_name = name; + priv->selected_name = alias; /* Icon */ gtk_image_set_from_icon_name (GTK_IMAGE (WID ("image")), icon, GTK_ICON_SIZE_DIALOG); @@ -1271,24 +1280,22 @@ update_visibility (BluetoothSettingsWidget *self) { BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self); - char *name; + g_autofree char *name = NULL; g_object_get (G_OBJECT (priv->client), "default-adapter-name", &name, NULL); if (name != NULL) { - char *label, *path, *uri; + g_autofree char *label = NULL; + g_autofree char *path = NULL; + g_autofree char *uri = NULL; path = lookup_download_dir (); uri = g_filename_to_uri (path, NULL, NULL); - g_free (path); /* translators: first %s is the name of the computer, for example: * Visible as “Bastien Nocera’s Computer” followed by the * location of the Downloads folder.*/ label = g_strdup_printf (_("Visible as “%s” and available for Bluetooth file transfers. Transferred files are placed in the Downloads folder."), name, uri); - g_free (uri); - g_free (name); gtk_label_set_markup (GTK_LABEL (priv->visible_label), label); - g_free (label); } gtk_widget_set_visible (priv->visible_label, name != NULL); } @@ -1334,7 +1341,7 @@ { BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self); GDBusProxy *adapter_proxy; - GError *error = NULL; + g_autoptr(GError) error = NULL; GVariant *ret; g_debug ("About to call RemoveDevice for %s", priv->selected_object_path); @@ -1358,7 +1365,6 @@ if (ret == NULL) { g_warning ("Failed to remove device '%s': %s", priv->selected_object_path, error->message); - g_error_free (error); } else { g_variant_unref (ret); } @@ -1406,20 +1412,19 @@ gboolean paired_a, paired_b; gboolean trusted_a, trusted_b; gboolean connected_a, connected_b; - char *name_a, *name_b; - int ret; + gint64 time_a, time_b; g_object_get (row_a, "paired", &paired_a, "trusted", &trusted_a, "connected", &connected_a, - "name", &name_a, + "time-created", &time_a, NULL); g_object_get (row_b, "paired", &paired_b, "trusted", &trusted_b, "connected", &connected_b, - "name", &name_b, + "time-created", &time_b, NULL); /* First, paired or trusted devices (setup devices) */ @@ -1427,37 +1432,21 @@ setup_b = paired_b || trusted_b; if (setup_a != setup_b) { if (setup_a) - ret = -1; + return -1; else - ret = 1; - goto out; + return 1; } /* Then connected ones */ if (connected_a != connected_b) { if (connected_a) - ret = -1; + return -1; else - ret = 1; - goto out; - } - - if (name_a == NULL) { - ret = 1; - goto out; - } - if (name_b == NULL) { - ret = -1; - goto out; + return 1; } - /* And all being equal, alphabetically */ - ret = g_utf8_collate (name_a, name_b); - -out: - g_free (name_a); - g_free (name_b); - return ret; + /* And all being equal, oldest ones first */ + return (time_a > time_b) ? 1 : -1; } static void @@ -1557,7 +1546,10 @@ priv->device_label = gtk_label_new (s); g_free (s); gtk_label_set_use_markup (GTK_LABEL (priv->device_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->device_label), 0, 0.5); + g_object_set (G_OBJECT (priv->device_label), + "xalign", 0.0, + "yalign", 0.5, + NULL); gtk_widget_set_margin_end (priv->device_label, 6); gtk_widget_set_margin_bottom (priv->device_label, 12); gtk_box_pack_start (GTK_BOX (hbox), priv->device_label, FALSE, TRUE, 0); @@ -1635,8 +1627,10 @@ { BluetoothSettingsWidget *self = user_data; BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (user_data); - GDBusProxy *proxy; - char *name, *bdaddr; + g_autoptr(GDBusProxy) proxy = NULL; + g_autofree char *name = NULL; + g_autofree char *bdaddr = NULL; + g_autofree char *alias = NULL; BluetoothType type; gboolean paired, trusted, connected, legacy_pairing; GtkWidget *row; @@ -1646,13 +1640,13 @@ BLUETOOTH_COLUMN_NAME, &name, -1); g_debug ("Not adding device '%s'", name); - g_free (name); return; } gtk_tree_model_get (tree_model, iter, BLUETOOTH_COLUMN_PROXY, &proxy, BLUETOOTH_COLUMN_NAME, &name, + BLUETOOTH_COLUMN_ALIAS, &alias, BLUETOOTH_COLUMN_PAIRED, &paired, BLUETOOTH_COLUMN_TRUSTED, &trusted, BLUETOOTH_COLUMN_CONNECTED, &connected, @@ -1672,18 +1666,16 @@ "type", type, "connected", connected, "name", name, + "alias", alias, "address", bdaddr, "legacy-pairing", legacy_pairing, + "visible", name != NULL, NULL); g_object_set_data_full (G_OBJECT (row), "object-path", g_strdup (g_dbus_proxy_get_object_path (proxy)), g_free); gtk_container_add (GTK_CONTAINER (priv->device_list), row); gtk_size_group_add_widget (priv->row_sizegroup, row); - g_object_unref (proxy); - g_free (name); - g_free (bdaddr); - gtk_stack_set_transition_type (GTK_STACK (priv->device_stack), GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN); gtk_container_child_set (GTK_CONTAINER (WID ("vbox_bluetooth")), @@ -1726,12 +1718,14 @@ path = g_object_get_data (G_OBJECT (l->data), "object-path"); if (g_str_equal (object_path, path)) { g_autofree char *name = NULL; + g_autofree char *alias = NULL; g_autofree char *bdaddr = NULL; BluetoothType type; gboolean paired, trusted, connected, legacy_pairing; gtk_tree_model_get (tree_model, iter, BLUETOOTH_COLUMN_NAME, &name, + BLUETOOTH_COLUMN_ALIAS, &alias, BLUETOOTH_COLUMN_PAIRED, &paired, BLUETOOTH_COLUMN_TRUSTED, &trusted, BLUETOOTH_COLUMN_CONNECTED, &connected, @@ -1748,7 +1742,9 @@ "type", type, "connected", connected, "name", name, + "alias", alias, "legacy-pairing", legacy_pairing, + "visible", name != NULL, NULL); /* Update the properties if necessary */ @@ -1776,11 +1772,10 @@ path = g_object_get_data (G_OBJECT (l->data), "object-path"); if (g_str_equal (path, object_path)) { - char *name; + g_autofree char *name = NULL; g_object_get (G_OBJECT (l->data), "name", &name, NULL); - g_debug ("Removing device '%s'", name); - g_free (name); + g_debug ("Removing device '%s'", name ? name : object_path); gtk_widget_destroy (GTK_WIDGET (l->data)); found = TRUE; @@ -1849,7 +1844,7 @@ 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); @@ -1900,7 +1895,7 @@ setup_obex (BluetoothSettingsWidget *self) { BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self); - GError *error = NULL; + g_autoptr(GError) error = NULL; priv->session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, @@ -1913,7 +1908,6 @@ if (priv->session_proxy == NULL) { g_warning ("Failed to get session proxy: %s", error->message); - g_error_free (error); return; } g_signal_connect (priv->session_proxy, "g-properties-changed", @@ -1929,7 +1923,7 @@ { BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self); GtkWidget *widget; - GError *error = NULL; + g_autoptr(GError) error = NULL; /* This ensures the BluetoothHdyColumn type is known by GtkBuilder when * loading the UI template. @@ -1947,7 +1941,6 @@ &error); if (error != NULL) { g_warning ("Could not load ui: %s", error->message); - g_error_free (error); return; } diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-settings-widget.h gnome-bluetooth-3.34.5/lib/bluetooth-settings-widget.h --- gnome-bluetooth-3.34.3/lib/bluetooth-settings-widget.h 2020-10-01 09:19:42.305874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-settings-widget.h 2021-03-23 15:09:30.418372200 +0000 @@ -18,13 +18,10 @@ * */ -#ifndef __BLUETOOTH_SETTINGS_WIDGET_H -#define __BLUETOOTH_SETTINGS_WIDGET_H +#pragma once #include -G_BEGIN_DECLS - #define BLUETOOTH_TYPE_SETTINGS_WIDGET (bluetooth_settings_widget_get_type()) #define BLUETOOTH_SETTINGS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ BLUETOOTH_TYPE_SETTINGS_WIDGET, BluetoothSettingsWidget)) @@ -59,7 +56,3 @@ GtkWidget *bluetooth_settings_widget_new (void); gboolean bluetooth_settings_widget_get_default_adapter_powered (BluetoothSettingsWidget *widget); - -G_END_DECLS - -#endif /* __BLUETOOTH_SETTINGS_WIDGET_H */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-utils.c gnome-bluetooth-3.34.5/lib/bluetooth-utils.c --- gnome-bluetooth-3.34.3/lib/bluetooth-utils.c 2020-10-01 09:19:42.307874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-utils.c 2021-03-23 15:09:30.418372200 +0000 @@ -185,6 +185,8 @@ case 0x01: case 0x02: return BLUETOOTH_TYPE_HEADSET; + case 0x05: + return BLUETOOTH_TYPE_SPEAKERS; case 0x06: return BLUETOOTH_TYPE_HEADPHONES; case 0x0b: /* VCR */ diff -Nru gnome-bluetooth-3.34.3/lib/bluetooth-utils.h gnome-bluetooth-3.34.5/lib/bluetooth-utils.h --- gnome-bluetooth-3.34.3/lib/bluetooth-utils.h 2020-10-01 09:19:42.307874000 +0000 +++ gnome-bluetooth-3.34.5/lib/bluetooth-utils.h 2021-03-23 15:09:30.418372200 +0000 @@ -22,14 +22,11 @@ * */ -#ifndef __BLUETOOTH_UTILS_H -#define __BLUETOOTH_UTILS_H +#pragma once #include #include -G_BEGIN_DECLS - /* * The profile UUID list is provided by the Bluetooth SIG: * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery @@ -69,7 +66,3 @@ void bluetooth_send_to_address (const char *address, const char *alias); - -G_END_DECLS - -#endif /* __BLUETOOTH_UTILS_H */ diff -Nru gnome-bluetooth-3.34.3/lib/gnome-bluetooth-enum-types.h.template gnome-bluetooth-3.34.5/lib/gnome-bluetooth-enum-types.h.template --- gnome-bluetooth-3.34.3/lib/gnome-bluetooth-enum-types.h.template 2020-10-01 09:19:42.308874100 +0000 +++ gnome-bluetooth-3.34.5/lib/gnome-bluetooth-enum-types.h.template 2021-03-23 15:09:30.419372300 +0000 @@ -1,12 +1,8 @@ /*** BEGIN file-header ***/ -#ifndef __GNOME_BLUETOOTH_ENUM_TYPES_H__ -#define __GNOME_BLUETOOTH_ENUM_TYPES_H__ - +#pragma once #include -G_BEGIN_DECLS - /*** END file-header ***/ /*** BEGIN file-production ***/ @@ -19,10 +15,3 @@ GType @enum_name@_get_type (void) G_GNUC_CONST; /*** END enumeration-production ***/ - -/*** BEGIN file-tail ***/ -G_END_DECLS - -#endif /* __GNOME_BLUETOOTH_ENUM_TYPES_H__ */ -/*** END file-tail ***/ - diff -Nru gnome-bluetooth-3.34.3/lib/gnome-bluetooth.map gnome-bluetooth-3.34.5/lib/gnome-bluetooth.map --- gnome-bluetooth-3.34.3/lib/gnome-bluetooth.map 2020-10-01 09:19:42.308874100 +0000 +++ gnome-bluetooth-3.34.5/lib/gnome-bluetooth.map 2021-03-23 15:09:30.419372300 +0000 @@ -20,6 +20,8 @@ bluetooth_chooser_button_available; bluetooth_client_setup_device; bluetooth_client_setup_device_finish; + bluetooth_client_cancel_setup_device; + bluetooth_client_cancel_setup_device_finish; bluetooth_client_dump_device; bluetooth_client_get_type; bluetooth_client_new; @@ -47,6 +49,8 @@ bluetooth_filter_widget_bind_filter; bluetooth_chooser_combo_get_type; bluetooth_chooser_combo_new; + bluetooth_agent_get_type; + bluetooth_agent_error_get_type; bluetooth_agent_new; bluetooth_agent_set_pincode_func; bluetooth_agent_register; @@ -56,10 +60,9 @@ 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_agent_setup; bluetooth_settings_widget_get_type; bluetooth_settings_widget_new; bluetooth_settings_widget_get_default_adapter_powered; diff -Nru gnome-bluetooth-3.34.3/lib/gnome-bluetooth.symbols gnome-bluetooth-3.34.5/lib/gnome-bluetooth.symbols --- gnome-bluetooth-3.34.3/lib/gnome-bluetooth.symbols 2020-10-01 09:19:42.308874100 +0000 +++ gnome-bluetooth-3.34.5/lib/gnome-bluetooth.symbols 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -bluetooth_chooser_dump_selected_device -bluetooth_chooser_get_type -bluetooth_chooser_new -bluetooth_chooser_set_title -bluetooth_chooser_get_selected_device -bluetooth_chooser_get_selected_device_info -bluetooth_chooser_get_selected_device_name -bluetooth_chooser_get_selected_device_icon -bluetooth_chooser_get_selected_device_type -bluetooth_chooser_get_selected_device_is_connected -bluetooth_chooser_get_model -bluetooth_chooser_get_treeview -bluetooth_chooser_get_scrolled_window -bluetooth_chooser_start_discovery -bluetooth_chooser_stop_discovery -bluetooth_chooser_button_get_type -bluetooth_chooser_button_new -bluetooth_chooser_button_available -bluetooth_client_setup_device -bluetooth_client_setup_device_finish -bluetooth_client_dump_device -bluetooth_client_get_type -bluetooth_client_new -bluetooth_client_get_model -bluetooth_client_get_filter_model -bluetooth_client_get_adapter_model -bluetooth_client_get_device_model -bluetooth_client_connect_service -bluetooth_client_connect_service_finish -bluetooth_client_set_trusted -bluetooth_client_get_device -bluetooth_appearance_to_type -bluetooth_class_to_type -bluetooth_type_to_string -bluetooth_type_to_filter_string -bluetooth_verify_address -bluetooth_uuid_to_string -bluetooth_send_to_address -bluetooth_column_get_type -bluetooth_category_get_type -bluetooth_type_get_type -bluetooth_status_get_type -bluetooth_filter_widget_new -bluetooth_filter_widget_set_title -bluetooth_filter_widget_get_type -bluetooth_filter_widget_bind_filter -bluetooth_chooser_combo_get_type -bluetooth_chooser_combo_new -bluetooth_agent_new -bluetooth_agent_set_pincode_func -bluetooth_agent_register -bluetooth_agent_unregister -bluetooth_agent_set_confirm_func -bluetooth_agent_set_passkey_func -bluetooth_agent_set_cancel_func -bluetooth_agent_error_quark -bluetooth_agent_set_authorize_func -bluetooth_agent_set_display_func -bluetooth_agent_set_display_pincode_func -bluetooth_agent_set_authorize_service_func -bluetooth_agent_setup -bluetooth_settings_widget_get_type -bluetooth_settings_widget_new -bluetooth_settings_widget_get_default_adapter_powered -bluetooth_pairing_dialog_new -bluetooth_pairing_dialog_get_type -bluetooth_pairing_dialog_set_mode -bluetooth_pairing_dialog_get_mode -bluetooth_pairing_dialog_set_pin_entered diff -Nru gnome-bluetooth-3.34.3/lib/meson.build gnome-bluetooth-3.34.5/lib/meson.build --- gnome-bluetooth-3.34.3/lib/meson.build 2020-10-01 09:19:42.310874000 +0000 +++ gnome-bluetooth-3.34.5/lib/meson.build 2021-03-23 15:09:30.419372300 +0000 @@ -136,6 +136,21 @@ includes: gir_incs, install: true, ) + + gnomebt_priv_gir = gnome.generate_gir( + libgnome_bluetooth, + sources: gir_sources + [ + 'bluetooth-client-private.h', + 'bluetooth-agent.h', + ], + nsversion: gnomebt_api_version, + namespace: 'GnomeBluetoothPriv', + symbol_prefix: 'bluetooth', + identifier_prefix: 'Bluetooth', + export_packages: gnomebt_api_name, + includes: gir_incs, + install: false, + ) endif test_names = [ diff -Nru gnome-bluetooth-3.34.3/lib/pin-code-database.xml gnome-bluetooth-3.34.5/lib/pin-code-database.xml --- gnome-bluetooth-3.34.3/lib/pin-code-database.xml 2020-10-01 09:19:42.310874000 +0000 +++ gnome-bluetooth-3.34.5/lib/pin-code-database.xml 2021-03-23 15:09:30.419372300 +0000 @@ -148,9 +148,6 @@ - - - diff -Nru gnome-bluetooth-3.34.3/lib/pin.h gnome-bluetooth-3.34.5/lib/pin.h --- gnome-bluetooth-3.34.3/lib/pin.h 2020-10-01 09:19:42.312874000 +0000 +++ gnome-bluetooth-3.34.5/lib/pin.h 2021-03-23 15:09:30.419372300 +0000 @@ -21,6 +21,8 @@ * */ +#pragma once + #include #define PIN_NUM_DIGITS 6 diff -Nru gnome-bluetooth-3.34.3/lib/settings.ui gnome-bluetooth-3.34.5/lib/settings.ui --- gnome-bluetooth-3.34.3/lib/settings.ui 2020-10-01 09:19:42.312874000 +0000 +++ gnome-bluetooth-3.34.5/lib/settings.ui 2021-03-23 15:09:30.419372300 +0000 @@ -400,8 +400,9 @@ start Visible as “Bastien's computer” and available for Bluetooth file transfers. Transferred files are placed in the <a href="http://www.gnome.org">Downloads</a> folder. True - fill True + 0 + 0 False diff -Nru gnome-bluetooth-3.34.3/lib/test-client.c gnome-bluetooth-3.34.5/lib/test-client.c --- gnome-bluetooth-3.34.3/lib/test-client.c 2020-10-01 09:19:42.313874000 +0000 +++ gnome-bluetooth-3.34.5/lib/test-client.c 2021-03-23 15:09:30.419372300 +0000 @@ -176,7 +176,6 @@ tree = gtk_tree_view_new(); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), TRUE); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree), TRUE); gtk_widget_grab_focus(GTK_WIDGET(tree)); gtk_container_add(GTK_CONTAINER(scrolled), tree); diff -Nru gnome-bluetooth-3.34.3/meson.build gnome-bluetooth-3.34.5/meson.build --- gnome-bluetooth-3.34.3/meson.build 2020-10-01 09:19:42.316874000 +0000 +++ gnome-bluetooth-3.34.5/meson.build 2021-03-23 15:09:30.419372300 +0000 @@ -1,6 +1,6 @@ project( 'gnome-bluetooth', 'c', - version: '3.34.3', + version: '3.34.5', license: 'GPL2+', default_options: 'buildtype=debugoptimized', meson_version: '>= 0.49.0', @@ -36,11 +36,12 @@ # - If binary compatibility has been broken (eg removed or changed interfaces) # change to C+1:0:0 # - If the interface is the same as the previous version, change to C:R+1:A -current = 13 -revision = 2 -age = 0 +current = 14 +revision = 0 +age = 1 -libversion = '@0@.@1@.@2@'.format(current, age, revision) +lt_soversion = current - age +libversion = '@0@.@1@.@2@'.format(lt_soversion, age, revision) gnome = import('gnome') i18n = import('i18n') @@ -96,7 +97,7 @@ add_project_arguments(common_flags + compiler_flags, language: 'c') -gio_dep = dependency('gio-2.0') +gio_dep = dependency('gio-2.0', version: '>= 2.44') gio_unix_dep = dependency('gio-unix-2.0') gtk_dep = dependency('gtk+-3.0', version: '>= 3.12.0') libcanberra_gtk_dep = dependency('libcanberra-gtk3') @@ -115,6 +116,10 @@ subdir('po') +if enable_gir + subdir('tests') +endif + configure_file( output: 'config.h', configuration: config_h, diff -Nru gnome-bluetooth-3.34.3/NEWS gnome-bluetooth-3.34.5/NEWS --- gnome-bluetooth-3.34.3/NEWS 2020-10-01 09:19:42.270874300 +0000 +++ gnome-bluetooth-3.34.5/NEWS 2021-03-23 15:09:30.414372200 +0000 @@ -1,3 +1,19 @@ +ver 3.34.5: +- Fix unwanted soname change +- Note that an unreleased version of python-dbusmock is required + to run the test suite added in 3.34.4, disable tests if this + dependency is unavailable. + +ver 3.34.4: +- Use device alias instead of device name in Settings UI, and + don't show devices without a name +- Avoid new devices jumping around in the Settings list +- Fix a warning and a hang when opening the Bluetooth Settings +- Fix a possible hang when switching away from the Bluetooth Settings +- Make the "Cancel" button work when pairing keyboards +- Remove joypad quirks in favour of BlueZ autopair ones +- Remove a number of deprecated calls + ver 3.34.3: - Fix problem with intermittent connection work-around when using the switch in the device properties diff -Nru gnome-bluetooth-3.34.3/po/fur.po gnome-bluetooth-3.34.5/po/fur.po --- gnome-bluetooth-3.34.3/po/fur.po 2020-10-01 09:19:42.357873700 +0000 +++ gnome-bluetooth-3.34.5/po/fur.po 2021-03-23 15:09:30.423372300 +0000 @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: gnome-bluetooth master\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/issues\n" -"POT-Creation-Date: 2019-07-18 13:00+0000\n" -"PO-Revision-Date: 2019-07-28 09:42+0200\n" +"POT-Creation-Date: 2020-06-25 07:23+0000\n" +"PO-Revision-Date: 2021-01-17 16:02+0100\n" "Last-Translator: Fabio Tomat \n" "Language-Team: Friulian \n" "Language: fur\n" @@ -16,7 +16,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.3\n" +"X-Generator: Poedit 2.4.2\n" #: lib/bluetooth-chooser-button.c:71 msgid "Click to select device…" @@ -194,12 +194,12 @@ msgstr "Declinâ" #. Cancel button -#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:308 +#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:306 msgid "Cancel" msgstr "Anule" #. OK button -#: lib/bluetooth-pairing-dialog.c:289 lib/bluetooth-settings-obexpush.c:247 +#: lib/bluetooth-pairing-dialog.c:287 lib/bluetooth-settings-obexpush.c:247 msgid "Accept" msgstr "Acetâ" @@ -341,7 +341,7 @@ #: lib/bluetooth-utils.c:88 msgid "Remote control" -msgstr "Control rimot" +msgstr "Control di lontan" #: lib/bluetooth-utils.c:90 msgid "Scanner" @@ -408,8 +408,8 @@ "Make sure that the remote device is switched on and that it accepts " "Bluetooth connections" msgstr "" -"Sigurâsi che il dispositîf rimot al sedi piât e che al aceti lis conessions " -"Bluetooth" +"Sigurâsi che il dispositîf esterni al sedi piât e che al aceti lis " +"conessions Bluetooth" #: sendto/main.c:363 #, c-format @@ -512,7 +512,7 @@ #: sendto/main.c:825 msgid "Remote device to use" -msgstr "Dispositîf rimot di doprâ" +msgstr "Dispositîf esterni di doprâ" #: sendto/main.c:825 msgid "ADDRESS" @@ -520,7 +520,7 @@ #: sendto/main.c:827 msgid "Remote device’s name" -msgstr "Non dal dispositîf rimot" +msgstr "Non dal dispositîf esterni" #: sendto/main.c:827 msgid "NAME" diff -Nru gnome-bluetooth-3.34.3/po/gl.po gnome-bluetooth-3.34.5/po/gl.po --- gnome-bluetooth-3.34.3/po/gl.po 2020-10-01 09:19:42.362873600 +0000 +++ gnome-bluetooth-3.34.5/po/gl.po 2021-03-23 15:09:30.424372200 +0000 @@ -6,13 +6,13 @@ # Antón Méixome , 2010. # Fran Diéguez , 2009, 2010, 2011, 2012. # Leandro Regueiro , 2012. -# Fran Dieguez , 2013, 2014, 2015, 2017. +# Fran Dieguez , 2013, 2014, 2015, 2017, 2021. msgid "" msgstr "" "Project-Id-Version: gnome-bluetooth-master-po-gl-18070.merged\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/issues\n" -"POT-Creation-Date: 2019-10-08 11:24+0000\n" -"PO-Revision-Date: 2019-12-27 13:53+0100\n" +"POT-Creation-Date: 2020-06-25 07:23+0000\n" +"PO-Revision-Date: 2021-02-24 13:13+0100\n" "Last-Translator: Fran Diéguez \n" "Language-Team: Galician\n" "Language: gl\n" @@ -20,7 +20,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.4\n" +"X-Generator: Lokalize 20.12.2\n" "X-Project-Style: gnome\n" #: lib/bluetooth-chooser-button.c:71 @@ -196,12 +196,12 @@ msgstr "Rexeitar" #. Cancel button -#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:308 +#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:306 msgid "Cancel" msgstr "Cancelar" #. OK button -#: lib/bluetooth-pairing-dialog.c:289 lib/bluetooth-settings-obexpush.c:247 +#: lib/bluetooth-pairing-dialog.c:287 lib/bluetooth-settings-obexpush.c:247 msgid "Accept" msgstr "Aceptar" @@ -348,7 +348,7 @@ #: lib/bluetooth-utils.c:90 msgid "Scanner" -msgstr "Escaner" +msgstr "Escáner" #: lib/bluetooth-utils.c:92 msgid "Display" diff -Nru gnome-bluetooth-3.34.3/po/nb.po gnome-bluetooth-3.34.5/po/nb.po --- gnome-bluetooth-3.34.3/po/nb.po 2020-10-01 09:19:42.388873300 +0000 +++ gnome-bluetooth-3.34.5/po/nb.po 2021-03-23 15:09:30.427372200 +0000 @@ -1,14 +1,14 @@ # Norwegian bokmål translation for gnome-bluetooth # Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007 # This file is distributed under the same license as the bluez-gnome package. -# Kjartan Maraas , 2007-2017. +# Kjartan Maraas , 2007-2020. # msgid "" msgstr "" -"Project-Id-Version: gnome-bluetooth 3.26.x\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-bluetooth&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2017-08-13 21:07+0000\n" -"PO-Revision-Date: 2017-11-06 15:17+0100\n" +"Project-Id-Version: gnome-bluetooth 3.38.x\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/issues\n" +"POT-Creation-Date: 2020-06-25 07:23+0000\n" +"PO-Revision-Date: 2020-12-04 16:18+0100\n" "Last-Translator: Kjartan Maraas \n" "Language-Team: Norwegian bokmål \n" "Language: nb\n" @@ -21,7 +21,7 @@ msgid "Click to select device…" msgstr "Klikk for å velge enhet …" -#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1275 +#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1281 #: sendto/main.c:447 sendto/main.c:738 sendto/main.c:794 msgid "_Cancel" msgstr "A_vbryt" @@ -40,7 +40,7 @@ msgstr "Ingen enheter tilgjengelig" #: lib/bluetooth-chooser.c:180 lib/bluetooth-chooser.c:806 -#: lib/bluetooth-settings-widget.c:1564 +#: lib/bluetooth-settings-widget.c:1561 msgid "Searching for devices…" msgstr "Søker etter enheter …" @@ -48,11 +48,11 @@ msgid "Device" msgstr "Enhet" -#: lib/bluetooth-chooser.c:734 lib/settings.ui:179 +#: lib/bluetooth-chooser.c:734 lib/settings.ui:182 msgid "Type" msgstr "Type" -#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1526 +#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1518 msgid "Devices" msgstr "Enheter" @@ -60,7 +60,7 @@ msgid "All categories" msgstr "Alle kategorier" -#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:134 +#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:135 msgid "Paired" msgstr "Koblet sammen" @@ -191,16 +191,16 @@ msgstr "Avvis" #. Cancel button -#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:308 +#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:306 msgid "Cancel" msgstr "Avbryt" #. OK button -#: lib/bluetooth-pairing-dialog.c:289 lib/bluetooth-settings-obexpush.c:246 +#: lib/bluetooth-pairing-dialog.c:287 lib/bluetooth-settings-obexpush.c:247 msgid "Accept" msgstr "Godta" -#: lib/bluetooth-settings-row.c:79 lib/bluetooth-settings-row.ui:37 +#: lib/bluetooth-settings-row.c:79 lib/bluetooth-settings-row.ui:40 msgid "Not Set Up" msgstr "Ikke satt opp" @@ -212,18 +212,18 @@ msgid "Disconnected" msgstr "Koblet fra" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1149 msgid "Yes" msgstr "Ja" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1149 msgid "No" msgstr "Nei" #. translators: first %s is the name of the computer, for example: #. * Visible as “Bastien Nocera’s Computer” followed by the #. * location of the Downloads folder. -#: lib/bluetooth-settings-widget.c:1243 +#: lib/bluetooth-settings-widget.c:1249 #, c-format msgid "" "Visible as “%s” and available for Bluetooth file transfers. Transferred " @@ -232,50 +232,50 @@ "Synlig som «%s» og tilgjengelig for filoverføringer via Bluetooth. Overførte " "filer plasseres i mappen Nedlastinger." -#: lib/bluetooth-settings-widget.c:1270 +#: lib/bluetooth-settings-widget.c:1276 #, c-format msgid "Remove “%s” from the list of devices?" msgstr "Fjern «%s» fra enhetslisten?" -#: lib/bluetooth-settings-widget.c:1272 +#: lib/bluetooth-settings-widget.c:1278 msgid "" "If you remove the device, you will have to set it up again before next use." msgstr "" "Hvis du fjerner enheten vil du måtte konfigurere den igjen før du bruker den " "på nytt." -#: lib/bluetooth-settings-widget.c:1276 +#: lib/bluetooth-settings-widget.c:1282 msgid "_Remove" msgstr "Fje_rn" #. Translators: %s is the name of the filename received -#: lib/bluetooth-settings-obexpush.c:145 +#: lib/bluetooth-settings-obexpush.c:146 #, c-format msgid "You received “%s” via Bluetooth" msgstr "Du mottok «%s» via Bluetooth" -#: lib/bluetooth-settings-obexpush.c:147 +#: lib/bluetooth-settings-obexpush.c:148 msgid "You received a file" msgstr "Du mottok en fil" -#: lib/bluetooth-settings-obexpush.c:158 +#: lib/bluetooth-settings-obexpush.c:159 msgid "Open File" msgstr "Åpne fil" -#: lib/bluetooth-settings-obexpush.c:162 -msgid "Reveal File" -msgstr "Vis vil" +#: lib/bluetooth-settings-obexpush.c:163 +msgid "Open Containing Folder" +msgstr "Åpne innholdsmappe" -#: lib/bluetooth-settings-obexpush.c:179 +#: lib/bluetooth-settings-obexpush.c:180 msgid "File reception complete" msgstr "Mottak av fil fullført" -#: lib/bluetooth-settings-obexpush.c:233 +#: lib/bluetooth-settings-obexpush.c:234 #, c-format msgid "Bluetooth file transfer from %s" msgstr "Bluetooth-filoverføring fra %s" -#: lib/bluetooth-settings-obexpush.c:243 +#: lib/bluetooth-settings-obexpush.c:244 msgid "Decline" msgstr "Avslå" @@ -364,27 +364,27 @@ msgid "Connection" msgstr "Tilkobling" -#: lib/settings.ui:224 +#: lib/settings.ui:229 msgid "Address" msgstr "Adresse" -#: lib/settings.ui:279 +#: lib/settings.ui:285 msgid "_Mouse & Touchpad Settings" msgstr "Innstillinger for _mus og pekeplate" -#: lib/settings.ui:293 +#: lib/settings.ui:299 msgid "_Sound Settings" msgstr "Innstillinger for _lyd" -#: lib/settings.ui:307 +#: lib/settings.ui:313 msgid "_Keyboard Settings" msgstr "Innstillinger for _tastatur" -#: lib/settings.ui:321 +#: lib/settings.ui:327 msgid "Send _Files…" msgstr "Send _filer …" -#: lib/settings.ui:335 +#: lib/settings.ui:341 msgid "_Remove Device" msgstr "Fje_rn enhet" @@ -396,11 +396,6 @@ msgid "Send files via Bluetooth" msgstr "Send filer via Bluetooth" -#. Translators: Do NOT translate or transliterate this text (this is an icon file name)! -#: sendto/bluetooth-sendto.desktop.in.in:6 -msgid "bluetooth" -msgstr "bluetooth" - #: sendto/main.c:117 msgid "An unknown error occurred" msgstr "En ukjent feil oppsto" diff -Nru gnome-bluetooth-3.34.3/po/pa.po gnome-bluetooth-3.34.5/po/pa.po --- gnome-bluetooth-3.34.3/po/pa.po 2020-10-01 09:19:42.394873400 +0000 +++ gnome-bluetooth-3.34.5/po/pa.po 2021-03-23 15:09:30.428372100 +0000 @@ -1,28 +1,27 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # -# A S Alam , 2009, 2010, 2011, 2012, 2013, 2014, 2018. +# A S Alam , 2009, 2010, 2011, 2012, 2013, 2014, 2018, 2021. msgid "" msgstr "" "Project-Id-Version: gnome-bluetooth.master\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-b" -"luetooth&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2017-11-15 12:52+0000\n" -"PO-Revision-Date: 2018-03-09 06:37-0600\n" -"Last-Translator: A S Alam \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/issues\n" +"POT-Creation-Date: 2020-06-25 07:23+0000\n" +"PO-Revision-Date: 2021-02-13 17:41-0800\n" +"Last-Translator: A S Alam \n" "Language-Team: Punjabi \n" "Language: pa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Lokalize 2.0\n" +"X-Generator: Lokalize 20.08.1\n" #: lib/bluetooth-chooser-button.c:71 msgid "Click to select device…" -msgstr "…ਜੰਤਰ ਚੁਣਨ ਲਈ ਕਲਿੱਕ ਕਰੋ" +msgstr "…ਡਿਵਾਈਸ ਚੁਣਨ ਲਈ ਕਲਿੱਕ ਕਰੋ" -#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1275 +#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1281 #: sendto/main.c:447 sendto/main.c:738 sendto/main.c:794 msgid "_Cancel" msgstr "ਰੱਦ ਕਰੋ(_C)" @@ -43,25 +42,25 @@ #: lib/bluetooth-chooser.c:180 lib/bluetooth-chooser.c:806 #: lib/bluetooth-settings-widget.c:1561 msgid "Searching for devices…" -msgstr "…ਜੰਤਰਾਂ ਲਈ ਖੋਜ ਜਾਰੀ ਹੈ" +msgstr "…ਡਿਵਾਈਸਾਂ ਲਈ ਖੋਜ ਜਾਰੀ ਹੈ" #: lib/bluetooth-chooser.c:698 lib/bluetooth-chooser.c:988 msgid "Device" -msgstr "ਜੰਤਰ" +msgstr "ਡਿਵਾਈਸ" -#: lib/bluetooth-chooser.c:734 lib/settings.ui:179 +#: lib/bluetooth-chooser.c:734 lib/settings.ui:182 msgid "Type" msgstr "ਕਿਸਮ" -#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1524 +#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1518 msgid "Devices" -msgstr "ਜੰਤਰ" +msgstr "ਡਿਵਾਈਸ" #: lib/bluetooth-filter-widget.c:72 msgid "All categories" msgstr "ਸਭ ਵਰਗ" -#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:134 +#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:135 msgid "Paired" msgstr "ਪੇਅਰ ਕੀਤੇ" @@ -86,39 +85,38 @@ #. The device category filter #: lib/bluetooth-filter-widget.c:247 msgid "Device _category:" -msgstr "ਜੰਤਰ ਕੈਟਾਗਰੀ(_c):" +msgstr "ਡਿਵਾਈਸ ਦੀ ਕੈਟਾਗਰੀ(_c):" #: lib/bluetooth-filter-widget.c:258 msgid "Select the device category to filter" -msgstr "ਫਿਲਟਰ ਕਰਨ ਲਈ ਜੰਤਰ ਕੈਟਾਗਰੀ ਚੁਣੋ" +msgstr "ਫਿਲਟਰ ਕਰਨ ਲਈ ਡਿਵਾਈਸ ਦੀ ਕੈਟਾਗਰੀ ਚੁਣੋ" #. The device type filter #: lib/bluetooth-filter-widget.c:272 msgid "Device _type:" -msgstr "ਜੰਤਰ ਟਾਈਪ(_t):" +msgstr "ਡਿਵਾਈਸ ਦੀ ਟਾਈਪ(_t):" #: lib/bluetooth-filter-widget.c:289 msgid "Select the device type to filter" -msgstr "ਫਿਲਟਰ ਕਰਨ ਲਈ ਜੰਤਰ ਕਿਸਮ ਚੁਣੋ" +msgstr "ਫਿਲਟਰ ਕਰਨ ਲਈ ਡਿਵਾਈਸ ਦੀ ਕਿਸਮ ਚੁਣੋ" #: lib/bluetooth-filter-widget.c:295 msgid "Input devices (mice, keyboards, etc.)" -msgstr "ਇੰਪੁੱਟ ਜੰਤਰ (ਮਾਊਸ, ਕੀਬੋਰਡ ਆਦਿ)" +msgstr "ਇਨਪੁੱਟ ਡਿਵਾਈਸ (ਮਾਊਸ, ਕੀਬੋਰਡ ਆਦਿ)" #: lib/bluetooth-filter-widget.c:299 msgid "Headphones, headsets and other audio devices" -msgstr "ਹੈੱਡਫੋਨ, ਹੈੱਡਸੈੱਟ ਅਤੇ ਹੋਰ ਆਡੀਓ ਜੰਤਰ" +msgstr "ਹੈੱਡਫੋਨ, ਹੈੱਡਸੈੱਟ ਅਤੇ ਹੋਰ ਆਡੀਓ ਡਿਵਾਈਸ" #: lib/bluetooth-pairing-dialog.c:83 lib/bluetooth-pairing-dialog.c:90 #: lib/bluetooth-pairing-dialog.c:104 msgid "Confirm Bluetooth PIN" -msgstr "ਬਲਿਊਟੁੱਥ ਪਿੰਨ ਤਸਦੀਕ" +msgstr "ਬਲਟੁੱਥ ਪਿੰਨ ਤਸਦੀਕ" #: lib/bluetooth-pairing-dialog.c:84 #, c-format -#| msgid "Please confirm the PIN that was entered on '%s'." msgid "Please confirm the PIN that was entered on “%s”." -msgstr "ਤਸਦੀਕ ਕਰੋ ਜੀ ਕਿ “%s“ ਉੱਤੇ PIN ਦਿੱਤਾ ਹੈ।" +msgstr "ਪਿੰਨ ਤਸਦੀਕ ਕਰੋ ਜੋ ਕਿ “%s“ ਉੱਤੇ PIN ਦਿੱਤਾ ਸੀ।" #: lib/bluetooth-pairing-dialog.c:88 lib/bluetooth-pairing-dialog.c:101 #: lib/bluetooth-pairing-dialog.c:149 @@ -127,64 +125,52 @@ #: lib/bluetooth-pairing-dialog.c:91 #, c-format -#| msgid "" -#| "Confirm the Bluetooth PIN for '%s'. This can usually be found in the " -#| "device's manual." msgid "" "Confirm the Bluetooth PIN for “%s”. This can usually be found in the " "device’s manual." msgstr "" -"“%s“ ਲਈ ਬਲਿਊਟੁੱਥ ਪਿੰਨ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ। ਇਹ ਅਕਸਰ ਜੰਤਰ ਦੇ ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਲੱਭਿਆ ਜਾ" +"“%s“ ਲਈ ਬਲੂਟੁੱਥ ਪਿੰਨ ਨੂੰ ਤਸਦੀਕ ਕਰੋ। ਇਹ ਅਕਸਰ ਡਿਵਾਈਸ ਦੇ ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਲੱਭਿਆ ਜਾ" " ਸਕਦਾ ਹੈ।" #: lib/bluetooth-pairing-dialog.c:97 #, c-format -#| msgid "Pairing '%s'" msgid "Pairing “%s”" msgstr "“%s“ ਨੂੰ ਪੇਅਰ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" #: lib/bluetooth-pairing-dialog.c:105 #, c-format -#| msgid "" -#| "Please confirm that the following PIN matches the one displayed on '%s'." msgid "" "Please confirm that the following PIN matches the one displayed on “%s”." msgstr "ਤਸਦੀਕ ਕਰੋ ਜੀ ਕਿ “%s“ ਉੱਤੇ ਵਿਖਾਈ ਦਿੱਤਾ PIN ਹੇਠ ਦਿੱਤੇ ਨਾਲ ਮਿਲਦਾ ਹੈ।" #: lib/bluetooth-pairing-dialog.c:110 msgid "Bluetooth Pairing Request" -msgstr "ਬਲਿਊਟੁੱਥ ਪੇਅਰ ਹੋਣ ਦੀ ਬੇਨਤੀ" +msgstr "ਬਲੂਟੁੱਥ ਪੇਅਰ ਹੋਣ ਦੀ ਬੇਨਤੀ" #: lib/bluetooth-pairing-dialog.c:111 #, c-format -#| msgid "'%s' wants to pair with this device. Do you want to allow pairing?" msgid "“%s” wants to pair with this device. Do you want to allow pairing?" msgstr "" -"“%s“ ਇਸ ਜੰਤਰ ਨਾਲ ਪੇਅਰ ਹੋਣਾ ਚਾਹੁੰਦਾ ਹੈ। ਕੀ ਤੁਸੀਂ ਪੇਅਰ ਕਰਨ ਨੂੰ ਮਨਜ਼ੂਰ ਕਰਨਾ" +"“%s“ ਇਸ ਡਿਵਾਈਸ ਨਾਲ ਪੇਅਰ ਹੋਣਾ ਚਾਹੁੰਦਾ ਹੈ। ਕੀ ਤੁਸੀਂ ਪੇਅਰ ਕਰਨ ਨੂੰ ਮਨਜ਼ੂਰ ਕਰਨਾ" " ਚਾਹੁੰਦੇ ਹੋ?" #: lib/bluetooth-pairing-dialog.c:116 -#| msgid "Confirm Bluetooth PIN" msgid "Confirm Bluetooth Connection" -msgstr "ਬਲਿਊਟੁੱਥ ਕਨੈਕਸ਼ਨ ਦੀ ਤਸਦੀਕ" +msgstr "ਬਲੂਟੁੱਥ ਕਨੈਕਸ਼ਨ ਦੀ ਤਸਦੀਕ" #: lib/bluetooth-pairing-dialog.c:117 #, c-format -#| msgid "'%s' wants to pair with this device. Do you want to allow pairing?" msgid "“%s” wants to connect with this device. Do you want to allow it?" -msgstr "“%s“ ਇਸ ਜੰਤਰ ਨਾਲ ਕਨੈਕਟ ਹੋਣਾ ਚਾਹੁੰਦਾ ਹੈ। ਕੀ ਤੁਸੀਂ ਇਸ ਦੀ ਇਜਾਜ਼ਤ ਦਿੰਦੇ ਹੋ?" +msgstr "" +"“%s“ ਇਸ ਡਿਵਾਈਸ ਨਾਲ ਕਨੈਕਟ ਹੋਣਾ ਚਾਹੁੰਦਾ ਹੈ। ਕੀ ਤੁਸੀਂ ਇਸ ਦੀ ਇਜਾਜ਼ਤ ਦਿੰਦੇ ਹੋ?" #: lib/bluetooth-pairing-dialog.c:125 #, c-format -#| msgid "Please enter the following PIN on '%s'." msgid "Please enter the following PIN on “%s”." msgstr "“%s“ ਉੱਤੇ ਅੱਗੇ ਦਿੱਤਾ ਪਿੰਨ ਲਿਖੋ ਜੀ।" #: lib/bluetooth-pairing-dialog.c:128 #, c-format -#| msgid "" -#| "Please enter the following PIN on '%s'. Then press “Return” on the " -#| "keyboard." msgid "" "Please enter the following PIN on “%s”. Then press “Return” on the keyboard." msgstr "ਹੇਠ ਦਿੱਤਾ ਪਿੰਨ “%s“ ਉੱਤੇ ਦਿਓ। ਤਦ ਕੀਬੋਰਡ ਤੋਂ “ਐਂਟਰ“ ਦੱਬੋ।" @@ -207,97 +193,92 @@ msgstr "ਮਨਸੂਖ" #. Cancel button -#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:308 +#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:306 msgid "Cancel" msgstr "ਰੱਦ ਕਰੋ" #. OK button -#: lib/bluetooth-pairing-dialog.c:289 lib/bluetooth-settings-obexpush.c:246 +#: lib/bluetooth-pairing-dialog.c:287 lib/bluetooth-settings-obexpush.c:247 msgid "Accept" msgstr "ਮਨਜ਼ੂਰ" -#: lib/bluetooth-settings-row.c:79 lib/bluetooth-settings-row.ui:37 +#: lib/bluetooth-settings-row.c:79 lib/bluetooth-settings-row.ui:40 msgid "Not Set Up" msgstr "ਸੈੱਟਅੱਪ ਨਹੀਂ" #: lib/bluetooth-settings-row.c:81 msgid "Connected" -msgstr "ਕੁਨੈਕਟ ਹੈ" +msgstr "ਕਨੈਕਟ ਹੈ" #: lib/bluetooth-settings-row.c:83 msgid "Disconnected" -msgstr "ਡਿਸ-ਕੁਨੈਕਟ ਹੈ" +msgstr "ਡਿਸ-ਕਨੈਕਟ ਹੈ" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1149 msgid "Yes" msgstr "ਹਾਂ" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1149 msgid "No" msgstr "ਨਹੀਂ" #. translators: first %s is the name of the computer, for example: #. * Visible as “Bastien Nocera’s Computer” followed by the #. * location of the Downloads folder. -#: lib/bluetooth-settings-widget.c:1243 +#: lib/bluetooth-settings-widget.c:1249 #, c-format msgid "" "Visible as “%s” and available for Bluetooth file transfers. Transferred " "files are placed in the Downloads folder." msgstr "" -"“%s” ਵਜੋਂ ਦਿਖਾਈ ਦਿੰਦਾ ਹੈ ਅਤੇ ਬਲਿਊਟੁੱਥ ਫ਼ਾਇਲ ਤਬਾਦਲੇ ਲਈ ਉਪਲਬਧ ਹੈ। ਤਬਾਦਲਾ ਕੀਤੀਆਂ" +"“%s” ਵਜੋਂ ਦਿਖਾਈ ਦਿੰਦਾ ਹੈ ਅਤੇ ਬਲੂਟੁੱਥ ਫ਼ਾਇਲ ਤਬਾਦਲੇ ਲਈ ਉਪਲਬਧ ਹੈ। ਤਬਾਦਲਾ ਕੀਤੀਆਂ" " ਫ਼ਾਇਲਾਂ ਨੂੰ " "ਡਾਊਨਲੋਡ (Downloads) ਫੋਲਡਰ 'ਚ ਰੱਖਿਆ ਜਾਵੇਗਾ।" -#: lib/bluetooth-settings-widget.c:1270 +#: lib/bluetooth-settings-widget.c:1276 #, c-format -#| msgid "Remove '%s' from the list of devices?" msgid "Remove “%s” from the list of devices?" -msgstr "ਕੀ ਜੰਤਰਾਂ ਦੀ ਸੂਚੀ ਵਿੱਚੋਂ “%s“ ਨੂੰ ਹਟਾਉਣਾ ਹੈ?" +msgstr "ਕੀ ਡਿਵਾਈਸਾਂ ਦੀ ਸੂਚੀ ਵਿੱਚੋਂ “%s“ ਨੂੰ ਹਟਾਉਣਾ ਹੈ?" -#: lib/bluetooth-settings-widget.c:1272 +#: lib/bluetooth-settings-widget.c:1278 msgid "" "If you remove the device, you will have to set it up again before next use." msgstr "" -"ਜੇ ਤੁਸੀਂ ਜੰਤਰ ਹਟਾਇਆ ਤਾਂ ਤੁਹਾਨੂੰ ਇਸ ਨੂੰ ਅਗਲੀ ਵਾਰ ਵਰਤਣ ਸਮੇਂ ਸੈੱਟਅੱਪ ਕਰਨਾ ਪਵੇਗਾ।" +"ਜੇ ਤੁਸੀਂ ਡਿਵਾਈਸ ਹਟਾਇਆ ਤਾਂ ਤੁਹਾਨੂੰ ਇਸ ਨੂੰ ਅਗਲੀ ਵਾਰ ਵਰਤਣ ਸਮੇਂ ਸੈੱਟਅੱਪ ਕਰਨਾ" +" ਪਵੇਗਾ।" -#: lib/bluetooth-settings-widget.c:1276 +#: lib/bluetooth-settings-widget.c:1282 msgid "_Remove" msgstr "ਹਟਾਓ(_R)" #. Translators: %s is the name of the filename received -#: lib/bluetooth-settings-obexpush.c:145 +#: lib/bluetooth-settings-obexpush.c:146 #, c-format -#| msgid "Send files via Bluetooth" msgid "You received “%s” via Bluetooth" -msgstr "ਤੁਸੀਂ ਬਲਿਊਟੁੱਥ ਰਾਹੀਂ “%s\" ਲਈ" +msgstr "ਤੁਸੀਂ ਬਲੂਟੁੱਥ ਰਾਹੀਂ “%s\" ਲਈ" -#: lib/bluetooth-settings-obexpush.c:147 -#| msgid "Receive Files" +#: lib/bluetooth-settings-obexpush.c:148 msgid "You received a file" -msgstr "ਤੁਹਾਨੂੰ ਫ਼ਾਈਲ ਮਿਲੀ" +msgstr "ਤੁਹਾਨੂੰ ਫ਼ਾਇਲ ਮਿਲੀ" -#: lib/bluetooth-settings-obexpush.c:158 -#| msgid "Send _Files…" +#: lib/bluetooth-settings-obexpush.c:159 msgid "Open File" msgstr "ਫਾਇਲ ਖੋਲ੍ਹੋ" -#: lib/bluetooth-settings-obexpush.c:162 -#| msgid "Receive Files" -msgid "Reveal File" -msgstr "ਫਾਇਲ ਦਿਖਾਓ" +#: lib/bluetooth-settings-obexpush.c:163 +msgid "Open Containing Folder" +msgstr "ਰੱਖਣ ਵਾਲਾ ਫੋਲਡਰ ਖੋਲ੍ਹੋ" -#: lib/bluetooth-settings-obexpush.c:179 +#: lib/bluetooth-settings-obexpush.c:180 msgid "File reception complete" msgstr "ਫਾਇਲ ਪ੍ਰਾਪਤੀ ਪੂਰੀ" -#: lib/bluetooth-settings-obexpush.c:233 +#: lib/bluetooth-settings-obexpush.c:234 #, c-format -#| msgid "Bluetooth File Transfer" msgid "Bluetooth file transfer from %s" -msgstr "%s ਤੋਂ ਬਲਿਊਟੁੱਥ ਫਾਇਲ ਤਬਾਦਲਾ" +msgstr "%s ਤੋਂ ਬਲੂਟੁੱਥ ਫਾਇਲ ਤਬਾਦਲਾ" -#: lib/bluetooth-settings-obexpush.c:243 +#: lib/bluetooth-settings-obexpush.c:244 msgid "Decline" msgstr "ਇਨਕਾਰ ਕਰੋ" @@ -328,7 +309,7 @@ #: lib/bluetooth-utils.c:72 msgid "Audio device" -msgstr "ਆਡੀਓ ਜੰਤਰ" +msgstr "ਆਡੀਓ ਡਿਵਾਈਸ" #: lib/bluetooth-utils.c:74 msgid "Keyboard" @@ -356,7 +337,7 @@ #: lib/bluetooth-utils.c:86 msgid "Video device" -msgstr "ਵਿਡੀਓ ਜੰਤਰ" +msgstr "ਵਿਡੀਓ ਡਿਵਾਈਸ" #: lib/bluetooth-utils.c:88 msgid "Remote control" @@ -384,55 +365,50 @@ #: lib/settings.ui:44 msgid "Connection" -msgstr "ਕੁਨੈਕਸ਼ਨ" +msgstr "ਕਨੈਕਸ਼ਨ" -#: lib/settings.ui:224 +#: lib/settings.ui:229 msgid "Address" msgstr "ਐਡਰੈੱਸ" -#: lib/settings.ui:279 +#: lib/settings.ui:285 msgid "_Mouse & Touchpad Settings" -msgstr "ਮਾਊਸ ਅਤੇ ਟੱਚਪੈਡ ਸੈਟਿੰਗ(_M)" +msgstr "ਮਾਊਸ ਅਤੇ ਟੱਚਪੈਡ ਸੈਟਿੰਗਾਂ(_M)" -#: lib/settings.ui:293 +#: lib/settings.ui:299 msgid "_Sound Settings" -msgstr "ਸਾਊਂਡ ਸੈਟਿੰਗ(_S)" +msgstr "ਸਾਊਂਡ ਸੈਟਿੰਗਾਂ(_S)" -#: lib/settings.ui:307 +#: lib/settings.ui:313 msgid "_Keyboard Settings" -msgstr "ਕੀਬੋਰਡ ਸੈਟਿੰਗ(_K)" +msgstr "ਕੀਬੋਰਡ ਸੈਟਿੰਗਾਂ(_K)" -#: lib/settings.ui:321 +#: lib/settings.ui:327 msgid "Send _Files…" msgstr "…ਫਾਇਲਾਂ ਭੇਜੋ(_F)" -#: lib/settings.ui:335 +#: lib/settings.ui:341 msgid "_Remove Device" -msgstr "ਜੰਤਰ ਹਟਾਓ(_R)" +msgstr "ਡਿਵਾਈਸ ਹਟਾਓ(_R)" #: sendto/bluetooth-sendto.desktop.in.in:3 msgid "Bluetooth Transfer" -msgstr "ਬਲਿਊਟੁੱਥ ਟਰਾਂਸਫਰ" +msgstr "ਬਲੂਟੁੱਥ ਟਰਾਂਸਫਰ" #: sendto/bluetooth-sendto.desktop.in.in:4 msgid "Send files via Bluetooth" -msgstr "ਬਲਿਊਟੁੱਥ ਰਾਹੀਂ ਫਾਇਲਾਂ ਭੇਜੋ" - -#. Translators: Do NOT translate or transliterate this text (this is an icon file name)! -#: sendto/bluetooth-sendto.desktop.in.in:6 -msgid "bluetooth" -msgstr "bluetooth" +msgstr "ਬਲੂਟੁੱਥ ਰਾਹੀਂ ਫਾਇਲਾਂ ਭੇਜੋ" #: sendto/main.c:117 msgid "An unknown error occurred" -msgstr "ਇੱਕ ਅਣਜਾਣੀ ਗਲਤੀ ਆਈ ਹੈ" +msgstr "ਅਣਪਛਾਤੀ ਗਲਤੀ ਆਈ ਹੈ" #: sendto/main.c:130 msgid "" "Make sure that the remote device is switched on and that it accepts " "Bluetooth connections" msgstr "" -"ਯਕੀਨੀ ਬਣਾਉ ਕਿ ਰਿਮੋਟ ਜੰਤਰ ਚਾਲੂ ਹੈ ਅਤੇ ਇਹ ਬਲਿਊਟੁੱਥ ਕੁਨੈਕਸ਼ਨ ਮਨਜ਼ੂਰ ਕਰਦਾ ਹੈ।" +"ਯਕੀਨੀ ਬਣਾਉ ਕਿ ਰਿਮੋਟ ਡਿਵਾਈਸ ਚਾਲੂ ਹੈ ਅਤੇ ਇਹ ਬਲੂਟੁੱਥ ਕਨੈਕਸ਼ਨ ਮਨਜ਼ੂਰ ਕਰਦਾ ਹੈ।" #: sendto/main.c:363 #, c-format @@ -468,7 +444,7 @@ #: sendto/main.c:444 msgid "Bluetooth File Transfer" -msgstr "ਬਲਿਊਟੁੱਥ ਫਾਇਲ ਟਰਾਂਸਫਰ" +msgstr "ਬਲੂਟੁੱਥ ਫਾਇਲ ਟਰਾਂਸਫਰ" #: sendto/main.c:448 msgid "_Retry" @@ -476,7 +452,7 @@ #: sendto/main.c:470 msgid "From:" -msgstr "ਤੋਂ:" +msgstr "ਵੱਲੋਂ:" #: sendto/main.c:484 msgid "To:" @@ -519,7 +495,7 @@ #: sendto/main.c:734 msgid "Select device to send to" -msgstr "ਭੇਜਣ ਲਈ ਜੰਤਰ ਚੁਣੋ" +msgstr "ਭੇਜਣ ਲਈ ਡਿਵਾਈਸ ਚੁਣੋ" #: sendto/main.c:739 msgid "_Send" @@ -535,26 +511,31 @@ #: sendto/main.c:825 msgid "Remote device to use" -msgstr "ਵਰਤਣ ਲਈ ਰਿਮੋਟ ਜੰਤਰ" +msgstr "ਵਰਤਣ ਲਈ ਰਿਮੋਟ ਡਿਵਾਈਸ" #: sendto/main.c:825 msgid "ADDRESS" msgstr "ਐਡਰੈੱਸ" #: sendto/main.c:827 -#| msgid "Remote device's name" msgid "Remote device’s name" -msgstr "ਰਿਮੋਟ ਜੰਤਰ ਦਾ ਨਾਂ" +msgstr "ਰਿਮੋਟ ਡਿਵਾਈਸ ਦਾ ਨਾਂ" #: sendto/main.c:827 msgid "NAME" msgstr "ਨਾਂ" #: sendto/main.c:846 -#| msgid "[FILE...]" msgid "[FILE…]" msgstr "[ਫਾਇਲ...]" +#~| msgid "Receive Files" +#~ msgid "Reveal File" +#~ msgstr "ਫਾਇਲ ਦਿਖਾਓ" + +#~ msgid "bluetooth" +#~ msgstr "bluetooth" + #~ msgid "Visible as “%s”" #~ msgstr "“%s” ਵਜੋਂ ਦਿੱਖ" diff -Nru gnome-bluetooth-3.34.3/po/sr@latin.po gnome-bluetooth-3.34.5/po/sr@latin.po --- gnome-bluetooth-3.34.3/po/sr@latin.po 2020-10-01 09:19:42.403873200 +0000 +++ gnome-bluetooth-3.34.5/po/sr@latin.po 2021-03-23 15:09:30.429372300 +0000 @@ -7,28 +7,30 @@ # # Miloš Popović , 2007—2010. # Miroslav Nikolić , 2011—2017. +# Đorđe Mančić , 2020. +# msgid "" msgstr "" "Project-Id-Version: gnome-bluetooth\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" -"bluetooth&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2017-08-13 21:07+0000\n" -"PO-Revision-Date: 2017-08-14 20:25+0200\n" -"Last-Translator: Miroslav Nikolić \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/issues\n" +"POT-Creation-Date: 2020-12-11 12:43+0000\n" +"PO-Revision-Date: 2020-12-17 17:48+0100\n" +"Last-Translator: Đorđe Mančić \n" "Language-Team: srpski \n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : " -"n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : n" +"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" "X-Project-Style: gnome\n" +"X-Generator: Gtranslator 3.38.0\n" #: lib/bluetooth-chooser-button.c:71 msgid "Click to select device…" msgstr "Kliknite da izaberete uređaj…" -#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1275 +#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1319 #: sendto/main.c:447 sendto/main.c:738 sendto/main.c:794 msgid "_Cancel" msgstr "_Otkaži" @@ -44,10 +46,10 @@ #: lib/bluetooth-chooser.c:176 msgid "No adapters available" -msgstr "Nema dosupnih adaptera" +msgstr "Nema dostupnih adaptera" #: lib/bluetooth-chooser.c:180 lib/bluetooth-chooser.c:806 -#: lib/bluetooth-settings-widget.c:1564 +#: lib/bluetooth-settings-widget.c:1588 msgid "Searching for devices…" msgstr "Tražim uređaje…" @@ -55,11 +57,11 @@ msgid "Device" msgstr "Uređaj" -#: lib/bluetooth-chooser.c:734 lib/settings.ui:179 +#: lib/bluetooth-chooser.c:734 lib/settings.ui:182 msgid "Type" msgstr "Vrsta" -#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1526 +#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1545 msgid "Devices" msgstr "Uređaji" @@ -67,7 +69,7 @@ msgid "All categories" msgstr "Sve kategorije" -#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:134 +#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:135 msgid "Paired" msgstr "Upareni" @@ -122,7 +124,6 @@ #: lib/bluetooth-pairing-dialog.c:84 #, c-format -#| msgid "Please confirm the PIN that was entered on '%s'." msgid "Please confirm the PIN that was entered on “%s”." msgstr "Potvrdite PIN koji je ispisan na „%s“." @@ -133,9 +134,6 @@ #: lib/bluetooth-pairing-dialog.c:91 #, c-format -#| msgid "" -#| "Confirm the Bluetooth PIN for '%s'. This can usually be found in the " -#| "device's manual." msgid "" "Confirm the Bluetooth PIN for “%s”. This can usually be found in the " "device’s manual." @@ -144,14 +142,11 @@ #: lib/bluetooth-pairing-dialog.c:97 #, c-format -#| msgid "Pairing '%s'" msgid "Pairing “%s”" msgstr "Uparujem „%s“" #: lib/bluetooth-pairing-dialog.c:105 #, c-format -#| msgid "" -#| "Please confirm that the following PIN matches the one displayed on '%s'." msgid "" "Please confirm that the following PIN matches the one displayed on “%s”." msgstr "Potvrdite da se sledeći PIN poklapa sa onim prikazanim na „%s“." @@ -162,7 +157,6 @@ #: lib/bluetooth-pairing-dialog.c:111 #, c-format -#| msgid "'%s' wants to pair with this device. Do you want to allow pairing?" msgid "“%s” wants to pair with this device. Do you want to allow pairing?" msgstr "" "„%s“ želi da se upari sa ovim uređajem. Da li želite da dopustite uparivanje?" @@ -173,7 +167,6 @@ #: lib/bluetooth-pairing-dialog.c:117 #, c-format -#| msgid "'%s' wants to connect with this device. Do you want to allow it?" msgid "“%s” wants to connect with this device. Do you want to allow it?" msgstr "" "„%s“ želi da se poveže sa ovim uređajem. Da li želite da dopustite " @@ -181,15 +174,11 @@ #: lib/bluetooth-pairing-dialog.c:125 #, c-format -#| msgid "Please enter the following PIN on '%s'." msgid "Please enter the following PIN on “%s”." msgstr "Unesite sledeći PIN na „%s“." #: lib/bluetooth-pairing-dialog.c:128 #, c-format -#| msgid "" -#| "Please enter the following PIN on '%s'. Then press “Return” on the " -#| "keyboard." msgid "" "Please enter the following PIN on “%s”. Then press “Return” on the keyboard." msgstr "Unesite sledeći PIN na „%s“. Zatim pritisnite „Unesi“ na tastaturi." @@ -211,39 +200,39 @@ msgstr "Odbaci" #. Cancel button -#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:308 +#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:306 msgid "Cancel" msgstr "Otkaži" #. OK button -#: lib/bluetooth-pairing-dialog.c:289 lib/bluetooth-settings-obexpush.c:246 +#: lib/bluetooth-pairing-dialog.c:287 lib/bluetooth-settings-obexpush.c:247 msgid "Accept" msgstr "Prihvati" -#: lib/bluetooth-settings-row.c:79 lib/bluetooth-settings-row.ui:37 +#: lib/bluetooth-settings-row.c:81 lib/bluetooth-settings-row.ui:40 msgid "Not Set Up" msgstr "Nije podešeno" -#: lib/bluetooth-settings-row.c:81 +#: lib/bluetooth-settings-row.c:83 msgid "Connected" msgstr "Povezan" -#: lib/bluetooth-settings-row.c:83 +#: lib/bluetooth-settings-row.c:85 msgid "Disconnected" msgstr "Nepovezan" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1187 msgid "Yes" msgstr "Da" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1187 msgid "No" msgstr "Ne" #. translators: first %s is the name of the computer, for example: #. * Visible as “Bastien Nocera’s Computer” followed by the #. * location of the Downloads folder. -#: lib/bluetooth-settings-widget.c:1243 +#: lib/bluetooth-settings-widget.c:1287 #, c-format msgid "" "Visible as “%s” and available for Bluetooth file transfers. Transferred " @@ -252,52 +241,50 @@ "Uređaj je vidljiv kao „%s“ i spreman za prenose datoteka preko blututa. " "Prenešene datoteke će biti smeštene u fascikli Preuzeto." -#: lib/bluetooth-settings-widget.c:1270 +#: lib/bluetooth-settings-widget.c:1314 #, c-format -#| msgid "Remove '%s' from the list of devices?" msgid "Remove “%s” from the list of devices?" msgstr "Da uklonim „%s“ sa spiska uređaja?" -#: lib/bluetooth-settings-widget.c:1272 +#: lib/bluetooth-settings-widget.c:1316 msgid "" "If you remove the device, you will have to set it up again before next use." msgstr "" "Ukoliko uklonite uređaj, moraćete ponovo da ga podesite pre sledećeg " "korišćenja." -#: lib/bluetooth-settings-widget.c:1276 +#: lib/bluetooth-settings-widget.c:1320 msgid "_Remove" msgstr "_Ukloni" #. Translators: %s is the name of the filename received -#: lib/bluetooth-settings-obexpush.c:145 +#: lib/bluetooth-settings-obexpush.c:146 #, c-format -#| msgid "You received \"%s\" via Bluetooth" msgid "You received “%s” via Bluetooth" msgstr "Primili ste „%s“ preko blututa" -#: lib/bluetooth-settings-obexpush.c:147 +#: lib/bluetooth-settings-obexpush.c:148 msgid "You received a file" msgstr "Primili ste datoteku" -#: lib/bluetooth-settings-obexpush.c:158 +#: lib/bluetooth-settings-obexpush.c:159 msgid "Open File" msgstr "Otvori datoteku" -#: lib/bluetooth-settings-obexpush.c:162 -msgid "Reveal File" -msgstr "Prikaži datoteku" +#: lib/bluetooth-settings-obexpush.c:163 +msgid "Open Containing Folder" +msgstr "Otvori pripadajuću fasciklu" -#: lib/bluetooth-settings-obexpush.c:179 +#: lib/bluetooth-settings-obexpush.c:180 msgid "File reception complete" msgstr "Prijem datoteke završen" -#: lib/bluetooth-settings-obexpush.c:233 +#: lib/bluetooth-settings-obexpush.c:234 #, c-format msgid "Bluetooth file transfer from %s" msgstr "Blutut prenos datoteke sa uređaja „%s“" -#: lib/bluetooth-settings-obexpush.c:243 +#: lib/bluetooth-settings-obexpush.c:244 msgid "Decline" msgstr "Odbij" @@ -386,27 +373,27 @@ msgid "Connection" msgstr "Veza" -#: lib/settings.ui:224 +#: lib/settings.ui:229 msgid "Address" msgstr "Adresa" -#: lib/settings.ui:279 +#: lib/settings.ui:285 msgid "_Mouse & Touchpad Settings" msgstr "Podešavanja _miša i dodirne table" -#: lib/settings.ui:293 +#: lib/settings.ui:299 msgid "_Sound Settings" -msgstr "Podšavanja _zvuka" +msgstr "Podešavanja _zvuka" -#: lib/settings.ui:307 +#: lib/settings.ui:313 msgid "_Keyboard Settings" msgstr "Podešavanja _tastature" -#: lib/settings.ui:321 +#: lib/settings.ui:327 msgid "Send _Files…" msgstr "Pošalji _datoteke…" -#: lib/settings.ui:335 +#: lib/settings.ui:341 msgid "_Remove Device" msgstr "_Ukloni uređaj" @@ -418,11 +405,6 @@ msgid "Send files via Bluetooth" msgstr "Šaljem datoteke preko Blututa" -#. Translators: Do NOT translate or transliterate this text (this is an icon file name)! -#: sendto/bluetooth-sendto.desktop.in.in:6 -msgid "bluetooth" -msgstr "bluetooth" - #: sendto/main.c:117 msgid "An unknown error occurred" msgstr "Došlo je do nepoznate greške" @@ -553,7 +535,6 @@ msgstr "ADRESA" #: sendto/main.c:827 -#| msgid "Remote device's name" msgid "Remote device’s name" msgstr "Naziv udaljenog uređaja" @@ -562,10 +543,15 @@ msgstr "NAZIV" #: sendto/main.c:846 -#| msgid "[FILE...]" msgid "[FILE…]" msgstr "[DATOTEKA…]" +#~ msgid "Reveal File" +#~ msgstr "Prikaži datoteku" + +#~ msgid "bluetooth" +#~ msgstr "bluetooth" + #~ msgid "Visible as “%s”" #~ msgstr "Vidi se kao „%s“" diff -Nru gnome-bluetooth-3.34.3/po/sr.po gnome-bluetooth-3.34.5/po/sr.po --- gnome-bluetooth-3.34.3/po/sr.po 2020-10-01 09:19:42.403873200 +0000 +++ gnome-bluetooth-3.34.5/po/sr.po 2021-03-23 15:09:30.429372300 +0000 @@ -7,23 +7,24 @@ # # Милош Поповић , 2007—2010. # Мирослав Николић , 2011—2017. +# Ђорђе Манчић , 2020. +# msgid "" msgstr "" "Project-Id-Version: gnome-bluetooth\n" -"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/" -"issues\n" -"POT-Creation-Date: 2019-07-18 13:00+0000\n" -"PO-Revision-Date: 2019-08-21 23:49+0200\n" -"Last-Translator: Марко М. Костић \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/issues\n" +"POT-Creation-Date: 2020-06-25 07:23+0000\n" +"PO-Revision-Date: 2020-12-17 17:48+0100\n" +"Last-Translator: Ђорђе Манчић \n" "Language-Team: српски \n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : n" -"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" "X-Project-Style: gnome\n" -"X-Generator: Poedit 2.2.3\n" +"X-Generator: Gtranslator 3.38.0\n" #: lib/bluetooth-chooser-button.c:71 msgid "Click to select device…" @@ -199,12 +200,12 @@ msgstr "Одбаци" #. Cancel button -#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:308 +#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:306 msgid "Cancel" msgstr "Откажи" #. OK button -#: lib/bluetooth-pairing-dialog.c:289 lib/bluetooth-settings-obexpush.c:247 +#: lib/bluetooth-pairing-dialog.c:287 lib/bluetooth-settings-obexpush.c:247 msgid "Accept" msgstr "Прихвати" @@ -382,7 +383,7 @@ #: lib/settings.ui:299 msgid "_Sound Settings" -msgstr "Подшавања _звука" +msgstr "Подешавања _звука" #: lib/settings.ui:313 msgid "_Keyboard Settings" diff -Nru gnome-bluetooth-3.34.3/po/vi.po gnome-bluetooth-3.34.5/po/vi.po --- gnome-bluetooth-3.34.3/po/vi.po 2020-10-01 09:19:42.412873000 +0000 +++ gnome-bluetooth-3.34.5/po/vi.po 2021-03-23 15:09:30.430372200 +0000 @@ -4,15 +4,15 @@ # This file is distributed under the same license as the gnome-bluetooth package. # Bùi Xuân Dương , 2009. # Nguyễn Thái Ngọc Duy , 2012. -# Trần Ngọc Quân , 2013-2014, 2015, 2017. +# Trần Ngọc Quân , 2013-2015, 2017, 2021. # msgid "" msgstr "" "Project-Id-Version: gnome-bluetooth master\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" -"bluetooth&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2017-09-02 12:59+0000\n" -"PO-Revision-Date: 2017-09-04 15:03+0700\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-bluetooth/" +"issues\n" +"POT-Creation-Date: 2020-06-25 07:23+0000\n" +"PO-Revision-Date: 2021-03-23 08:31+0700\n" "Last-Translator: Trần Ngọc Quân \n" "Language-Team: Vietnamese \n" "Language: vi\n" @@ -26,7 +26,7 @@ msgid "Click to select device…" msgstr "Dùng chuột để chọn thiết bị…" -#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1275 +#: lib/bluetooth-chooser-button.c:201 lib/bluetooth-settings-widget.c:1281 #: sendto/main.c:447 sendto/main.c:738 sendto/main.c:794 msgid "_Cancel" msgstr "T_hôi" @@ -42,7 +42,7 @@ #: lib/bluetooth-chooser.c:176 msgid "No adapters available" -msgstr "Không có bộ điều hợp" +msgstr "Không sẵn có thiết bị nào" #: lib/bluetooth-chooser.c:180 lib/bluetooth-chooser.c:806 #: lib/bluetooth-settings-widget.c:1561 @@ -53,11 +53,11 @@ msgid "Device" msgstr "Thiết bị" -#: lib/bluetooth-chooser.c:734 lib/settings.ui:179 +#: lib/bluetooth-chooser.c:734 lib/settings.ui:182 msgid "Type" msgstr "Kiểu" -#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1524 +#: lib/bluetooth-chooser.c:990 lib/bluetooth-settings-widget.c:1518 msgid "Devices" msgstr "Thiết bị" @@ -65,7 +65,7 @@ msgid "All categories" msgstr "Mọi chủng loại" -#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:134 +#: lib/bluetooth-filter-widget.c:74 lib/settings.ui:135 msgid "Paired" msgstr "Đã kết đôi" @@ -195,16 +195,16 @@ msgstr "Gạt bỏ" #. Cancel button -#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:308 +#: lib/bluetooth-pairing-dialog.c:153 lib/bluetooth-pairing-dialog.c:306 msgid "Cancel" msgstr "Hủy bỏ" #. OK button -#: lib/bluetooth-pairing-dialog.c:289 lib/bluetooth-settings-obexpush.c:246 +#: lib/bluetooth-pairing-dialog.c:287 lib/bluetooth-settings-obexpush.c:247 msgid "Accept" msgstr "Chấp nhận" -#: lib/bluetooth-settings-row.c:79 lib/bluetooth-settings-row.ui:37 +#: lib/bluetooth-settings-row.c:79 lib/bluetooth-settings-row.ui:40 msgid "Not Set Up" msgstr "Chưa cài đặt" @@ -216,18 +216,18 @@ msgid "Disconnected" msgstr "Chưa kết nối" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1149 msgid "Yes" msgstr "Có" -#: lib/bluetooth-settings-widget.c:1143 +#: lib/bluetooth-settings-widget.c:1149 msgid "No" msgstr "Không" #. translators: first %s is the name of the computer, for example: #. * Visible as “Bastien Nocera’s Computer” followed by the #. * location of the Downloads folder. -#: lib/bluetooth-settings-widget.c:1243 +#: lib/bluetooth-settings-widget.c:1249 #, c-format msgid "" "Visible as “%s” and available for Bluetooth file transfers. Transferred " @@ -236,49 +236,49 @@ "Xuất hiện như là “%s” và sẵn sàng cho truyền các tập tin qua Bluetooth. Các " "tập tin đã truyền được đặt ở trong thư mục Tải về." -#: lib/bluetooth-settings-widget.c:1270 +#: lib/bluetooth-settings-widget.c:1276 #, c-format msgid "Remove “%s” from the list of devices?" msgstr "Xóa “%s” ra khỏi danh sách thiết bị?" -#: lib/bluetooth-settings-widget.c:1272 +#: lib/bluetooth-settings-widget.c:1278 msgid "" "If you remove the device, you will have to set it up again before next use." msgstr "" "Nếu bạn gỡ bỏ thiết bị, bạn sẽ phải cài đặt lại nó khi dùng nó lần sau." -#: lib/bluetooth-settings-widget.c:1276 +#: lib/bluetooth-settings-widget.c:1282 msgid "_Remove" msgstr "_Xóa bỏ" #. Translators: %s is the name of the filename received -#: lib/bluetooth-settings-obexpush.c:145 +#: lib/bluetooth-settings-obexpush.c:146 #, c-format msgid "You received “%s” via Bluetooth" msgstr "Bạn đã nhận \"%s\" thông qua Bluetooth" -#: lib/bluetooth-settings-obexpush.c:147 +#: lib/bluetooth-settings-obexpush.c:148 msgid "You received a file" msgstr "Bạn đã nhận một tập tin" -#: lib/bluetooth-settings-obexpush.c:158 +#: lib/bluetooth-settings-obexpush.c:159 msgid "Open File" msgstr "Mở tập tin" -#: lib/bluetooth-settings-obexpush.c:162 -msgid "Reveal File" -msgstr "Hiện tập tin" +#: lib/bluetooth-settings-obexpush.c:163 +msgid "Open Containing Folder" +msgstr "Mở thư mục chứa" -#: lib/bluetooth-settings-obexpush.c:179 +#: lib/bluetooth-settings-obexpush.c:180 msgid "File reception complete" msgstr "Hoàn tất nhận tập tin" -#: lib/bluetooth-settings-obexpush.c:233 +#: lib/bluetooth-settings-obexpush.c:234 #, c-format msgid "Bluetooth file transfer from %s" msgstr "Truyền tập tin qua Bluetooth từ %s" -#: lib/bluetooth-settings-obexpush.c:243 +#: lib/bluetooth-settings-obexpush.c:244 msgid "Decline" msgstr "Từ chối" @@ -367,27 +367,27 @@ msgid "Connection" msgstr "Kết nối" -#: lib/settings.ui:224 +#: lib/settings.ui:229 msgid "Address" msgstr "Địa chỉ" -#: lib/settings.ui:279 +#: lib/settings.ui:285 msgid "_Mouse & Touchpad Settings" msgstr "Cài đặt Ch_uột & Touchpad" -#: lib/settings.ui:293 +#: lib/settings.ui:299 msgid "_Sound Settings" msgstr "Cài đặt Â_m thanh" -#: lib/settings.ui:307 +#: lib/settings.ui:313 msgid "_Keyboard Settings" msgstr "Cài đặt _Bàn phím" -#: lib/settings.ui:321 +#: lib/settings.ui:327 msgid "Send _Files…" msgstr "Gửi _tập tin…" -#: lib/settings.ui:335 +#: lib/settings.ui:341 msgid "_Remove Device" msgstr "Đĩa _di động" @@ -399,11 +399,6 @@ msgid "Send files via Bluetooth" msgstr "Gửi tập tin thông qua Bluetooth" -#. Translators: Do NOT translate or transliterate this text (this is an icon file name)! -#: sendto/bluetooth-sendto.desktop.in.in:6 -msgid "bluetooth" -msgstr "bluetooth" - #: sendto/main.c:117 msgid "An unknown error occurred" msgstr "Đã gặp lỗi không xác định" @@ -528,6 +523,12 @@ msgid "[FILE…]" msgstr "[TẬP TIN…]" +#~ msgid "Reveal File" +#~ msgstr "Hiện tập tin" + +#~ msgid "bluetooth" +#~ msgstr "bluetooth" + #~ msgid "Visible as “%s”" #~ msgstr "Nhìn thấy là “%s”" diff -Nru gnome-bluetooth-3.34.3/README.md gnome-bluetooth-3.34.5/README.md --- gnome-bluetooth-3.34.3/README.md 2020-10-01 09:19:42.273874300 +0000 +++ gnome-bluetooth-3.34.5/README.md 2021-03-23 15:09:30.414372200 +0000 @@ -9,7 +9,7 @@ ------------ - glib -- bluez 5.x +- bluez 5.51 or newer - rfkill sub-system enable in the kernel[1] - gnome-settings-daemon diff -Nru gnome-bluetooth-3.34.3/tests/integration-test gnome-bluetooth-3.34.5/tests/integration-test --- gnome-bluetooth-3.34.3/tests/integration-test 1970-01-01 00:00:00.000000000 +0000 +++ gnome-bluetooth-3.34.5/tests/integration-test 2021-03-23 15:09:30.432372000 +0000 @@ -0,0 +1,202 @@ +#!/usr/bin/python3 + +# gnome-bluetooth integration test suite +# +# Copyright: (C) 2021 Bastien Nocera +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +import os +import sys +import dbus +import inspect +import tempfile +import subprocess +import unittest +import time + +try: + import gi + from gi.repository import GLib + from gi.repository import Gio + + gi.require_version('Gtk', '3.0') + from gi.repository import Gtk +except ImportError as e: + sys.stderr.write('Skipping tests, PyGobject not available for Python 3, or missing GI typelibs: %s\n' % str(e)) + sys.exit(0) + +try: + gi.require_version('GIRepository', '2.0') + from gi.repository import GIRepository + builddir = os.getenv('top_builddir', '.') + GIRepository.Repository.prepend_library_path(builddir + '/lib/') + GIRepository.Repository.prepend_search_path(builddir + '/lib/') + + gi.require_version('GnomeBluetoothPriv', '1.0') + from gi.repository import GnomeBluetoothPriv +except ImportError as e: + sys.stderr.write('Could not find GnomeBluetoothPriv gobject-introspection data in the build dir: %s\n' % str(e)) + sys.exit(1) + +try: + import dbusmock +except ImportError: + sys.stderr.write('Skipping tests, python-dbusmock not available (http://pypi.python.org/pypi/python-dbusmock).\n') + sys.exit(0) + +# Out-of-process tests +class OopTests(dbusmock.DBusTestCase): + @classmethod + def setUp(self): + self.client = GnomeBluetoothPriv.Client.new() + # used in test_pairing + self.paired = False + + def print_tree(self, model): + def print_row(model, treepath, treeiter): + print("\t" * (treepath.get_depth() - 1), model[treeiter][:], sep="") + model.foreach(print_row) + + def wait_for_mainloop(self): + ml = GLib.MainLoop() + GLib.timeout_add_seconds(1, ml.quit) + ml.run() + + def wait_for_condition(self, condition): + ctx = GLib.main_context_default() + while not condition(): + ctx.iteration(True) + + def test_no_adapters(self): + adapters = self.client.get_adapter_model() + self.wait_for_mainloop() + self.assertEqual(len(adapters), 0) + + def test_one_adapter(self): + adapters = self.client.get_adapter_model() + self._row_inserted = False + + def adapters_row_inserted_cb(model, path, _iter): + self._row_inserted = True + adapters.connect('row-inserted', adapters_row_inserted_cb) + + self.wait_for_condition(lambda: self._row_inserted == True) + + self.assertEqual(len(adapters), 1) + + def _pair_cb(self, client, result, user_data=None): + success, path = client.setup_device_finish(result) + self.assertEqual(success, True) + address = '11:22:33:44:55:66' + self.assertEqual(path, '/org/bluez/hci0/dev_' + address.replace(':', '_')) + self.paired = True + + def test_pairing(self): + adapters = self.client.get_adapter_model() + self._row_inserted = False + + def adapters_row_inserted_cb(model, path, _iter): + self._row_inserted = True + adapters.connect('row-inserted', adapters_row_inserted_cb) + + self.wait_for_condition(lambda: self._row_inserted == True) + + self.assertEqual(len(adapters), 1) + + devices = self.client.get_device_model() + self.assertEqual(len(devices), 1) + + # Get first device + path = Gtk.TreePath([0]) + treeiter = devices.get_iter(path) + self.assertEqual(devices.get_value(treeiter, GnomeBluetoothPriv.Column.ADDRESS), '11:22:33:44:55:66') + self.assertEqual(devices.get_value(treeiter, GnomeBluetoothPriv.Column.PAIRED), False) + + proxy = devices.get_value(treeiter, GnomeBluetoothPriv.Column.PROXY) + self.client.setup_device (proxy.get_object_path(), + True, + None, + self._pair_cb) + self.wait_for_condition(lambda: self.paired == True) + self.assertEqual(self.paired, True) + + treeiter = devices.get_iter(path) + self.assertEqual(devices.get_value(treeiter, GnomeBluetoothPriv.Column.PAIRED), True) + self.assertEqual(devices.get_value(treeiter, GnomeBluetoothPriv.Column.ICON), 'phone') + + def test_agent(self): + agent = GnomeBluetoothPriv.Agent.new ('/org/gnome/bluetooth/integration_test') + self.assertIsNotNone(agent) + # Process D-Bus daemon appearing and agent being registered + self.wait_for_mainloop() + self.assertTrue(agent.register()) + self.assertTrue(agent.unregister()) + +class Tests(dbusmock.DBusTestCase): + + @classmethod + def setUpClass(cls): + os.environ['G_MESSAGES_DEBUG'] = 'all' + os.environ['G_DEBUG'] = 'fatal_warnings' + cls.start_system_bus() + cls.dbus_con = cls.get_dbus(True) + (cls.p_mock, cls.obj_bluez) = cls.spawn_server_template( + 'bluez5', {}, stdout=subprocess.PIPE) + + cls.exec_path = [sys.argv[0]] + if os.getenv('VALGRIND') != None: + cls.exec_path = ['valgrind'] + cls.exec_path + + @classmethod + def tearDownClass(cls): + cls.p_mock.stdout.close() + cls.p_mock.terminate() + cls.p_mock.wait() + + def setUp(self): + self.obj_bluez.Reset() + self.dbusmock = dbus.Interface(self.obj_bluez, dbusmock.MOCK_IFACE) + self.dbusmock_bluez = dbus.Interface(self.obj_bluez, 'org.bluez.Mock') + + def run_test_process(self): + # Get the calling function's name + test_name = inspect.stack()[1][3] + # And run the test with the same name in the OopTests class in a separate process + out = subprocess.run(self.exec_path + ['OopTests.' + test_name], capture_output=True) + self.assertEqual(out.returncode, 0, "Running test " + test_name + " failed:" + out.stderr.decode('UTF-8')) + if os.getenv('VALGRIND') != None: + print(out.stderr.decode('UTF-8')) + + def test_no_adapters(self): + self.run_test_process() + + def test_one_adapter(self): + self.dbusmock_bluez.AddAdapter('hci0', 'my-computer') + self.run_test_process() + + def test_pairing(self): + adapter_name = 'hci0' + self.dbusmock_bluez.AddAdapter(adapter_name, 'my-computer') + + address = '11:22:33:44:55:66' + alias = 'My Phone' + + path = self.dbusmock_bluez.AddDevice(adapter_name, address, alias) + self.assertEqual(path, '/org/bluez/' + adapter_name + '/dev_' + address.replace(':', '_')) + + self.run_test_process() + + def test_agent(self): + self.run_test_process() + +if __name__ == '__main__': + unittest.main() diff -Nru gnome-bluetooth-3.34.3/tests/meson.build gnome-bluetooth-3.34.5/tests/meson.build --- gnome-bluetooth-3.34.3/tests/meson.build 1970-01-01 00:00:00.000000000 +0000 +++ gnome-bluetooth-3.34.5/tests/meson.build 2021-03-23 15:09:30.432372000 +0000 @@ -0,0 +1,14 @@ +integration_test = find_program('integration-test') + +envs = environment() +envs.set ('top_builddir', meson.build_root()) +envs.set ('top_srcdir', meson.source_root()) + +test_deps = [ gnomebt_priv_gir, ] + +test('gnome-bluetooth-integration-test', + integration_test, + args: [ 'Tests' ], + env: envs, + depends: test_deps +)