Commit 0fcca946 authored by hjk's avatar hjk

Rename {Core,TextEditor},{Base,}TextDocument classes

First step of some more 'Base' removal in TextEditor.
s/Core::TextDocument/Core::BaseTextDocument/
s/TextEditor::BaseTextDocument/TextEditor::TextDocument/

Change-Id: I71ba325a2f0ad72ec9dae0d96846cbae72d326f7
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 33670d22
......@@ -50,7 +50,7 @@ AndroidManifestDocument::AndroidManifestDocument(AndroidManifestEditorWidget *ed
bool AndroidManifestDocument::save(QString *errorString, const QString &fileName, bool autoSave)
{
m_editorWidget->preSave();
return BaseTextDocument::save(errorString, fileName, autoSave);
return TextDocument::save(errorString, fileName, autoSave);
}
QString AndroidManifestDocument::defaultPath() const
......@@ -67,7 +67,7 @@ QString AndroidManifestDocument::suggestedFileName() const
bool AndroidManifestDocument::isModified() const
{
return BaseTextDocument::isModified() || m_editorWidget->isModified();
return TextDocument::isModified() || m_editorWidget->isModified();
}
bool AndroidManifestDocument::isSaveAsAllowed() const
......
......@@ -37,7 +37,7 @@ namespace Internal {
class AndroidManifestEditorWidget;
class AndroidManifestDocument : public TextEditor::BaseTextDocument
class AndroidManifestDocument : public TextEditor::TextDocument
{
public:
explicit AndroidManifestDocument(AndroidManifestEditorWidget *editorWidget);
......
......@@ -66,7 +66,7 @@ public:
// JavaDocument
//
class JavaDocument : public TextEditor::BaseTextDocument
class JavaDocument : public TextEditor::TextDocument
{
public:
JavaDocument();
......
......@@ -90,7 +90,7 @@ QList<TextEditor::BlockRange> toTextEditorBlocks(
namespace ClangCodeModel {
ClangEditorDocumentProcessor::ClangEditorDocumentProcessor(TextEditor::BaseTextDocument *document)
ClangEditorDocumentProcessor::ClangEditorDocumentProcessor(TextEditor::TextDocument *document)
: BaseEditorDocumentProcessor(document)
, m_parser(document->filePath())
, m_parserRevision(0)
......
......@@ -46,7 +46,7 @@ class ClangEditorDocumentProcessor : public CppTools::BaseEditorDocumentProcesso
Q_OBJECT
public:
ClangEditorDocumentProcessor(TextEditor::BaseTextDocument *document);
ClangEditorDocumentProcessor(TextEditor::TextDocument *document);
~ClangEditorDocumentProcessor();
// BaseEditorDocumentProcessor interface
......
......@@ -63,7 +63,7 @@ CppTools::CppCompletionAssistProvider *ModelManagerSupport::completionAssistProv
}
CppTools::BaseEditorDocumentProcessor *ModelManagerSupport::editorDocumentProcessor(
TextEditor::BaseTextDocument *baseTextDocument)
TextEditor::TextDocument *baseTextDocument)
{
return new ClangCodeModel::ClangEditorDocumentProcessor(baseTextDocument);
}
......@@ -50,7 +50,7 @@ public:
virtual CppTools::CppCompletionAssistProvider *completionAssistProvider();
virtual CppTools::BaseEditorDocumentProcessor *editorDocumentProcessor(
TextEditor::BaseTextDocument *baseTextDocument);
TextEditor::TextDocument *baseTextDocument);
private:
QScopedPointer<CppTools::CppCompletionAssistProvider> m_completionAssistProvider;
......
......@@ -71,7 +71,7 @@ CMakeEditor::CMakeEditor()
void CMakeEditor::finalizeInitialization()
{
connect(document(), &IDocument::changed, [this]() {
BaseTextDocument *document = textDocument();
TextDocument *document = textDocument();
if (!document->isModified())
return;
InfoBar *infoBar = document->infoBar();
......@@ -240,7 +240,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor,
// CMakeDocument
//
class CMakeDocument : public BaseTextDocument
class CMakeDocument : public TextDocument
{
public:
CMakeDocument();
......
......@@ -48,10 +48,10 @@ enum { debug = 0 };
namespace Core {
namespace Internal {
class TextDocumentPrivate
class BaseTextDocumentPrivate
{
public:
TextDocumentPrivate() : m_readResult(Utils::TextFileFormat::ReadSuccess) {}
BaseTextDocumentPrivate() : m_readResult(Utils::TextFileFormat::ReadSuccess) {}
Utils::TextFileFormat m_format;
Utils::TextFileFormat::ReadResult m_readResult;
......@@ -60,23 +60,23 @@ public:
} // namespace Internal
TextDocument::TextDocument(QObject *parent) :
IDocument(parent), d(new Internal::TextDocumentPrivate)
BaseTextDocument::BaseTextDocument(QObject *parent) :
IDocument(parent), d(new Internal::BaseTextDocumentPrivate)
{
setCodec(Core::EditorManager::defaultTextCodec());
}
TextDocument::~TextDocument()
BaseTextDocument::~BaseTextDocument()
{
delete d;
}
bool TextDocument::hasDecodingError() const
bool BaseTextDocument::hasDecodingError() const
{
return d->m_readResult == Utils::TextFileFormat::ReadEncodingError;
}
QByteArray TextDocument::decodingErrorSample() const
QByteArray BaseTextDocument::decodingErrorSample() const
{
return d->m_decodingErrorSample;
}
......@@ -85,7 +85,7 @@ QByteArray TextDocument::decodingErrorSample() const
Writes out text using the format obtained from the last read.
*/
bool TextDocument::write(const QString &fileName, const QString &data, QString *errorMessage) const
bool BaseTextDocument::write(const QString &fileName, const QString &data, QString *errorMessage) const
{
return write(fileName, format(), data, errorMessage);
}
......@@ -94,7 +94,7 @@ bool TextDocument::write(const QString &fileName, const QString &data, QString *
Writes out text using a custom \a format.
*/
bool TextDocument::write(const QString &fileName, const Utils::TextFileFormat &format, const QString &data, QString *errorMessage) const
bool BaseTextDocument::write(const QString &fileName, const Utils::TextFileFormat &format, const QString &data, QString *errorMessage) const
{
if (debug)
qDebug() << Q_FUNC_INFO << this << fileName;
......@@ -105,7 +105,7 @@ bool TextDocument::write(const QString &fileName, const Utils::TextFileFormat &f
Autodetects format and reads in the text file specified by \a fileName.
*/
TextDocument::ReadResult TextDocument::read(const QString &fileName, QStringList *plainTextList, QString *errorString)
BaseTextDocument::ReadResult BaseTextDocument::read(const QString &fileName, QStringList *plainTextList, QString *errorString)
{
d->m_readResult =
Utils::TextFileFormat::readFile(fileName, codec(),
......@@ -117,7 +117,7 @@ TextDocument::ReadResult TextDocument::read(const QString &fileName, QStringList
Autodetects format and reads in the text file specified by \a fileName.
*/
TextDocument::ReadResult TextDocument::read(const QString &fileName, QString *plainText, QString *errorString)
BaseTextDocument::ReadResult BaseTextDocument::read(const QString &fileName, QString *plainText, QString *errorString)
{
d->m_readResult =
Utils::TextFileFormat::readFile(fileName, codec(),
......@@ -125,19 +125,19 @@ TextDocument::ReadResult TextDocument::read(const QString &fileName, QString *pl
return d->m_readResult;
}
const QTextCodec *TextDocument::codec() const
const QTextCodec *BaseTextDocument::codec() const
{
return d->m_format.codec;
}
void TextDocument::setCodec(const QTextCodec *codec)
void BaseTextDocument::setCodec(const QTextCodec *codec)
{
if (debug)
qDebug() << Q_FUNC_INFO << this << (codec ? codec->name() : QByteArray());
d->m_format.codec = codec;
}
void TextDocument::switchUtf8Bom()
void BaseTextDocument::switchUtf8Bom()
{
if (debug)
qDebug() << Q_FUNC_INFO << this << "UTF-8 BOM: " << !d->m_format.hasUtf8Bom;
......@@ -148,7 +148,7 @@ void TextDocument::switchUtf8Bom()
Returns the format obtained from the last call to \c read().
*/
Utils::TextFileFormat TextDocument::format() const
Utils::TextFileFormat BaseTextDocument::format() const
{
return d->m_format;
}
......
......@@ -36,16 +36,17 @@
namespace Core {
namespace Internal { class TextDocumentPrivate; }
namespace Internal { class BaseTextDocumentPrivate; }
class CORE_EXPORT TextDocument : public IDocument
class CORE_EXPORT BaseTextDocument : public IDocument
{
Q_OBJECT
public:
typedef Utils::TextFileFormat::ReadResult ReadResult;
explicit TextDocument(QObject *parent = 0);
virtual ~TextDocument();
explicit BaseTextDocument(QObject *parent = 0);
virtual ~BaseTextDocument();
Utils::TextFileFormat format() const;
const QTextCodec *codec() const;
......@@ -63,7 +64,7 @@ public:
bool write(const QString &fileName, const Utils::TextFileFormat &format, const QString &data, QString *errorMessage) const;
private:
Internal::TextDocumentPrivate *d;
Internal::BaseTextDocumentPrivate *d;
};
} // namespace Core
......
......@@ -214,7 +214,7 @@ void CodepasterPlugin::postEditor()
if (const BaseTextEditor *textEditor = qobject_cast<const BaseTextEditor *>(editor))
data = textEditor->selectedText();
if (data.isEmpty()) {
if (auto textDocument = qobject_cast<const BaseTextDocument *>(document))
if (auto textDocument = qobject_cast<const TextDocument *>(document))
data = textDocument->plainText();
}
post(data, mimeType);
......
......@@ -706,7 +706,7 @@ void CppEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefL
d->m_declDefLink = link;
IDocument *targetDocument = DocumentModel::documentForFilePath( d->m_declDefLink->targetFile->fileName());
if (textDocument() != targetDocument) {
if (auto textDocument = qobject_cast<BaseTextDocument *>(targetDocument))
if (auto textDocument = qobject_cast<TextDocument *>(targetDocument))
connect(textDocument, SIGNAL(contentsChanged()),
this, SLOT(abortDeclDefLink()));
}
......@@ -741,7 +741,7 @@ void CppEditorWidget::abortDeclDefLink()
IDocument *targetDocument = DocumentModel::documentForFilePath(d->m_declDefLink->targetFile->fileName());
if (textDocument() != targetDocument) {
if (auto textDocument = qobject_cast<BaseTextDocument *>(targetDocument))
if (auto textDocument = qobject_cast<TextDocument *>(targetDocument))
disconnect(textDocument, SIGNAL(contentsChanged()),
this, SLOT(abortDeclDefLink()));
}
......
......@@ -166,7 +166,7 @@ void CppEditorDocument::applyFontSettings()
b = b.next();
}
}
BaseTextDocument::applyFontSettings(); // rehighlights and updates additional formats
TextDocument::applyFontSettings(); // rehighlights and updates additional formats
}
void CppEditorDocument::invalidateFormatterCache()
......
......@@ -44,7 +44,7 @@
namespace CppEditor {
namespace Internal {
class CppEditorDocument : public TextEditor::BaseTextDocument
class CppEditorDocument : public TextEditor::TextDocument
{
Q_OBJECT
......
......@@ -104,7 +104,7 @@ public:
static void escape();
/// Undoing changes
static void undoChangesInDocument(BaseTextDocument *editorDocument);
static void undoChangesInDocument(TextDocument *editorDocument);
static void undoChangesInAllEditorWidgets();
/// Execute actions for the current cursor position of editorWidget.
......@@ -255,7 +255,7 @@ void TestActionsTestCase::escape()
QTest::keyClick(w, Qt::Key_Escape);
}
void TestActionsTestCase::undoChangesInDocument(BaseTextDocument *editorDocument)
void TestActionsTestCase::undoChangesInDocument(TextDocument *editorDocument)
{
QTextDocument * const document = editorDocument->document();
QVERIFY(document);
......@@ -266,7 +266,7 @@ void TestActionsTestCase::undoChangesInDocument(BaseTextDocument *editorDocument
void TestActionsTestCase::undoChangesInAllEditorWidgets()
{
foreach (IDocument *document, DocumentModel::openedDocuments()) {
BaseTextDocument *baseTextDocument = qobject_cast<BaseTextDocument *>(document);
TextDocument *baseTextDocument = qobject_cast<TextDocument *>(document);
undoChangesInDocument(baseTextDocument);
}
}
......
......@@ -47,7 +47,7 @@ namespace CppTools {
*/
BaseEditorDocumentProcessor::BaseEditorDocumentProcessor(
TextEditor::BaseTextDocument *document)
TextEditor::TextDocument *document)
: m_baseTextDocument(document)
{
QTC_CHECK(document);
......@@ -57,7 +57,7 @@ BaseEditorDocumentProcessor::~BaseEditorDocumentProcessor()
{
}
TextEditor::BaseTextDocument *BaseEditorDocumentProcessor::baseTextDocument() const
TextEditor::TextDocument *BaseEditorDocumentProcessor::baseTextDocument() const
{
return m_baseTextDocument;
}
......
......@@ -49,10 +49,10 @@ class CPPTOOLS_EXPORT BaseEditorDocumentProcessor : public QObject
BaseEditorDocumentProcessor();
public:
BaseEditorDocumentProcessor(TextEditor::BaseTextDocument *document);
BaseEditorDocumentProcessor(TextEditor::TextDocument *document);
virtual ~BaseEditorDocumentProcessor();
TextEditor::BaseTextDocument *baseTextDocument() const;
TextEditor::TextDocument *baseTextDocument() const;
// Function interface to implement
virtual void run() = 0;
......@@ -90,7 +90,7 @@ protected:
QTextDocument *textDocument() const { return m_baseTextDocument->document(); }
private:
TextEditor::BaseTextDocument *m_baseTextDocument;
TextEditor::TextDocument *m_baseTextDocument;
};
} // namespace CppTools
......
......@@ -123,7 +123,7 @@ QList<TextEditor::BlockRange> toTextEditorBlocks(
namespace CppTools {
BuiltinEditorDocumentProcessor::BuiltinEditorDocumentProcessor(
TextEditor::BaseTextDocument *document,
TextEditor::TextDocument *document,
bool enableSemanticHighlighter)
: BaseEditorDocumentProcessor(document)
, m_parser(document->filePath())
......
......@@ -45,7 +45,7 @@ class CPPTOOLS_EXPORT BuiltinEditorDocumentProcessor : public BaseEditorDocument
BuiltinEditorDocumentProcessor();
public:
BuiltinEditorDocumentProcessor(TextEditor::BaseTextDocument *document,
BuiltinEditorDocumentProcessor(TextEditor::TextDocument *document,
bool enableSemanticHighlighter = true);
~BuiltinEditorDocumentProcessor();
......
......@@ -952,7 +952,7 @@ CppCompletionAssistProvider *CppModelManager::completionAssistProvider(const QSt
}
BaseEditorDocumentProcessor *CppModelManager::editorDocumentProcessor(
TextEditor::BaseTextDocument *baseTextDocument) const
TextEditor::TextDocument *baseTextDocument) const
{
QTC_ASSERT(baseTextDocument, return 0);
ModelManagerSupport *cms = modelManagerSupportForMimeType(baseTextDocument->mimeType());
......
......@@ -47,7 +47,7 @@
namespace Core { class IEditor; }
namespace CPlusPlus { class LookupContext; }
namespace ProjectExplorer { class Project; }
namespace TextEditor { class BaseTextDocument; }
namespace TextEditor { class TextDocument; }
namespace CppTools {
......@@ -133,7 +133,7 @@ public:
ModelManagerSupport *modelManagerSupportForMimeType(const QString &mimeType) const;
CppCompletionAssistProvider *completionAssistProvider(const QString &mimeType) const;
BaseEditorDocumentProcessor *editorDocumentProcessor(
TextEditor::BaseTextDocument *baseTextDocument) const;
TextEditor::TextDocument *baseTextDocument) const;
void setIndexingSupport(CppIndexingSupport *indexingSupport);
CppIndexingSupport *indexingSupport();
......
......@@ -34,7 +34,7 @@
#include <QString>
namespace TextEditor { class BaseTextDocument; }
namespace TextEditor { class TextDocument; }
namespace CppTools {
......@@ -51,7 +51,7 @@ public:
virtual CppCompletionAssistProvider *completionAssistProvider() = 0;
virtual BaseEditorDocumentProcessor *editorDocumentProcessor(
TextEditor::BaseTextDocument *baseTextDocument) = 0;
TextEditor::TextDocument *baseTextDocument) = 0;
};
} // CppTools namespace
......
......@@ -57,7 +57,7 @@ QString ModelManagerSupportInternal::displayName() const
}
BaseEditorDocumentProcessor *ModelManagerSupportInternal::editorDocumentProcessor(
TextEditor::BaseTextDocument *baseTextDocument)
TextEditor::TextDocument *baseTextDocument)
{
return new BuiltinEditorDocumentProcessor(baseTextDocument);
}
......
......@@ -50,7 +50,7 @@ public:
virtual CppCompletionAssistProvider *completionAssistProvider();
virtual BaseEditorDocumentProcessor *editorDocumentProcessor(
TextEditor::BaseTextDocument *baseTextDocument);
TextEditor::TextDocument *baseTextDocument);
private:
QScopedPointer<CppCompletionAssistProvider> m_completionAssistProvider;
......
......@@ -52,7 +52,7 @@ public:
virtual void indentSelection(const QTextCursor &selection,
const QString &fileName,
const TextEditor::BaseTextDocument *textDocument) const
const TextEditor::TextDocument *textDocument) const
{
const TextEditor::TabSettings &tabSettings =
ProjectExplorer::actualTabSettings(fileName, textDocument);
......@@ -63,7 +63,7 @@ public:
virtual void reindentSelection(const QTextCursor &selection,
const QString &fileName,
const TextEditor::BaseTextDocument *textDocument) const
const TextEditor::TextDocument *textDocument) const
{
const TextEditor::TabSettings &tabSettings =
ProjectExplorer::actualTabSettings(fileName, textDocument);
......
......@@ -42,14 +42,14 @@ using TextEditor::SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd;
namespace CppTools {
SemanticHighlighter::SemanticHighlighter(TextEditor::BaseTextDocument *baseTextDocument)
SemanticHighlighter::SemanticHighlighter(TextEditor::TextDocument *baseTextDocument)
: QObject(baseTextDocument)
, m_baseTextDocument(baseTextDocument)
, m_revision(0)
{
QTC_CHECK(m_baseTextDocument);
connect(baseTextDocument, &TextEditor::BaseTextDocument::fontSettingsChanged,
connect(baseTextDocument, &TextEditor::TextDocument::fontSettingsChanged,
this, &SemanticHighlighter::onDocumentFontSettingsChanged);
updateFormatMapFromFontSettings();
......
......@@ -67,7 +67,7 @@ public:
typedef std::function<QFuture<TextEditor::HighlightingResult> ()> HighlightingRunner;
public:
explicit SemanticHighlighter(TextEditor::BaseTextDocument *baseTextDocument);
explicit SemanticHighlighter(TextEditor::TextDocument *baseTextDocument);
~SemanticHighlighter();
void setHighlightingRunner(HighlightingRunner highlightingRunner);
......@@ -88,7 +88,7 @@ private:
void updateFormatMapFromFontSettings();
private:
TextEditor::BaseTextDocument *m_baseTextDocument;
TextEditor::TextDocument *m_baseTextDocument;
unsigned m_revision;
QScopedPointer<QFutureWatcher<TextEditor::HighlightingResult>> m_watcher;
......
......@@ -1879,7 +1879,7 @@ void DebuggerPluginPrivate::requestContextMenu(BaseTextEditor *editor,
bool contextUsable = true;
BreakpointModelId id = BreakpointModelId();
BaseTextDocument *document = editor->textDocument();
TextDocument *document = editor->textDocument();
args.fileName = document->filePath();
if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
QString line = document->plainText()
......
......@@ -100,7 +100,7 @@ public:
DisassemblerLines contentsAtCurrentLocation() const;
public:
QPointer<BaseTextDocument> document;
QPointer<TextDocument> document;
Location location;
QPointer<DebuggerEngine> engine;
TextMark locationMark;
......@@ -291,7 +291,7 @@ void DisassemblerAgent::setContentsToDocument(const DisassemblerLines &contents)
widget->setReadOnly(true);
widget->setRequestMarkEnabled(true);
}
d->document = qobject_cast<BaseTextDocument *>(editor->document());
d->document = qobject_cast<TextDocument *>(editor->document());
QTC_ASSERT(d->document, return);
d->document->setProperty(Debugger::Constants::OPENED_BY_DEBUGGER, true);
d->document->setProperty(Debugger::Constants::OPENED_WITH_DISASSEMBLY, true);
......
......@@ -1325,8 +1325,8 @@ void QmlEngine::updateScriptSource(const QString &fileName, int lineOffset, int
void QmlEngine::updateDocument(Core::IDocument *document, const QTextDocument *textDocument)
{
TextEditor::BaseTextDocument *baseTextDocument
= qobject_cast<TextEditor::BaseTextDocument *>(document);
TextEditor::TextDocument *baseTextDocument
= qobject_cast<TextEditor::TextDocument *>(document);
if (!baseTextDocument)
return;
......
......@@ -262,7 +262,7 @@ bool getUninitializedVariables(const Snapshot &snapshot,
// Editor tooltip support
bool isCppEditor(BaseTextEditorWidget *editorWidget)
{
const BaseTextDocument *document = editorWidget->textDocument();
const TextDocument *document = editorWidget->textDocument();
return ProjectFile::classify(document->filePath()) != ProjectFile::Unclassified;
}
......
......@@ -43,7 +43,7 @@ namespace Internal {
class ResourceHandler;
class FormWindowFile : public TextEditor::BaseTextDocument
class FormWindowFile : public TextEditor::TextDocument
{
Q_OBJECT
......
......@@ -42,7 +42,7 @@
namespace DiffEditor {
DiffEditorDocument::DiffEditorDocument() :
Core::TextDocument(),
Core::BaseTextDocument(),
m_controller(new DiffEditorController(this))
{
setId(Constants::DIFF_EDITOR_ID);
......
......@@ -38,7 +38,7 @@ namespace DiffEditor {
class DiffEditorController;
class DIFFEDITOR_EXPORT DiffEditorDocument : public Core::TextDocument
class DIFFEDITOR_EXPORT DiffEditorDocument : public Core::BaseTextDocument
{
Q_OBJECT
public:
......
......@@ -1876,8 +1876,8 @@ void FakeVimPluginPrivate::setUseFakeVimInternal(bool on)
// Context(FAKEVIM_CONTEXT));
resetCommandBuffer();
foreach (IEditor *editor, m_editorToHandler.keys()) {
if (BaseTextDocument *textDocument =
qobject_cast<BaseTextDocument *>(editor->document())) {
if (TextDocument *textDocument =
qobject_cast<TextDocument *>(editor->document())) {
m_editorToHandler[editor]->restoreWidget(textDocument->tabSettings().m_tabSize);
}
}
......
......@@ -53,7 +53,7 @@ ProjectFilesFactory::ProjectFilesFactory()
addMimeType(Constants::INCLUDES_MIMETYPE);
addMimeType(Constants::CONFIG_MIMETYPE);
setDocumentCreator([]() { return new BaseTextDocument(Constants::FILES_EDITOR_ID); });
setDocumentCreator([]() { return new TextDocument(Constants::FILES_EDITOR_ID); });
setEditorActionHandlers(TextEditorActionHandler::None);
}
......
......@@ -337,7 +337,7 @@ GlslEditorFactory::GlslEditorFactory()
addMimeType(Constants::GLSL_MIMETYPE_VERT_ES);
addMimeType(Constants::GLSL_MIMETYPE_FRAG_ES);
setDocumentCreator([]() { return new BaseTextDocument(Constants::C_GLSLEDITOR_ID); });
setDocumentCreator([]() { return new TextDocument(Constants::C_GLSLEDITOR_ID); });
setEditorWidgetCreator([]() { return new GlslEditorWidget; });
setIndenterCreator([]() { return new GlslIndenter; });
setSyntaxHighlighterCreator([]() { return new GlslHighlighter; });
......
......@@ -77,7 +77,7 @@ void GlslHighlighter::highlightBlock(const QString &text)
lex.setScanKeywords(false);
lex.setScanComments(true);
const int variant = languageVariant(parent()
? static_cast<BaseTextDocument*>(parent())->mimeType()
? static_cast<TextDocument*>(parent())->mimeType()
: QString());
lex.setVariant(variant);
......
......@@ -83,7 +83,7 @@ Utils::FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFi
foreach (const QString &filter, nameFilters) {
filterRegs << QRegExp(filter, Qt::CaseInsensitive, QRegExp::Wildcard);
}
QMap<QString, QTextCodec *> openEditorEncodings = BaseTextDocument::openedTextDocumentEncodings();
QMap<QString, QTextCodec *> openEditorEncodings = TextDocument::openedTextDocumentEncodings();
QMap<QString, QTextCodec *> encodings;
foreach (const Project *project, projects) {
QStringList projectFiles = project->files(Project::AllFiles);
......
......@@ -405,7 +405,7 @@ void EditorConfiguration::editorsClosed(const QList<Core::IEditor*> &closedEdito
}
TabSettings actualTabSettings(const QString &fileName,
const BaseTextDocument *baseTextdocument)
const TextDocument *baseTextdocument)
{
if (baseTextdocument)
return baseTextdocument->tabSettings();
......
......@@ -43,7 +43,7 @@ class Id;
namespace TextEditor {
class BaseTextEditor;
class BaseTextEditorWidget;
class BaseTextDocument;
class TextDocument;
class TabSettings;
class ICodeStylePreferences;
class TypingSettings;
......@@ -121,7 +121,7 @@ private:
// the file belongs to and return the project settings. If the file doesn't belong to any
// project return the global settings.
PROJECTEXPLORER_EXPORT TextEditor::TabSettings actualTabSettings(
const QString &fileName, const TextEditor::BaseTextDocument *baseTextDocument);
const QString &fileName, const TextEditor::TextDocument *baseTextDocument);
} // ProjectExplorer
......
......@@ -74,7 +74,7 @@ PythonEditorFactory::PythonEditorFactory()
| TextEditorActionHandler::UnCommentSelection
| TextEditorActionHandler::UnCollapseAll);
setDocumentCreator([]() { return new BaseTextDocument(Constants::C_PYTHONEDITOR_ID); });
setDocumentCreator([]() { return new TextDocument(Constants::C_PYTHONEDITOR_ID); });
setEditorWidgetCreator([]() { return new PythonEditorWidget; });
setIndenterCreator([]() { return new PythonIndenter; });
setSyntaxHighlighterCreator([]() { return new PythonHighlighter; });
......
......@@ -162,7 +162,7 @@ void ProFileEditorWidget::contextMenuEvent(QContextMenuEvent *e)
// ProFileDocument
//
class ProFileDocument : public BaseTextDocument
class ProFileDocument : public TextDocument
{
public:
ProFileDocument();
......
......@@ -49,7 +49,7 @@ void BaseTextEditModifier::indent(int offset, int length)
if (TextEditor::BaseTextEditorWidget *baseTextEditorWidget = qobject_cast<TextEditor::BaseTextEditorWidget*>(plainTextEdit())) {