From 187ee8842b22fe71feb8677551029f660d0775b9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 19 Sep 2011 20:26:25 +0200 Subject: "empty translation" does not mean "no translation" this makes QCoreApplication::translate() consistent with QTranslator::translate(), and is semantically cleaner. users wishing to shrink their QM files can do that properly by using lrelease -removeidentical. Change-Id: I2b367314cfb985c3d130c7c6347e2742311f497a Reviewed-on: http://codereview.qt-project.org/5165 Reviewed-by: Qt Sanity Bot Reviewed-by: hjk --- src/corelib/kernel/qcoreapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qcoreapplication.cpp') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index d7fb9d3270..9acf1f22c3 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1823,12 +1823,12 @@ QString QCoreApplication::translate(const char *context, const char *sourceText, for (it = self->d_func()->translators.constBegin(); it != self->d_func()->translators.constEnd(); ++it) { translationFile = *it; result = translationFile->translate(context, sourceText, disambiguation, n); - if (!result.isEmpty()) + if (!result.isNull()) break; } } - if (result.isEmpty()) { + if (result.isNull()) { #ifdef QT_NO_TEXTCODEC Q_UNUSED(encoding) #else -- cgit v1.2.3