summaryrefslogtreecommitdiffstats
path: root/src/linguist/linguist/messageeditor.cpp
diff options
context:
space:
mode:
authorTakumi ASAKI <takumi.asaki@nokia.com>2011-11-17 16:26:05 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-18 19:07:09 +0100
commit89ae399dfb6d42422396fbb0d869b5a39c4e8bf6 (patch)
treeb7fd3125241408bf539a9c75e6d49d2af38e1d8e /src/linguist/linguist/messageeditor.cpp
parent2366e5288ec1cc5a9b256b5afdc614b3e293f881 (diff)
Qt Linguist: Fix crash after select 2nd translation in lengthvariant
* MessageEditor keeps deleted editor as m_selectionHolder. QOjbect::destroyed() SIGNAL doesn't fit to fix this problem due to destruction order problem. Merge-request: 1466 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit b68b59f252930538cc124b31decc990ab57bea20) Change-Id: Ib68b59f252930538cc124b31decc990ab57bea20 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/linguist/linguist/messageeditor.cpp')
-rw-r--r--src/linguist/linguist/messageeditor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/linguist/linguist/messageeditor.cpp b/src/linguist/linguist/messageeditor.cpp
index 6cafe8e35..87c2f4a45 100644
--- a/src/linguist/linguist/messageeditor.cpp
+++ b/src/linguist/linguist/messageeditor.cpp
@@ -262,6 +262,7 @@ void MessageEditor::addPluralForm(int model, const QString &label, bool writable
{
FormMultiWidget *transEditor = new FormMultiWidget(label);
connect(transEditor, SIGNAL(editorCreated(QTextEdit*)), SLOT(editorCreated(QTextEdit*)));
+ connect(transEditor, SIGNAL(editorDeleted(QTextEdit*)), SLOT(editorDeleted(QTextEdit*)));
transEditor->setEditingEnabled(writable);
transEditor->setHideWhenEmpty(!writable);
if (!m_editors[model].transTexts.isEmpty())
@@ -298,6 +299,12 @@ void MessageEditor::editorCreated(QTextEdit *te)
}
}
+void MessageEditor::editorDeleted(QTextEdit *te)
+{
+ if (m_selectionHolder == te)
+ resetSelection();
+}
+
void MessageEditor::fixTabOrder()
{
m_tabOrderTimer.start(0);