mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
kglobalaccel: correct check for invalid key sequences in keysFromString() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7d79ee3af0
commit
57201e863c
1 changed files with 4 additions and 3 deletions
|
@ -41,8 +41,9 @@ static QList<int> keysFromString(const QString &str)
|
|||
}
|
||||
const QStringList strList = str.split('\t');
|
||||
foreach (const QString &s, strList) {
|
||||
int key = QKeySequence(s)[0];
|
||||
if (key != -1) { //sanity check just in case
|
||||
const int key = QKeySequence(s)[0];
|
||||
if (key != 0) {
|
||||
// sanity check just in case
|
||||
ret.append(key);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +57,7 @@ static QString stringFromKeys(const QList<int> &keys)
|
|||
return QString::fromLatin1("none");
|
||||
}
|
||||
QString ret;
|
||||
foreach (int key, keys) {
|
||||
foreach (const int key, keys) {
|
||||
ret.append(QKeySequence(key).toString());
|
||||
ret.append('\t');
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue