TextEditors: Remove widget's setTabSettings method

Change-Id: If212b45e2d526534b7853f3fa23b170f61e1976e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Eike Ziller
2014-01-17 17:09:15 +01:00
parent f506104f29
commit 4eff289e03
16 changed files with 102 additions and 62 deletions

View File

@@ -512,7 +512,7 @@ CPPEditor::CPPEditor(CPPEditorWidget *editor)
Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder)
CPPEditorWidget::CPPEditorWidget(QWidget *parent)
: TextEditor::BaseTextEditorWidget(parent)
: TextEditor::BaseTextEditorWidget(new CPPEditorDocument(), parent)
{
baseTextDocument()->setIndenter(new CppTools::CppQtStyleIndenter);
ctor();
@@ -1583,14 +1583,6 @@ void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
highlighter->rehighlight();
}
void CPPEditorWidget::setTabSettings(const TextEditor::TabSettings &ts)
{
CppTools::QtStyleCodeFormatter formatter;
formatter.invalidateCache(document());
TextEditor::BaseTextEditorWidget::setTabSettings(ts);
}
void CPPEditorWidget::unCommentSelection()
{
Utils::unCommentSelection(this);
@@ -2027,4 +2019,16 @@ void CPPEditorWidget::showPreProcessorWidget()
}
}
CPPEditorDocument::CPPEditorDocument()
{
connect(this, SIGNAL(tabSettingsChanged()),
this, SLOT(invalidateFormatterCache()));
}
void CPPEditorDocument::invalidateFormatterCache()
{
CppTools::QtStyleCodeFormatter formatter;
formatter.invalidateCache(document());
}
#include <cppeditor.moc>