forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user