Commit 5640635d authored by Eike Ziller's avatar Eike Ziller

Editors: Remove some unused factory variables

Change-Id: I6df843561c4d502b3d7c1844d65a59ad2855f0c0
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 07b8b7de
......@@ -31,7 +31,6 @@
#include "cmakefilecompletionassist.h"
#include "cmakehighlighter.h"
#include "cmakeeditorfactory.h"
#include "cmakeprojectconstants.h"
#include "cmakeproject.h"
......@@ -68,7 +67,7 @@ CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
Core::IEditor *CMakeEditor::duplicate()
{
CMakeEditorWidget *w = qobject_cast<CMakeEditorWidget*>(widget());
CMakeEditorWidget *ret = new CMakeEditorWidget(w->factory());
CMakeEditorWidget *ret = new CMakeEditorWidget();
ret->duplicateFrom(w);
TextEditor::TextEditorSettings::initializeEditor(ret);
return ret->editor();
......@@ -116,8 +115,8 @@ void CMakeEditor::build()
// CMakeEditor
//
CMakeEditorWidget::CMakeEditorWidget(CMakeEditorFactory *factory, QWidget *parent)
: BaseTextEditorWidget(parent), m_factory(factory)
CMakeEditorWidget::CMakeEditorWidget(QWidget *parent)
: BaseTextEditorWidget(parent)
{
QSharedPointer<CMakeDocument> doc(new CMakeDocument);
doc->setMimeType(QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE));
......
......@@ -30,8 +30,6 @@
#ifndef CMAKEEDITOR_H
#define CMAKEEDITOR_H
#include "cmakeeditorfactory.h"
#include <texteditor/basetextdocument.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/codeassist/completionassistprovider.h>
......@@ -71,12 +69,10 @@ class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
Q_OBJECT
public:
CMakeEditorWidget(CMakeEditorFactory *factory, QWidget *parent = 0);
CMakeEditorWidget(QWidget *parent = 0);
bool save(const QString &fileName = QString());
CMakeEditorFactory *factory() { return m_factory; }
Link findLinkAt(const QTextCursor &cursor, bool resolveTarget = true, bool inNextSplit = false);
protected:
......@@ -87,7 +83,6 @@ public slots:
void unCommentSelection();
private:
CMakeEditorFactory *m_factory;
Utils::CommentDefinition m_commentDefinition;
};
......
......@@ -71,7 +71,7 @@ CMakeEditorFactory::CMakeEditorFactory(CMakeManager *manager)
Core::IEditor *CMakeEditorFactory::createEditor()
{
CMakeEditorWidget *rc = new CMakeEditorWidget(this);
CMakeEditorWidget *rc = new CMakeEditorWidget();
TextEditor::TextEditorSettings::initializeEditor(rc);
return rc->editor();
}
......@@ -64,7 +64,7 @@ ProjectFilesFactory::ProjectFilesFactory(Manager *manager)
Core::IEditor *ProjectFilesFactory::createEditor()
{
ProjectFilesEditorWidget *ed = new ProjectFilesEditorWidget(this);
ProjectFilesEditorWidget *ed = new ProjectFilesEditorWidget();
TextEditorSettings::initializeEditor(ed);
return ed->editor();
}
......@@ -94,7 +94,7 @@ bool ProjectFilesEditor::duplicateSupported() const
Core::IEditor *ProjectFilesEditor::duplicate()
{
ProjectFilesEditorWidget *parentEditor = qobject_cast<ProjectFilesEditorWidget *>(editorWidget());
ProjectFilesEditorWidget *editor = new ProjectFilesEditorWidget(parentEditor->factory());
ProjectFilesEditorWidget *editor = new ProjectFilesEditorWidget();
editor->duplicateFrom(parentEditor);
TextEditorSettings::initializeEditor(editor);
return editor->editor();
......@@ -106,19 +106,13 @@ Core::IEditor *ProjectFilesEditor::duplicate()
//
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesEditorWidget::ProjectFilesEditorWidget(ProjectFilesFactory *factory, QWidget *parent)
: BaseTextEditorWidget(parent),
m_factory(factory)
ProjectFilesEditorWidget::ProjectFilesEditorWidget(QWidget *parent)
: BaseTextEditorWidget(parent)
{
QSharedPointer<BaseTextDocument> doc(new BaseTextDocument());
setBaseTextDocument(doc);
}
ProjectFilesFactory *ProjectFilesEditorWidget::factory() const
{
return m_factory;
}
BaseTextEditor *ProjectFilesEditorWidget::createEditor()
{
return new ProjectFilesEditor(this);
......
......@@ -41,7 +41,6 @@ namespace Internal {
class Manager;
class ProjectFilesEditor;
class ProjectFilesEditorWidget;
class ProjectFilesFactory;
class ProjectFilesFactory: public Core::IEditorFactory
{
......@@ -70,13 +69,9 @@ class ProjectFilesEditorWidget : public TextEditor::BaseTextEditorWidget
Q_OBJECT
public:
ProjectFilesEditorWidget(ProjectFilesFactory *factory, QWidget *parent = 0);
ProjectFilesEditorWidget(QWidget *parent = 0);
ProjectFilesFactory *factory() const;
TextEditor::BaseTextEditor *createEditor();
private:
ProjectFilesFactory *m_factory;
};
} // namespace Internal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment