forked from qt-creator/qt-creator
Core: introduce codec support check for text documents
So indiviual documents can block codecs they do not support like ui or qml files. Change-Id: I65b605762c696d38be9049f0064fd68aad0193da Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -183,7 +183,13 @@ void BaseTextDocument::setCodec(const QTextCodec *codec)
|
||||
{
|
||||
if (debug)
|
||||
qDebug() << Q_FUNC_INFO << this << (codec ? codec->name() : QByteArray());
|
||||
d->m_format.codec = codec;
|
||||
if (supportsCodec(codec))
|
||||
d->m_format.codec = codec;
|
||||
}
|
||||
|
||||
bool BaseTextDocument::supportsCodec(const QTextCodec *) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void BaseTextDocument::switchUtf8Bom()
|
||||
|
||||
Reference in New Issue
Block a user