| 1120 | } |
| 1121 | |
| 1122 | bool CommandManager::HandleXMLTag(const std::string_view& tag, const AttributesList &attrs) |
| 1123 | { |
| 1124 | if (tag == "audacitykeyboard") { |
| 1125 | mXMLKeysRead = 0; |
| 1126 | } |
| 1127 | |
| 1128 | if (tag == "command") { |
| 1129 | wxString name; |
| 1130 | NormalizedKeyString key; |
| 1131 | |
| 1132 | for (auto pair : attrs) |
| 1133 | { |
| 1134 | auto attr = pair.first; |
| 1135 | auto value = pair.second; |
| 1136 | |
| 1137 | if (value.IsStringView()) |
| 1138 | { |
| 1139 | const wxString strValue = value.ToWString(); |
| 1140 | |
| 1141 | if (attr == "name") |
| 1142 | name = strValue; |
| 1143 | else if (attr == "key") |
| 1144 | key = NormalizedKeyString{ strValue }; |
| 1145 | } |
| 1146 | } |
| 1147 | |
| 1148 | if (auto iter = mCommandNameHash.find(name); |
| 1149 | iter != mCommandNameHash.end() |
| 1150 | ) { |
| 1151 | iter->second->key = key; |
| 1152 | ++mXMLKeysRead; |
| 1153 | } |
| 1154 | } |
| 1155 | |
| 1156 | return true; |
| 1157 | } |
| 1158 | |
| 1159 | // This message is displayed now in KeyConfigPrefs::OnImport() |
| 1160 | void CommandManager::HandleXMLEndTag(const std::string_view& tag) |
nothing calls this directly
no test coverage detected