From faa37591206268c98dda2b22d7bfaa7992bd1c4b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Nov 2012 17:50:44 +0100 Subject: don't return false from removeTranslator() just because of shutting down the condition is supposed to suppress the event emission, not to trash the return value. Change-Id: I3e327ceedb909ac29ba975c49b0f039b50eb4ee1 Reviewed-by: Joerg Bornemann --- src/corelib/kernel/qcoreapplication.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 2575f0b6aa..cb744a67a6 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1630,9 +1630,11 @@ bool QCoreApplication::removeTranslator(QTranslator *translationFile) if (!QCoreApplicationPrivate::checkInstance("removeTranslator")) return false; QCoreApplicationPrivate *d = self->d_func(); - if (d->translators.removeAll(translationFile) && !self->closingDown()) { - QEvent ev(QEvent::LanguageChange); - QCoreApplication::sendEvent(self, &ev); + if (d->translators.removeAll(translationFile)) { + if (!self->closingDown()) { + QEvent ev(QEvent::LanguageChange); + QCoreApplication::sendEvent(self, &ev); + } return true; } return false; -- cgit v1.2.3