The return value of installTranslator() should indicate whether the _registration_ was successful. Apart from merely logging the result, the only sensible action the calling code might take is to delete the QTranslator object that failed to register. The old behavior of installTranslator() for empty QTranslator objects was to store the pointer for further use, but still return false. This might lead to hard-to-detect memory corruption. The patch changes behavior to _not_ consider installing empty QTranslator objects as an error. This has the following reasons: * As translations are often done later in the SW development process, it is common to replace empty .qm files with translated ones in a very late stage. But having different code paths based on this can be surprising. * The other parts of the QTranslator toolchain do not treat empty translations in a specific way, either. While at it, also remove the now unused QT_NO_TRANSLATION_BUILDER macro (left over from Qt 4). [ChangeLog][Core][Behavior Change] QCoreApplication::installTranslator() will now return true even for empty translators (QTranslator::isEmpty()). This makes it explicit that empty QTranslator objects are registered and queried, and therefore deleting the object prematurely might result in undefined behavior. Change-Id: Ia0531afcf5c72aa837406cf5de2cf73052014445 Reviewed-by: Masoud Jami <masoud.jami@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
…
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%