mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kglobalaccel: use QMutableListIterator<T>() for iteration in Component::loadSettings()
fixes possbile crash Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
982fc92539
commit
09c31e98dc
1 changed files with 4 additions and 2 deletions
|
@ -324,12 +324,14 @@ void Component::loadSettings(KConfigGroup &configGroup)
|
|||
shortcut->setDefaultKeys(keysFromString(entry[1]));
|
||||
shortcut->setIsFresh(false);
|
||||
|
||||
Q_FOREACH (int key, keys) {
|
||||
QMutableListIterator<int> keysit(keys);
|
||||
while (keysit.hasNext()) {
|
||||
int key = keysit.next();
|
||||
if (key != 0) {
|
||||
if (GlobalShortcutsRegistry::self()->getShortcutByKey(key)) {
|
||||
// The shortcut is already used. The config file is
|
||||
// broken. Ignore the request.
|
||||
keys.removeAll(key);
|
||||
keysit.remove();
|
||||
kWarning() << "Shortcut found twice in kglobalshortcutsrc.";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue