qt/hotkey: Get rid of global hotkey map instance

Instead, we make a proper registry class and house it within the main
window, then pass it to whatever needs access to the loaded hotkeys.

This way, we avoid a global variable, and don't need to initialize a
std::map instance before the program can do anything.
This commit is contained in:
Lioncash
2018-08-07 00:43:07 -04:00
parent 826b1394e8
commit c8f6754417
8 changed files with 155 additions and 115 deletions

View File

@ -7,6 +7,8 @@
#include <memory>
#include <QWidget>
class HotkeyRegistry;
namespace Ui {
class ConfigureGeneral;
}
@ -18,11 +20,11 @@ public:
explicit ConfigureGeneral(QWidget* parent = nullptr);
~ConfigureGeneral();
void PopulateHotkeyList(const HotkeyRegistry& registry);
void applyConfiguration();
private:
void setConfiguration();
private:
std::unique_ptr<Ui::ConfigureGeneral> ui;
};