texteditor: merge ITextEditable into ITextEditor

rename BastTextEditor->BaseTextEditorWidget, BaseTextEditorEditable->BaseTextEditor
rename BaseTextEditor{,Widget} subclasses
rename editableInterface->editorInterface
rename createEditableInterface->createEditor
minor cleanups after renamings
This commit is contained in:
hjk
2011-02-21 16:02:26 +01:00
parent e32cf192f7
commit f576ad9f2c
180 changed files with 1326 additions and 1382 deletions

View File

@@ -51,27 +51,27 @@ using namespace CMakeProjectManager::Internal;
// ProFileEditorEditable
//
CMakeEditorEditable::CMakeEditorEditable(CMakeEditor *editor)
: BaseTextEditorEditable(editor),
CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
: BaseTextEditor(editor),
m_context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
TextEditor::Constants::C_TEXTEDITOR)
{ }
Core::Context CMakeEditorEditable::context() const
Core::Context CMakeEditor::context() const
{
return m_context;
}
Core::IEditor *CMakeEditorEditable::duplicate(QWidget *parent)
Core::IEditor *CMakeEditor::duplicate(QWidget *parent)
{
CMakeEditor *ret = new CMakeEditor(parent, qobject_cast<CMakeEditor*>(editor())->factory(),
qobject_cast<CMakeEditor*>(editor())->actionHandler());
ret->duplicateFrom(editor());
CMakeEditorWidget *w = qobject_cast<CMakeEditorWidget*>(editorWidget());
CMakeEditorWidget *ret = new CMakeEditorWidget(parent, w->factory(), w->actionHandler());
ret->duplicateFrom(w);
TextEditor::TextEditorSettings::instance()->initializeEditor(ret);
return ret->editableInterface();
return ret->editor();
}
QString CMakeEditorEditable::id() const
QString CMakeEditor::id() const
{
return QLatin1String(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
}
@@ -80,8 +80,8 @@ QString CMakeEditorEditable::id() const
// CMakeEditor
//
CMakeEditor::CMakeEditor(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah)
: BaseTextEditor(parent), m_factory(factory), m_ah(ah)
CMakeEditorWidget::CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah)
: BaseTextEditorWidget(parent), m_factory(factory), m_ah(ah)
{
CMakeDocument *doc = new CMakeDocument();
doc->setMimeType(QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE));
@@ -92,18 +92,18 @@ CMakeEditor::CMakeEditor(QWidget *parent, CMakeEditorFactory *factory, TextEdito
baseTextDocument()->setSyntaxHighlighter(new CMakeHighlighter);
}
CMakeEditor::~CMakeEditor()
CMakeEditorWidget::~CMakeEditorWidget()
{
}
TextEditor::BaseTextEditorEditable *CMakeEditor::createEditableInterface()
TextEditor::BaseTextEditor *CMakeEditorWidget::createEditor()
{
return new CMakeEditorEditable(this);
return new CMakeEditor(this);
}
void CMakeEditor::setFontSettings(const TextEditor::FontSettings &fs)
void CMakeEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
{
TextEditor::BaseTextEditor::setFontSettings(fs);
TextEditor::BaseTextEditorWidget::setFontSettings(fs);
CMakeHighlighter *highlighter = qobject_cast<CMakeHighlighter*>(baseTextDocument()->syntaxHighlighter());
if (!highlighter)
return;

View File

@@ -45,18 +45,16 @@ class FontSettings;
}
namespace CMakeProjectManager {
namespace Internal {
class CMakeManager;
class CMakeEditorWidget;
class CMakeHighlighter;
class CMakeManager;
class CMakeEditor;
class CMakeEditorEditable : public TextEditor::BaseTextEditorEditable
class CMakeEditor : public TextEditor::BaseTextEditor
{
public:
CMakeEditorEditable(CMakeEditor *);
CMakeEditor(CMakeEditorWidget *);
Core::Context context() const;
bool duplicateSupported() const { return true; }
@@ -67,20 +65,21 @@ private:
const Core::Context m_context;
};
class CMakeEditor : public TextEditor::BaseTextEditor
class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
{
Q_OBJECT
public:
CMakeEditor(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah);
~CMakeEditor();
CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah);
~CMakeEditorWidget();
bool save(const QString &fileName = QString());
CMakeEditorFactory *factory() { return m_factory; }
TextEditor::TextEditorActionHandler *actionHandler() const { return m_ah; }
protected:
TextEditor::BaseTextEditorEditable *createEditableInterface();
TextEditor::BaseTextEditor *createEditor();
public slots:
virtual void setFontSettings(const TextEditor::FontSettings &);

View File

@@ -71,9 +71,9 @@ Core::IFile *CMakeEditorFactory::open(const QString &fileName)
Core::IEditor *CMakeEditorFactory::createEditor(QWidget *parent)
{
CMakeEditor *rc = new CMakeEditor(parent, this, m_actionHandler);
CMakeEditorWidget *rc = new CMakeEditorWidget(parent, this, m_actionHandler);
TextEditor::TextEditorSettings::instance()->initializeEditor(rc);
return rc->editableInterface();
return rc->editor();
}
QStringList CMakeEditorFactory::mimeTypes() const