Unduplicated the code that initializes editor settings

This stuff was all over the place, a relic from before the editor
settings were unified. Now the initialization is only done in
TextEditorSettings.

Fixes the .pro file editor and the generic project files editor, which
before only used the font settings.
This commit is contained in:
Thorbjørn Lindeijer
2009-03-17 18:17:51 +01:00
parent a952a9bfa8
commit 0a48bd8731
11 changed files with 38 additions and 76 deletions

View File

@@ -39,7 +39,7 @@ Manager *ProjectFilesFactory::manager() const
Core::IEditor *ProjectFilesFactory::createEditor(QWidget *parent)
{
ProjectFilesEditor *ed = new ProjectFilesEditor(parent, this, _actionHandler);
ed->initialize();
TextEditor::TextEditorSettings::instance()->initializeEditor(ed);
return ed->editableInterface();
}
@@ -98,7 +98,7 @@ Core::IEditor *ProjectFilesEditable::duplicate(QWidget *parent)
ProjectFilesEditor *editor = new ProjectFilesEditor(parent,
parentEditor->factory(),
parentEditor->actionHandler());
editor->initialize();
TextEditor::TextEditorSettings::instance()->initializeEditor(editor);
return editor->editableInterface();
}
@@ -122,16 +122,6 @@ ProjectFilesEditor::ProjectFilesEditor(QWidget *parent, ProjectFilesFactory *fac
ProjectFilesEditor::~ProjectFilesEditor()
{ }
void ProjectFilesEditor::initialize()
{
TextEditor::TextEditorSettings *settings = TextEditor::TextEditorSettings::instance();
connect(settings, SIGNAL(fontSettingsChanged(const TextEditor::FontSettings&)),
this, SLOT(setFontSettings(const TextEditor::FontSettings&)));
setFontSettings(settings->fontSettings());
}
ProjectFilesFactory *ProjectFilesEditor::factory() const
{
return _factory;