forked from qt-creator/qt-creator
Move IEditor::createNew to IDocument::setContents
The method is for setting the contents, so it belongs to the document, and should be named correspondingly. Change-Id: I40363dc08f11268f530885b512e4a88e8b10d096 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -539,18 +539,6 @@ QString BaseTextEditorWidget::msgTextTooLarge(quint64 size)
|
||||
arg(size >> 20);
|
||||
}
|
||||
|
||||
bool BaseTextEditorWidget::createNew(const QString &contents)
|
||||
{
|
||||
if (contents.size() > Core::EditorManager::maxTextFileSize()) {
|
||||
setPlainText(msgTextTooLarge(contents.size()));
|
||||
document()->setModified(false);
|
||||
return false;
|
||||
}
|
||||
setPlainText(contents);
|
||||
document()->setModified(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void BaseTextEditorWidget::updateCannotDecodeInfo()
|
||||
{
|
||||
setReadOnly(d->m_document->hasDecodingError());
|
||||
|
||||
Reference in New Issue
Block a user