forked from qt-creator/qt-creator
Remove a few TextDocument subclasses
Which only differed in some property settings. Change-Id: Ie844c32709ebe719a5b749fd2ef828b64086ba9a Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -47,11 +47,10 @@ namespace Internal {
|
||||
class TextDocumentPrivate
|
||||
{
|
||||
public:
|
||||
TextDocumentPrivate() : m_readResult(Utils::TextFileFormat::ReadSuccess) {}
|
||||
|
||||
Utils::TextFileFormat m_format;
|
||||
Utils::TextFileFormat::ReadResult m_readResult;
|
||||
Utils::TextFileFormat::ReadResult m_readResult = Utils::TextFileFormat::ReadSuccess;
|
||||
QByteArray m_decodingErrorSample;
|
||||
bool m_supportsUtf8Bom = true;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -97,6 +96,11 @@ bool BaseTextDocument::write(const QString &fileName, const Utils::TextFileForma
|
||||
return format.writeFile(fileName, data, errorMessage);
|
||||
}
|
||||
|
||||
void BaseTextDocument::setSupportsUtf8Bom(bool value)
|
||||
{
|
||||
d->m_supportsUtf8Bom = value;
|
||||
}
|
||||
|
||||
/*!
|
||||
Autodetects format and reads in the text file specified by \a fileName.
|
||||
*/
|
||||
@@ -140,6 +144,11 @@ void BaseTextDocument::switchUtf8Bom()
|
||||
d->m_format.hasUtf8Bom = !d->m_format.hasUtf8Bom;
|
||||
}
|
||||
|
||||
bool BaseTextDocument::supportsUtf8Bom() const
|
||||
{
|
||||
return d->m_supportsUtf8Bom;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the format obtained from the last call to \c read().
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user