- if (path != NULL) {
- DBusError error;
- DBusConnection *conn;
- DBusMessage *adapterMsg = dbus_message_new_method_call ("org.bluez", path,
- "org.bluez.Adapter",
- "GetProperties");
-
- conn = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
-
- if (conn) {
- DBusMessage *msg;
-
- dbus_error_init (&error);
- msg = dbus_connection_send_with_reply_and_block (conn, adapterMsg, -1, &error);
- if (msg) {
- g_debug ("Getting the properties");
- get_properties_cb (msg);
- dbus_message_unref (msg);
- }
- dbus_connection_unref (conn);
- }
- dbus_message_unref (adapterMsg);
- } else {
- g_warning ("Failed to get the default bluetooth adapter");
+
+ if (!path)
+ return;
+
+ adapterMsg = dbus_message_new_method_call ("org.bluez", path,
+ "org.bluez.Adapter",
+ "GetProperties");
+
+ dbus_error_init (&error);
+ msg = dbus_connection_send_with_reply_and_block (conn, adapterMsg, -1, &error);
+ if (msg) {
+ g_debug ("Getting the properties");
+ get_properties_cb (msg);
+ dbus_message_unref (msg);