diff options
author | Water-Team <water@pad.test.qt.nokia.com> | 2011-11-19 00:00:12 (GMT) |
---|---|---|
committer | Water-Team <water@pad.test.qt.nokia.com> | 2011-11-19 00:00:12 (GMT) |
commit | aaf0771576b7b11d4931f60a5469e7022739e321 (patch) | |
tree | b8989f50bf426397b3237b2623703d57ffa17177 | |
parent | 34d7dd61ed259e4e6e05d191a9a6da4c8bb41216 (diff) | |
parent | 75792528141ebf3dc6f36f2efcd771dfaef6e703 (diff) | |
download | Qt-aaf0771576b7b11d4931f60a5469e7022739e321.zip Qt-aaf0771576b7b11d4931f60a5469e7022739e321.tar.gz Qt-aaf0771576b7b11d4931f60a5469e7022739e321.tar.bz2 |
Merge branch '4.8-upstream' into master-water
-rw-r--r-- | src/network/socket/qlocalserver_unix.cpp | 8 | ||||
-rw-r--r-- | tools/linguist/linguist/messageeditor.cpp | 7 | ||||
-rw-r--r-- | tools/linguist/linguist/messageeditor.h | 1 | ||||
-rw-r--r-- | tools/linguist/linguist/messageeditorwidgets.cpp | 4 | ||||
-rw-r--r-- | tools/linguist/linguist/messageeditorwidgets.h | 1 |
5 files changed, 16 insertions, 5 deletions
diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp index 851e898..390712c 100644 --- a/src/network/socket/qlocalserver_unix.cpp +++ b/src/network/socket/qlocalserver_unix.cpp @@ -167,16 +167,16 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName) */ void QLocalServerPrivate::closeServer() { - if (-1 != listenSocket) - QT_CLOSE(listenSocket); - listenSocket = -1; - if (socketNotifier) { socketNotifier->setEnabled(false); // Otherwise, closed socket is checked before deleter runs socketNotifier->deleteLater(); socketNotifier = 0; } + if (-1 != listenSocket) + QT_CLOSE(listenSocket); + listenSocket = -1; + if (!fullServerName.isEmpty()) QFile::remove(fullServerName); } diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp index 6cafe8e..87c2f4a 100644 --- a/tools/linguist/linguist/messageeditor.cpp +++ b/tools/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); diff --git a/tools/linguist/linguist/messageeditor.h b/tools/linguist/linguist/messageeditor.h index 4686d3d..21b3405 100644 --- a/tools/linguist/linguist/messageeditor.h +++ b/tools/linguist/linguist/messageeditor.h @@ -114,6 +114,7 @@ public slots: private slots: void editorCreated(QTextEdit *); + void editorDeleted(QTextEdit *); void selectionChanged(QTextEdit *); void resetHoverSelection(); void emitTranslationChanged(QTextEdit *); diff --git a/tools/linguist/linguist/messageeditorwidgets.cpp b/tools/linguist/linguist/messageeditorwidgets.cpp index 6422b47..29df673 100644 --- a/tools/linguist/linguist/messageeditorwidgets.cpp +++ b/tools/linguist/linguist/messageeditorwidgets.cpp @@ -362,9 +362,11 @@ void FormMultiWidget::setTranslation(const QString &text, bool userAction) QStringList texts = text.split(QChar(Translator::BinaryVariantSeparator), QString::KeepEmptyParts); while (m_editors.count() > texts.count()) { + FormatTextEdit *editor = m_editors.takeLast(); + emit editorDeleted(editor); delete m_minusButtons.takeLast(); delete m_plusButtons.takeLast(); - delete m_editors.takeLast(); + delete editor; } while (m_editors.count() < texts.count()) addEditor(m_editors.count()); diff --git a/tools/linguist/linguist/messageeditorwidgets.h b/tools/linguist/linguist/messageeditorwidgets.h index cb24377..1f6f1f5 100644 --- a/tools/linguist/linguist/messageeditorwidgets.h +++ b/tools/linguist/linguist/messageeditorwidgets.h @@ -150,6 +150,7 @@ public: signals: void editorCreated(QTextEdit *); + void editorDeleted(QTextEdit *); void textChanged(QTextEdit *); void selectionChanged(QTextEdit *); void cursorPositionChanged(); |