From 049763ef2513a9c972192a1bfb78257e94dcf7e4 Mon Sep 17 00:00:00 2001 From: imn Date: Thu, 19 Nov 2015 14:46:27 +0300 Subject: [PATCH] Fix pb. with resources --- src/Qtx/QtxTranslator.cxx | 10 ++++++++++ src/Qtx/QtxTranslator.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/Qtx/QtxTranslator.cxx b/src/Qtx/QtxTranslator.cxx index ff656d093..683a3ce68 100644 --- a/src/Qtx/QtxTranslator.cxx +++ b/src/Qtx/QtxTranslator.cxx @@ -70,6 +70,15 @@ QtxTranslator::~QtxTranslator() \param comment message comment (optional) \return Translated text if found or \a sourceText otherwise */ +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +QString QtxTranslator::translate( const char* context, const char* sourceText, const char* comment ) const +{ + QString res = QTranslator::translate( context, sourceText, comment ); + if( res.isNull() ) + res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment ); + return res; +} +#else QString QtxTranslator::translate( const char* context, const char* sourceText, const char* comment, int n ) const { QString res = QTranslator::translate( context, sourceText, comment, n ); @@ -77,3 +86,4 @@ QString QtxTranslator::translate( const char* context, const char* sourceText, c res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment, n ); return res; } +#endif diff --git a/src/Qtx/QtxTranslator.h b/src/Qtx/QtxTranslator.h index 9cc672541..db6909ee2 100644 --- a/src/Qtx/QtxTranslator.h +++ b/src/Qtx/QtxTranslator.h @@ -32,7 +32,11 @@ class QTX_EXPORT QtxTranslator : public QTranslator public: QtxTranslator( QObject* parent = 0 ); ~QtxTranslator(); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + virtual QString translate( const char*, const char*, const char* = 0 ) const; +#else virtual QString translate( const char*, const char*, const char* = 0, int n = -1 ) const; +#endif }; #endif -- 2.39.2