forked from qt-creator/qt-creator
Text editor: Remove unused member
Reviewed-by: mae
This commit is contained in:
@@ -199,7 +199,6 @@ public:
|
|||||||
bool m_fileHasUtf8Bom;
|
bool m_fileHasUtf8Bom;
|
||||||
|
|
||||||
bool m_fileIsReadOnly;
|
bool m_fileIsReadOnly;
|
||||||
bool m_isBinaryData;
|
|
||||||
bool m_hasDecodingError;
|
bool m_hasDecodingError;
|
||||||
QByteArray m_decodingErrorSample;
|
QByteArray m_decodingErrorSample;
|
||||||
static const int kChunkSize = 65536;
|
static const int kChunkSize = 65536;
|
||||||
@@ -213,7 +212,6 @@ BaseTextDocumentPrivate::BaseTextDocumentPrivate(BaseTextDocument *q) :
|
|||||||
m_codec(Core::EditorManager::instance()->defaultTextEncoding()),
|
m_codec(Core::EditorManager::instance()->defaultTextEncoding()),
|
||||||
m_fileHasUtf8Bom(false),
|
m_fileHasUtf8Bom(false),
|
||||||
m_fileIsReadOnly(false),
|
m_fileIsReadOnly(false),
|
||||||
m_isBinaryData(false),
|
|
||||||
m_hasDecodingError(false)
|
m_hasDecodingError(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -300,14 +298,9 @@ SyntaxHighlighter *BaseTextDocument::syntaxHighlighter() const
|
|||||||
return d->m_highlighter;
|
return d->m_highlighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseTextDocument::isBinaryData() const
|
|
||||||
{
|
|
||||||
return d->m_isBinaryData;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool BaseTextDocument::hasDecodingError() const
|
bool BaseTextDocument::hasDecodingError() const
|
||||||
{
|
{
|
||||||
return d->m_hasDecodingError || d->m_isBinaryData;
|
return d->m_hasDecodingError;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextCodec *BaseTextDocument::codec() const
|
QTextCodec *BaseTextDocument::codec() const
|
||||||
@@ -381,7 +374,6 @@ bool BaseTextDocument::save(const QString &fileName)
|
|||||||
emit titleChanged(fi.fileName());
|
emit titleChanged(fi.fileName());
|
||||||
emit changed();
|
emit changed();
|
||||||
|
|
||||||
d->m_isBinaryData = false;
|
|
||||||
d->m_hasDecodingError = false;
|
d->m_hasDecodingError = false;
|
||||||
d->m_decodingErrorSample.clear();
|
d->m_decodingErrorSample.clear();
|
||||||
|
|
||||||
@@ -398,7 +390,7 @@ void BaseTextDocument::rename(const QString &newName)
|
|||||||
|
|
||||||
bool BaseTextDocument::isReadOnly() const
|
bool BaseTextDocument::isReadOnly() const
|
||||||
{
|
{
|
||||||
if (d->m_isBinaryData || d->m_hasDecodingError)
|
if (d->m_hasDecodingError)
|
||||||
return true;
|
return true;
|
||||||
if (d->m_fileName.isEmpty()) //have no corresponding file, so editing is ok
|
if (d->m_fileName.isEmpty()) //have no corresponding file, so editing is ok
|
||||||
return false;
|
return false;
|
||||||
@@ -521,9 +513,6 @@ bool BaseTextDocument::open(const QString &fileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->m_document->setModified(false);
|
d->m_document->setModified(false);
|
||||||
if (d->m_isBinaryData) {
|
|
||||||
d->m_document->setHtml(tr("<em>Binary data</em>"));
|
|
||||||
} else {
|
|
||||||
const int chunks = content.size();
|
const int chunks = content.size();
|
||||||
if (chunks == 1) {
|
if (chunks == 1) {
|
||||||
d->m_document->setPlainText(content.at(0));
|
d->m_document->setPlainText(content.at(0));
|
||||||
@@ -541,7 +530,6 @@ bool BaseTextDocument::open(const QString &fileName)
|
|||||||
}
|
}
|
||||||
interface.reportFinished();
|
interface.reportFinished();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
BaseTextDocumentLayout *documentLayout =
|
BaseTextDocumentLayout *documentLayout =
|
||||||
qobject_cast<BaseTextDocumentLayout*>(d->m_document->documentLayout());
|
qobject_cast<BaseTextDocumentLayout*>(d->m_document->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return true);
|
QTC_ASSERT(documentLayout, return true);
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ public:
|
|||||||
SyntaxHighlighter *syntaxHighlighter() const;
|
SyntaxHighlighter *syntaxHighlighter() const;
|
||||||
|
|
||||||
|
|
||||||
bool isBinaryData() const;
|
|
||||||
bool hasDecodingError() const;
|
bool hasDecodingError() const;
|
||||||
QTextCodec *codec() const;
|
QTextCodec *codec() const;
|
||||||
void setCodec(QTextCodec *c);
|
void setCodec(QTextCodec *c);
|
||||||
|
|||||||
Reference in New Issue
Block a user