Esempio n. 1
0
void mhwd::updateInstalledConfigData(mhwd::Data *data) {
    // Clear config vectors in each device element
    for (std::vector<mhwd::Device*>::iterator iterator = data->PCIDevices.begin(); iterator != data->PCIDevices.end(); iterator++) {
        (*iterator)->installedConfigs.clear();
    }

    for (std::vector<mhwd::Device*>::iterator iterator = data->USBDevices.begin(); iterator != data->USBDevices.end(); iterator++) {
        (*iterator)->installedConfigs.clear();
    }


    // Clear installed config vectors
    std::for_each(data->installedPCIConfigs.begin(), data->installedPCIConfigs.end(), delete_ptr<mhwd::Config>());
    std::for_each(data->installedUSBConfigs.begin(), data->installedUSBConfigs.end(), delete_ptr<mhwd::Config>());

    data->installedPCIConfigs.clear();
    data->installedUSBConfigs.clear();


    // Refill data
    fillInstalledConfigs(data, mhwd::TYPE_PCI);
    fillInstalledConfigs(data, mhwd::TYPE_USB);

    setMatchingConfigs(&data->PCIDevices, &data->installedPCIConfigs, true);
    setMatchingConfigs(&data->USBDevices, &data->installedUSBConfigs, true);
}
Esempio n. 2
0
void Data::updateInstalledConfigData()
{
	// Clear config vectors in each device element
	for (std::vector<Device*>::iterator PCIDevice = PCIDevices.begin();
			PCIDevice != PCIDevices.end(); PCIDevice++)
	{
		(*PCIDevice)->installedConfigs.clear();
	}

	for (std::vector<Device*>::iterator USBDevice = USBDevices.begin();
			USBDevice != USBDevices.end(); USBDevice++)
	{
		(*USBDevice)->installedConfigs.clear();
	}

	// Clear installed config vectors
	for (auto PCIConfig : installedPCIConfigs)
	{
		delete PCIConfig;
		PCIConfig = nullptr;
	}

	for (auto USBConfig : installedUSBConfigs)
	{
		delete USBConfig;
		USBConfig = nullptr;
	}

	installedPCIConfigs.clear();
	installedUSBConfigs.clear();

	// Refill data
	fillInstalledConfigs(MHWD::DEVICETYPE::PCI);
	fillInstalledConfigs(MHWD::DEVICETYPE::USB);

	setMatchingConfigs(&PCIDevices, &installedPCIConfigs, true);
	setMatchingConfigs(&USBDevices, &installedUSBConfigs, true);
}