Commit b4223f51 authored by Marco Esposito's avatar Marco Esposito Committed by Fabian Vogt
Browse files

Make the Keyboard KCM config spare layout spinbox enable the Save button (Fixes #36)

Now the keyboard settings also save the reference loop count to compare to the current value


(cherry picked from commit 91e0ee0c)
parent 1738278c
Pipeline #196626 passed with stage
in 4 minutes and 52 seconds
......@@ -25,6 +25,7 @@ static KeyboardConfig::SwitchingPolicy findStringIndex(const QString &toFind, Ke
KeyboardConfig::KeyboardConfig(QObject *parent)
: KeyboardSettingsBase(parent)
, m_referenceLayoutLoopCount(mLayoutLoopCount)
{
layouts.clear();
}
......@@ -49,6 +50,10 @@ bool KeyboardConfig::layoutsSaveNeeded() const
if (layouts.size() != m_referenceLayouts.size()) {
return true;
}
if (mLayoutLoopCount != m_referenceLayoutLoopCount) {
return true;
}
// Due to layoutUnit operator==() that does not test all properties.
// Do not compare shortcuts, they are automatically applied
bool isSaveNeeded = false;
......@@ -96,6 +101,7 @@ void KeyboardConfig::load()
// layouts' shortcuts are retrieved from GlobalShortcuts in KCMKeyboardWidget
m_referenceLayouts = layouts;
m_referenceLayoutLoopCount = mLayoutLoopCount;
qCDebug(KCM_KEYBOARD) << "configuring layouts" << configureLayouts() << "configuring options" << resetOldXkbOptions();
}
......@@ -103,6 +109,7 @@ void KeyboardConfig::load()
void KeyboardConfig::save()
{
m_referenceLayouts = layouts;
m_referenceLayoutLoopCount = mLayoutLoopCount;
QStringList layoutList;
QStringList variants;
......
......@@ -56,6 +56,7 @@ public:
private:
QList<LayoutUnit> m_referenceLayouts;
int m_referenceLayoutLoopCount;
};
#endif /* KEYBOARD_CONFIG_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment