Skip to content

Commit a7acefb

Browse files
Ignore location string when loading profiles for HID devices
1 parent d19baf1 commit a7acefb

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

ProfileManager.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,28 @@ bool ProfileManager::LoadDeviceFromListWithOptions
171171
{
172172
RGBController *temp_controller = temp_controllers[temp_index];
173173

174+
/*---------------------------------------------------------*\
175+
| Do not compare location string for HID devices, as the |
176+
| location string may change between runs as devices are |
177+
| connected and disconnected |
178+
\*---------------------------------------------------------*/
179+
bool compare_location = true;
180+
181+
if(load_controller->location.find("HID: ") == 0)
182+
{
183+
compare_location = false;
184+
}
185+
174186
/*---------------------------------------------------------*\
175187
| Test if saved controller data matches this controller |
176188
\*---------------------------------------------------------*/
177-
if((temp_controller_used[temp_index] == false )
178-
&&(temp_controller->type == load_controller->type )
179-
&&(temp_controller->name == load_controller->name )
180-
&&(temp_controller->description == load_controller->description)
181-
&&(temp_controller->version == load_controller->version )
182-
&&(temp_controller->serial == load_controller->serial )
183-
&&(temp_controller->location == load_controller->location ))
189+
if((temp_controller_used[temp_index] == false )
190+
&&(temp_controller->type == load_controller->type )
191+
&&(temp_controller->name == load_controller->name )
192+
&&(temp_controller->description == load_controller->description )
193+
&&(temp_controller->version == load_controller->version )
194+
&&(temp_controller->serial == load_controller->serial )
195+
&&((temp_controller->location == load_controller->location ) || (!compare_location)))
184196
{
185197
/*---------------------------------------------------------*\
186198
| Update zone sizes if requested |

0 commit comments

Comments
 (0)