mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-30 17:20:32 +01:00
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:
@@ -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)) {
|
||||
fprintf(stderr,"%s: failed to load translation file \"%s/%s\"\n",
|
||||
d_command_name.toUtf8().constData(),
|
||||
dirname.toUtf8().constData(),
|
||||
filename.toUtf8().constData());
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user