make stubbed QCoreApplication::translate() resolve %n

Change-Id: I36326d0f11e71580977d6589c9810ffa252a0fa7
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Oswald Buddenhagen 2012-12-06 21:07:39 +01:00 committed by The Qt Project
parent 203f2800c0
commit de5562ff38
2 changed files with 13 additions and 7 deletions

View File

@ -1781,6 +1781,19 @@ bool QCoreApplicationPrivate::isTranslatorInstalled(QTranslator *translator)
&& QCoreApplication::self->d_func()->translators.contains(translator); && QCoreApplication::self->d_func()->translators.contains(translator);
} }
#else
QString QCoreApplication::translate(const char *context, const char *sourceText,
const char *disambiguation, int n)
{
Q_UNUSED(context)
Q_UNUSED(disambiguation)
QString ret = QString::fromUtf8(sourceText);
if (n >= 0)
ret.replace(QLatin1String("%n"), QString::number(n));
return ret;
}
#endif //QT_NO_TRANSLATE #endif //QT_NO_TRANSLATE
/*! /*!

View File

@ -208,13 +208,6 @@ inline bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event)
inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *event) inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *event)
{ if (event) event->spont = true; return self ? self->notifyInternal(receiver, event) : false; } { if (event) event->spont = true; return self ? self->notifyInternal(receiver, event) : false; }
#ifdef QT_NO_TRANSLATION
inline QString QCoreApplication::translate(const char *, const char *sourceText, const char *, int)
{
return QString::fromUtf8(sourceText);
}
#endif
#ifdef QT_NO_DEPRECATED #ifdef QT_NO_DEPRECATED
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) # define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)
#else #else