From b772001c82579f46b778341a3ad5e444455e7269 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 31 May 2013 19:35:37 +0200 Subject: EditorFactory: Replace some virtual functions with data members Change-Id: I014cb57460c4e3a36bf7403960908b5ffec867ff Reviewed-by: David Schulz --- src/plugins/pythoneditor/pythoneditorfactory.cpp | 19 +++---------------- src/plugins/pythoneditor/pythoneditorfactory.h | 15 --------------- 2 files changed, 3 insertions(+), 31 deletions(-) (limited to 'src/plugins/pythoneditor') diff --git a/src/plugins/pythoneditor/pythoneditorfactory.cpp b/src/plugins/pythoneditor/pythoneditorfactory.cpp index 5dc783f6ae..e0b36e1899 100644 --- a/src/plugins/pythoneditor/pythoneditorfactory.cpp +++ b/src/plugins/pythoneditor/pythoneditorfactory.cpp @@ -43,17 +43,9 @@ namespace PythonEditor { EditorFactory::EditorFactory(QObject *parent) : Core::IEditorFactory(parent) { - m_mimeTypes << QLatin1String(Constants::C_PY_MIMETYPE); -} - -Core::Id EditorFactory::id() const -{ - return Constants::C_PYTHONEDITOR_ID; -} - -QString EditorFactory::displayName() const -{ - return tr(Constants::C_EDITOR_DISPLAY_NAME); + setId(Constants::C_PYTHONEDITOR_ID); + setDisplayName(tr(Constants::C_EDITOR_DISPLAY_NAME)); + addMimeType(QLatin1String(Constants::C_PY_MIMETYPE)); } Core::IEditor *EditorFactory::createEditor(QWidget *parent) @@ -64,9 +56,4 @@ Core::IEditor *EditorFactory::createEditor(QWidget *parent) return widget->editor(); } -QStringList EditorFactory::mimeTypes() const -{ - return m_mimeTypes; -} - } // namespace PythonEditor diff --git a/src/plugins/pythoneditor/pythoneditorfactory.h b/src/plugins/pythoneditor/pythoneditorfactory.h index 5879e6fe39..3340021212 100644 --- a/src/plugins/pythoneditor/pythoneditorfactory.h +++ b/src/plugins/pythoneditor/pythoneditorfactory.h @@ -32,7 +32,6 @@ #include "pythoneditor_global.h" #include -#include namespace PythonEditor { @@ -43,24 +42,10 @@ class PYEDITOR_EXPORT EditorFactory : public Core::IEditorFactory public: EditorFactory(QObject *parent); - /** - Returns MIME types handled by editor - */ - QStringList mimeTypes() const; - - /** - Unique editor class identifier, see Constants::C_PYEDITOR_ID - */ - Core::Id id() const; - QString displayName() const; - /** Creates and initializes new editor widget */ Core::IEditor *createEditor(QWidget *parent); - -private: - QStringList m_mimeTypes; }; } // namespace PythonEditor -- cgit v1.2.1