DeviceManager::DeviceError DevicePluginMock::discoverDevices(const DeviceClassId &deviceClassId, const ParamList ¶ms) { Q_UNUSED(deviceClassId) qCDebug(dcMock) << "starting mock discovery:" << params; m_discoveredDeviceCount = params.paramValue("resultCount").toInt(); QTimer::singleShot(1000, this, SLOT(emitDevicesDiscovered())); return DeviceManager::DeviceErrorAsync; }
DeviceManager::DeviceError DevicePluginDateTime::discoverDevices(const DeviceClassId &deviceClassId, const ParamList ¶ms) { Q_UNUSED(deviceClassId); QList<DeviceDescriptor> deviceDescriptors; foreach (QByteArray timeZone, QTimeZone::availableTimeZoneIds()) { QByteArray continent = params.paramValue("continent").toByteArray(); if(timeZone.contains(continent)){ DeviceDescriptor descriptor(dateTimeDeviceClassId, timeZone.right(timeZone.length() - (continent.length() + 1)), continent); ParamList params; params.append(Param("timezone", timeZone)); descriptor.setParams(params); deviceDescriptors.append(descriptor); } }