2022-09-29 Fred Gleason <fredg@paravelsystems.com>

* Added a workaround for a bug in 'QTranslator::load()' that
	indicates failure when attempting to load a valid-but-null
	translation map.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-09-29 15:21:39 -04:00
parent 66b3773033
commit c6adb2863a
2 changed files with 14 additions and 4 deletions

View File

@ -23427,3 +23427,7 @@
2022-09-29 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'rdcartslots/Makefile.am' that caused i18n
translation maps for rdcartslots(1) to fail to be generated.
2022-09-29 Fred Gleason <fredg@paravelsystems.com>
* Added a workaround for a bug in 'QTranslator::load()' that
indicates failure when attempting to load a valid-but-null
translation map.

View File

@ -19,6 +19,7 @@
//
#include <QCoreApplication>
#include <QFile>
#include "rdapplication.h"
#include "rdtranslator.h"
@ -45,10 +46,15 @@ bool RDTranslator::LoadTranslation(const QString &filename,
{
QTranslator *qt=new QTranslator(0);
if(!qt->load(filename,dirname)) {
//
// Silly workaround so we don't false alarm on a valid-but-null file
//
if(QFile(dirname+"/"+filename).size()!=16) {
fprintf(stderr,"%s: failed to load translation file \"%s/%s\"\n",
d_command_name.toUtf8().constData(),
dirname.toUtf8().constData(),
filename.toUtf8().constData());
}
delete qt;
return false;
}