Skip to content

Commit

Permalink
GCMemcardManager: Shorten-up EnumMap definitions
Browse files Browse the repository at this point in the history
We can make a small alias that gets rid of the need to repeat the long
constant.
  • Loading branch information
lioncash committed Jun 8, 2023
1 parent 1044bc4 commit 349add0
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Source/Core/DolphinQt/GCMemcardManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ class GCMemcardManager : public QDialog
QPushButton* m_fix_checksums_button;

// Slots
Common::EnumMap<std::map<u8, IconAnimationData>, ExpansionInterface::MAX_MEMCARD_SLOT>
m_slot_active_icons;
Common::EnumMap<std::unique_ptr<Memcard::GCMemcard>, ExpansionInterface::MAX_MEMCARD_SLOT>
m_slot_memcard;
Common::EnumMap<QGroupBox*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_group;
Common::EnumMap<QLineEdit*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_file_edit;
Common::EnumMap<QPushButton*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_open_button;
Common::EnumMap<QPushButton*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_create_button;
Common::EnumMap<QTableWidget*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_table;
Common::EnumMap<QLabel*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_stat_label;
template <typename T>
using SlotEnumMap = Common::EnumMap<T, ExpansionInterface::MAX_MEMCARD_SLOT>;

SlotEnumMap<std::map<u8, IconAnimationData>> m_slot_active_icons;
SlotEnumMap<std::unique_ptr<Memcard::GCMemcard>> m_slot_memcard;
SlotEnumMap<QGroupBox*> m_slot_group;
SlotEnumMap<QLineEdit*> m_slot_file_edit;
SlotEnumMap<QPushButton*> m_slot_open_button;
SlotEnumMap<QPushButton*> m_slot_create_button;
SlotEnumMap<QTableWidget*> m_slot_table;
SlotEnumMap<QLabel*> m_slot_stat_label;

ExpansionInterface::Slot m_active_slot;
u64 m_current_frame = 0;
Expand Down

0 comments on commit 349add0

Please sign in to comment.