From 6c08f53d1bd5846c5cd88d82cbdc2198d591b7cb Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 8 Jun 2013 18:17:53 -0700 Subject: [PATCH] Delete pre-3.0.0 hotkey migrations --- aegisub/src/hotkey.cpp | 58 ------------------------------------------ 1 file changed, 58 deletions(-) diff --git a/aegisub/src/hotkey.cpp b/aegisub/src/hotkey.cpp index 6eda10c4f..76cc4227d 100644 --- a/aegisub/src/hotkey.cpp +++ b/aegisub/src/hotkey.cpp @@ -29,24 +29,6 @@ #include namespace { - const char *removed_commands_6294[] = { - "edit/line/swap", - "grid/swap/up", - "grid/swap/down", - "time/sort/end", - "time/sort/start", - "time/sort/style", - 0 - }; - - const char *added_hotkeys_6294[][4] = { - { "grid/move/down", "Default", "Alt", "Down" }, - { "grid/move/up", "Default", "Alt", "Up" }, - { "grid/line/next/create", "Subtitle Edit Box", "Enter", 0 }, - { "grid/line/next/create", "Subtitle Edit Box", "KP_Enter", 0 }, - { 0 } - }; - const char *removed_commands_7035[] = { 0 }; const char *added_hotkeys_7035[][4] = { { "audio/play/line", "Audio", "R", 0 }, @@ -81,42 +63,6 @@ namespace { hotkey::inst->SetHotkeyMap(hk_map); } - - const char *renamed_commands[][2] = { - { "timing shift start backward", "time/start/decrease" }, - { "timing shift start forward", "time/start/increase" }, - { "timing shift end backward", "time/length/decrease" }, - { "timing shift end forward", "time/length/increase" }, - - { "timing karaoke decrease length" , "time/length/decrease" }, - { "timing karaoke increase length" , "time/length/increase" }, - { "timing karaoke decrease length and shift following" , "time/length/decrease/shift" }, - { "timing karaoke increase length and shift following" , "time/length/increase/shift" }, - { 0, 0} - }; - - void rename_commands() { - std::map name_map; - for (size_t i = 0; renamed_commands[i][0]; ++i) - name_map[renamed_commands[i][0]] = renamed_commands[i][1]; - - bool renamed_any = false; - auto hk_map = hotkey::inst->GetHotkeyMap(); - for (auto it = hk_map.begin(); it != hk_map.end(); ) { - auto ren = name_map.find(it->first); - if (ren != name_map.end()) { - hk_map.insert(make_pair(std::string(ren->second), - agi::hotkey::Combo(it->second.Context(), ren->second, it->second.Get()))); - hk_map.erase(it++); - renamed_any = true; - } - else - ++it; - } - - if (renamed_any) - hotkey::inst->SetHotkeyMap(hk_map); - } } namespace hotkey { @@ -128,10 +74,6 @@ void init() { GET_DEFAULT_CONFIG(default_hotkey)); int last_version = OPT_GET("Version/Last Version")->GetInt(); - if (last_version < 6294) - migrate_hotkeys(removed_commands_6294, added_hotkeys_6294); - if (last_version < 6933) - rename_commands(); if (last_version < 7035) migrate_hotkeys(removed_commands_7035, added_hotkeys_7035); if (last_version < 7070)