gui: Remove ActionList typedef

This typedef just introduces an additional layer of indirection to
understand code.
This commit is contained in:
Povilas Kanapickas 2021-01-10 14:13:43 +02:00
parent 5cc18ac595
commit ac60e620ba
3 changed files with 7 additions and 7 deletions

View File

@ -87,8 +87,6 @@ class Action
static const char* m_LockCursorModeNames[];
};
typedef QList<Action> ActionList;
QTextStream& operator<<(QTextStream& outStream, const Action& action);
#endif

View File

@ -47,7 +47,7 @@ void Hotkey::loadSettings(QSettings& settings)
settings.setArrayIndex(i);
Action a;
a.loadSettings(settings);
m_Actions.append(a);
m_Actions.push_back(a);
}
settings.endArray();

View File

@ -27,6 +27,8 @@
#include "Action.h"
#include "KeySequence.h"
#include <vector>
class HotkeyDialog;
class ServerConfigDialog;
class QSettings;
@ -40,10 +42,10 @@ class Hotkey
const KeySequence& keySequence() const { return m_KeySequence; }
void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; }
const ActionList& actions() const { return m_Actions; }
void appendAction(const Action& action) { m_Actions.append(action); }
const std::vector<Action>& actions() const { return m_Actions; }
void appendAction(const Action& action) { m_Actions.push_back(action); }
void setAction(int index, const Action& action) { m_Actions[index] = action; }
void removeAction(int index) { m_Actions.removeAt(index); }
void removeAction(int index) { m_Actions.erase(m_Actions.begin() + index); }
void loadSettings(QSettings& settings);
void saveSettings(QSettings& settings) const;
@ -51,7 +53,7 @@ class Hotkey
private:
KeySequence m_KeySequence;
ActionList m_Actions;
std::vector<Action> m_Actions;
};
typedef QList<Hotkey> HotkeyList;