forked from qt-creator/qt-creator
TextEditor: Update tab settings for all tab changes
Not just for selected documents. This also removes the need for the separate setupAsPlainTextDocument function. Change-Id: I51a04eebbad37a7598068ce6e157a53c1519464f Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -82,7 +82,6 @@ public:
|
||||
|
||||
public slots:
|
||||
void onModificationChanged(bool modified);
|
||||
void updateTabSettings();
|
||||
|
||||
public:
|
||||
QString m_defaultPath;
|
||||
@@ -200,13 +199,6 @@ void BaseTextDocumentPrivate::onModificationChanged(bool modified)
|
||||
updateRevisions();
|
||||
}
|
||||
|
||||
void BaseTextDocumentPrivate::updateTabSettings()
|
||||
{
|
||||
if (Highlighter *highlighter = qobject_cast<Highlighter *>(m_highlighter))
|
||||
highlighter->setTabSettings(m_tabSettings);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BaseTextDocument
|
||||
@@ -304,6 +296,10 @@ void BaseTextDocument::setTabSettings(const TextEditor::TabSettings &tabSettings
|
||||
if (tabSettings == d->m_tabSettings)
|
||||
return;
|
||||
d->m_tabSettings = tabSettings;
|
||||
|
||||
if (Highlighter *highlighter = qobject_cast<Highlighter *>(d->m_highlighter))
|
||||
highlighter->setTabSettings(tabSettings);
|
||||
|
||||
emit tabSettingsChanged();
|
||||
}
|
||||
|
||||
@@ -327,11 +323,6 @@ 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