device: Combine two if statements with identical outcome
[framework/connectivity/connman.git] / src / technology.c
index 30a9f4d..635c7b0 100644 (file)
@@ -831,7 +831,7 @@ void __connman_technology_scan_stopped(struct connman_device *device)
                if (__connman_device_get_service_type(other_device) != type)
                        continue;
 
-               if (__connman_device_scanning(other_device))
+               if (connman_device_get_scanning(other_device) == TRUE)
                        count += 1;
        }
 
@@ -859,16 +859,19 @@ static DBusMessage *scan(DBusConnection *conn, DBusMessage *msg, void *data)
 }
 
 static const GDBusMethodTable technology_methods[] = {
-       { "GetProperties", "",   "a{sv}", get_properties,
-                                               G_DBUS_METHOD_FLAG_DEPRECATED },
-       { "SetProperty",   "sv", "",      set_property   },
-       { "Scan",          "",    "",     scan,
-                                               G_DBUS_METHOD_FLAG_ASYNC },
+       { GDBUS_DEPRECATED_METHOD("GetProperties",
+                       NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+                       get_properties) },
+       { GDBUS_METHOD("SetProperty",
+                       GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
+                       NULL, set_property) },
+       { GDBUS_ASYNC_METHOD("Scan", NULL, NULL, scan) },
        { },
 };
 
 static const GDBusSignalTable technology_signals[] = {
-       { "PropertyChanged", "sv" },
+       { GDBUS_SIGNAL("PropertyChanged",
+                       GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
        { },
 };
 
@@ -1098,9 +1101,6 @@ int __connman_technology_remove_device(struct connman_device *device)
                return -ENXIO;
        }
 
-       if (__connman_device_scanning(device))
-               __connman_technology_scan_stopped(device);
-
        technology->device_list = g_slist_remove(technology->device_list,
                                                                device);
        technology_put(technology);