From a7b6ef9e2197e3184ccf9d64ab9681d5cfbfd5b5 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Thu, 26 Jan 2023 23:07:30 -0600 Subject: [PATCH] Remove redundant code that is no longer necessary with all controllers being registered via RegisterRGBController() --- ResourceManager.cpp | 77 --------------------------------------------- 1 file changed, 77 deletions(-) diff --git a/ResourceManager.cpp b/ResourceManager.cpp index 0c9c8939..5e960bd0 100644 --- a/ResourceManager.cpp +++ b/ResourceManager.cpp @@ -1035,28 +1035,6 @@ void ResourceManager::DetectDevicesThreadFunction() } } - /*-------------------------------------------------*\ - | If the device list size has changed, call the | - | device list changed callbacks | - \*-------------------------------------------------*/ - if(rgb_controllers_hw.size() != detection_prev_size) - { - /*-------------------------------------------------*\ - | First, load sizes for the new controllers | - \*-------------------------------------------------*/ - for(unsigned int controller_size_idx = detection_prev_size; controller_size_idx < rgb_controllers_hw.size(); controller_size_idx++) - { - profile_manager->LoadDeviceFromListWithOptions(rgb_controllers_sizes, detection_size_entry_used, rgb_controllers_hw[controller_size_idx], true, false); - } - - UpdateDeviceList(); - } - else - { - LOG_DEBUG("[%s] no devices found", detection_string); - } - detection_prev_size = rgb_controllers_hw.size(); - LOG_TRACE("[%s] detection end", detection_string); /*-------------------------------------------------*\ @@ -1131,28 +1109,6 @@ void ResourceManager::DetectDevicesThreadFunction() hid_device_detectors[hid_detector_idx].function(current_hid_device, hid_device_detectors[hid_detector_idx].name); - /*-------------------------------------------------*\ - | If the device list size has changed, call the | - | device list changed callbacks | - \*-------------------------------------------------*/ - if(rgb_controllers_hw.size() != detection_prev_size) - { - /*-------------------------------------------------*\ - | First, load sizes for the new controllers | - \*-------------------------------------------------*/ - for(unsigned int controller_size_idx = detection_prev_size; controller_size_idx < rgb_controllers_hw.size(); controller_size_idx++) - { - profile_manager->LoadDeviceFromListWithOptions(rgb_controllers_sizes, detection_size_entry_used, rgb_controllers_hw[controller_size_idx], true, false); - } - - UpdateDeviceList(); - } - else - { - LOG_DEBUG("[%s] no devices found", detection_string); - } - detection_prev_size = rgb_controllers_hw.size(); - LOG_TRACE("[%s] detection end", detection_string); } } @@ -1223,15 +1179,6 @@ void ResourceManager::DetectDevicesThreadFunction() DetectionProgressChanged(); hid_device_detectors[hid_detector_idx].function(current_hid_device, hid_device_detectors[hid_detector_idx].name); - - if(rgb_controllers_hw.size() != detection_prev_size) - { - LOG_VERBOSE("[%s] successfully added", detection_string); - } - else - { - LOG_INFO("[%s] is not initialized", detection_string); - } } } } @@ -1275,15 +1222,6 @@ void ResourceManager::DetectDevicesThreadFunction() DetectionProgressChanged(); hid_wrapped_device_detectors[hid_detector_idx].function(default_wrapper, current_hid_device, hid_wrapped_device_detectors[hid_detector_idx].name); - - if(rgb_controllers_hw.size() != detection_prev_size) - { - LOG_VERBOSE("[%s] successfully added", detection_string); - } - else - { - LOG_INFO("[%s] is not initialized", detection_string); - } } } } @@ -1400,15 +1338,6 @@ void ResourceManager::DetectDevicesThreadFunction() DetectionProgressChanged(); hid_wrapped_device_detectors[hid_detector_idx].function(wrapper, current_hid_device, hid_wrapped_device_detectors[hid_detector_idx].name); - - if(rgb_controllers_hw.size() != detection_prev_size) - { - LOG_VERBOSE("[%s] successfully added", detection_string); - } - else - { - LOG_INFO("[%s] is not initialized", detection_string); - } } } } @@ -1464,12 +1393,6 @@ void ResourceManager::DetectDevicesThreadFunction() device_detectors[detector_idx](); } - if(rgb_controllers_hw.size() == detection_prev_size) - { - LOG_DEBUG("[%s] no devices found", detection_string); - } - detection_prev_size = rgb_controllers_hw.size(); - LOG_TRACE("[%s] detection end", detection_string); /*-------------------------------------------------*\