aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/resourceeditor
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2014-02-14 15:18:04 +0100
committerDaniel Teske <daniel.teske@digia.com>2014-02-17 11:14:26 +0100
commit79deddaf53cce98574ae0d6712287ebd4039f424 (patch)
treeab812489bef05df3eb4de5851a90733fc9cc03fc /src/plugins/resourceeditor
parentd4de9185006dd590c2f95a3ebe54aa213f4acb68 (diff)
ResourceModel::changeLang(): Prevent duplicated prefixes
Do the same check as changePrefix Change-Id: I8edf6641295c9c38fbcc70fc5610dba275547b8a Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/resourceeditor')
-rw-r--r--src/plugins/resourceeditor/qrceditor/resourcefile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
index 1cdaac2ec3..f4f89f32e7 100644
--- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
+++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
@@ -1027,6 +1027,10 @@ void ResourceModel::changeLang(const QModelIndex &model_idx, const QString &lang
if (m_resource_file.lang(prefix_idx) == lang)
return;
+ if (m_resource_file.contains(m_resource_file.prefix(prefix_idx), lang))
+ return;
+
+
m_resource_file.replaceLang(prefix_idx, lang);
emit dataChanged(prefix_model_idx, prefix_model_idx);
setDirty(true);