forked from qt-creator/qt-creator
TextEditor: Replace PlainTextDocument by Base + a setup function
Change-Id: I1088062d0b74fd0dd69e92c55cc8bb80da61ae2d Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "tabsettings.h"
|
||||
#include "texteditorconstants.h"
|
||||
#include "typingsettings.h"
|
||||
#include <texteditor/generichighlighter/highlighter.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
@@ -49,6 +50,7 @@
|
||||
#include <QStringList>
|
||||
#include <QTextCodec>
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -80,6 +82,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void onModificationChanged(bool modified);
|
||||
void updateTabSettings();
|
||||
|
||||
public:
|
||||
QString m_defaultPath;
|
||||
@@ -197,6 +200,12 @@ void BaseTextDocumentPrivate::onModificationChanged(bool modified)
|
||||
updateRevisions();
|
||||
}
|
||||
|
||||
void BaseTextDocumentPrivate::updateTabSettings()
|
||||
{
|
||||
if (Highlighter *highlighter = qobject_cast<Highlighter *>(m_highlighter))
|
||||
highlighter->setTabSettings(m_tabSettings);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -318,6 +327,11 @@ void BaseTextDocument::triggerPendingUpdates()
|
||||
applyFontSettings();
|
||||
}
|
||||
|
||||
void BaseTextDocument::setupAsPlainTextDocument()
|
||||
{
|
||||
connect(this, SIGNAL(tabSettingsChanged()), d, SLOT(updateTabSettings()));
|
||||
}
|
||||
|
||||
void BaseTextDocument::applyFontSettings()
|
||||
{
|
||||
d->m_fontSettingsNeedsApply = false;
|
||||
|
||||
Reference in New Issue
Block a user