mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
fake the system codec name
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
42413708fd
commit
c382b404ce
2 changed files with 12 additions and 0 deletions
|
@ -1021,8 +1021,15 @@ QByteArray QIcuCodec::convertFromUnicode(const QChar *unicode, int length,
|
|||
}
|
||||
|
||||
#ifndef QT_NO_TEXTCODEC
|
||||
extern QTextCodec* qt_localeMapper();
|
||||
QByteArray QIcuCodec::name() const
|
||||
{
|
||||
if (qt_localeMapper() == this) {
|
||||
// fake the name so that when it is saved in configuration files for example it is dynmaic
|
||||
// instead of being saved as UTF-8 and the next time it is requested it will again resolve
|
||||
// to the system codec
|
||||
return QByteArray("System");
|
||||
}
|
||||
return m_name;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,11 @@ QTextCodec *QTextCodec::cftr = Q_NULLPTR;
|
|||
Q_GLOBAL_STATIC(QMutex, textCodecsMutex)
|
||||
#endif
|
||||
|
||||
QTextCodec* qt_localeMapper()
|
||||
{
|
||||
return localeMapper;
|
||||
}
|
||||
|
||||
class QTextCodecCleanup : public QList<QTextCodec*>
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Reference in a new issue