forked from qt-creator/qt-creator
EditorFactory: Replace some virtual functions with data members
Change-Id: I014cb57460c4e3a36bf7403960908b5ffec867ff Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -46,12 +46,15 @@ using namespace TextEditor::Internal;
|
||||
PlainTextEditorFactory::PlainTextEditorFactory(QObject *parent)
|
||||
: Core::IEditorFactory(parent)
|
||||
{
|
||||
setId(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
||||
setDisplayName(qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME));
|
||||
addMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT));
|
||||
|
||||
m_actionHandler = new TextEditorActionHandler(
|
||||
TextEditor::Constants::C_TEXTEDITOR,
|
||||
TextEditorActionHandler::Format |
|
||||
TextEditorActionHandler::UnCommentSelection |
|
||||
TextEditorActionHandler::UnCollapseAll);
|
||||
m_mimeTypes << QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT);
|
||||
}
|
||||
|
||||
PlainTextEditorFactory::~PlainTextEditorFactory()
|
||||
@@ -59,16 +62,6 @@ PlainTextEditorFactory::~PlainTextEditorFactory()
|
||||
delete m_actionHandler;
|
||||
}
|
||||
|
||||
Core::Id PlainTextEditorFactory::id() const
|
||||
{
|
||||
return Core::Id(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
||||
}
|
||||
|
||||
QString PlainTextEditorFactory::displayName() const
|
||||
{
|
||||
return qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME);
|
||||
}
|
||||
|
||||
Core::IEditor *PlainTextEditorFactory::createEditor(QWidget *parent)
|
||||
{
|
||||
PlainTextEditorWidget *rc = new PlainTextEditorWidget(parent);
|
||||
@@ -106,13 +99,3 @@ void PlainTextEditorFactory::updateEditorInfoBar(Core::IEditor *editor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PlainTextEditorFactory::addMimeType(const QString &type)
|
||||
{
|
||||
m_mimeTypes.append(type);
|
||||
}
|
||||
|
||||
QStringList PlainTextEditorFactory::mimeTypes() const
|
||||
{
|
||||
return m_mimeTypes;
|
||||
}
|
||||
|
Reference in New Issue
Block a user