Codechange: Add const versions of GetItem/GetGroup, and sprinkle liberally.

Non-const version of GetItem is not needed.
This commit is contained in:
Peter Nelson
2023-10-11 00:38:57 +01:00
committed by Peter Nelson
parent 17ba9d8c96
commit 69e20e79ab
10 changed files with 73 additions and 58 deletions

View File

@@ -274,12 +274,12 @@ HotkeyList::~HotkeyList()
* Load HotkeyList from IniFile.
* @param ini IniFile to load from.
*/
void HotkeyList::Load(IniFile &ini)
void HotkeyList::Load(const IniFile &ini)
{
IniGroup *group = ini.GetGroup(this->ini_group);
const IniGroup *group = ini.GetGroup(this->ini_group);
if (group == nullptr) return;
for (Hotkey &hotkey : this->items) {
IniItem *item = group->GetItem(hotkey.name);
const IniItem *item = group->GetItem(hotkey.name);
if (item != nullptr) {
hotkey.keycodes.clear();
if (item->value.has_value()) ParseHotkeys(hotkey, item->value->c_str());