mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 14:40:28 +00:00
76e6420f6b
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
27 lines
573 B
C++
27 lines
573 B
C++
#include <QCoreApplication>
|
|
#include <QString>
|
|
#include <gettextfromc.h>
|
|
|
|
const char *gettextFromC::trGettext(const char *text)
|
|
{
|
|
QByteArray &result = translationCache[QByteArray(text)];
|
|
if (result.isEmpty())
|
|
result = trUtf8(text).toUtf8();
|
|
return result.constData();
|
|
}
|
|
|
|
void gettextFromC::reset(void)
|
|
{
|
|
translationCache.clear();
|
|
}
|
|
|
|
gettextFromC *gettextFromC::instance()
|
|
{
|
|
static QScopedPointer<gettextFromC> self(new gettextFromC());
|
|
return self.data();
|
|
}
|
|
|
|
extern "C" const char *trGettext(const char *text)
|
|
{
|
|
return gettextFromC::instance()->trGettext(text);
|
|
}
|