summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-03-20 11:31:41 +0100
committerhjk <hjk@theqtcompany.com>2015-03-24 15:12:48 +0000
commit2eb15f030c006e9f586e0adaf79ef685ca85a286 (patch)
tree66b75816072fc137e6c1413c4eb91b225c211ce6
parent161c07f60545125f94055376c950ec4480f15006 (diff)
downloadqt-creator-2eb15f030c006e9f586e0adaf79ef685ca85a286.tar.gz
Fix importing empty shortcuts from keyboard shortcut settings
Empty shortcuts are exported with just a "shortcut" element but without a "key" element. It was not clearing the current shortcut when importing these. Change-Id: I0730aadbcce70672bb81db8ac7859a53a102a5c1 Task-number: QTCREATORBUG-12981 Reviewed-by: hjk <hjk@theqtcompany.com>
-rw-r--r--src/plugins/coreplugin/actionmanager/commandsfile.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp
index edd865aea3..3354584fb3 100644
--- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp
+++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp
@@ -105,6 +105,8 @@ QMap<QString, QKeySequence> CommandsFile::importCommands() const
case QXmlStreamReader::StartElement: {
const QStringRef name = r.name();
if (name == ctx.shortCutElement) {
+ if (!currentId.isEmpty()) // shortcut element without key element == empty shortcut
+ result.insert(currentId, QKeySequence());
currentId = r.attributes().value(ctx.idAttribute).toString();
} else if (name == ctx.keyElement) {
QTC_ASSERT(!currentId.isEmpty(), return result);