gui: Remove unnecessary accessor to private member in KeySequence

This commit is contained in:
Povilas Kanapickas 2021-01-07 23:43:53 +02:00
parent 3f387bdad0
commit 1c434df87a
2 changed files with 4 additions and 5 deletions

View File

@ -152,12 +152,12 @@ bool KeySequence::appendKey(int key, int modifiers)
void KeySequence::loadSettings(QSettings& settings)
{
sequence().clear();
m_Sequence.clear();
int num = settings.beginReadArray("keys");
for (int i = 0; i < num; i++)
{
settings.setArrayIndex(i);
sequence().append(settings.value("key", 0).toInt());
m_Sequence.append(settings.value("key", 0).toInt());
}
settings.endArray();
@ -168,10 +168,10 @@ void KeySequence::loadSettings(QSettings& settings)
void KeySequence::saveSettings(QSettings& settings) const
{
settings.beginWriteArray("keys");
for (int i = 0; i < sequence().size(); i++)
for (int i = 0; i < m_Sequence.size(); i++)
{
settings.setArrayIndex(i);
settings.setValue("key", sequence()[i]);
settings.setValue("key", m_Sequence[i]);
}
settings.endArray();
}

View File

@ -44,7 +44,6 @@ class KeySequence
private:
void setValid(bool b) { m_IsValid = b; }
void setModifiers(int i) { m_Modifiers = i; }
QList<int>& sequence() { return m_Sequence; }
private:
QList<int> m_Sequence;