| 256 | } |
| 257 | |
| 258 | void CAccelerator::LoadShortcuts(CSettings *pSettings) |
| 259 | { |
| 260 | auto *App = FTEnv.GetMainApp(); // // // |
| 261 | |
| 262 | // Set up names and default values |
| 263 | LoadDefaults(); |
| 264 | |
| 265 | m_iUsedKeys.clear(); // // // |
| 266 | |
| 267 | // Load custom values, if exists |
| 268 | /* |
| 269 | location priorities: |
| 270 | 1. HKCU/SOFTWARE/0CC-FamiTracker |
| 271 | 1. HKCU/SOFTWARE/0CC-FamiTracker, original key |
| 272 | 2. HKCU/SOFTWARE/FamiTracker |
| 273 | 3. HKCU/SOFTWARE/FamiTracker, original key (using stAccelEntry::orig_name) |
| 274 | 4. default value |
| 275 | */ |
| 276 | for (auto &x : m_pEntriesTable) { // // // |
| 277 | int Setting = (x.mod << 8) | x.key; |
| 278 | { // // // |
| 279 | stOldSettingContext s; |
| 280 | if (x.orig_name != nullptr) // // // |
| 281 | Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.orig_name, Setting); |
| 282 | Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.name, Setting); |
| 283 | } |
| 284 | if (x.orig_name != nullptr) // // // |
| 285 | Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.orig_name, Setting); |
| 286 | Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.name, Setting); |
| 287 | |
| 288 | x.key = Setting & 0xFF; |
| 289 | x.mod = Setting >> 8; |
| 290 | if (!x.mod && x.key) // // // |
| 291 | m_iUsedKeys.insert(x.key); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | void CAccelerator::LoadDefaults() |
| 296 | { |
no test coverage detected