diff options
author | hjk <hjk121@nokiamail.com> | 2013-05-31 19:35:37 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-08-02 10:21:15 +0200 |
commit | b772001c82579f46b778341a3ad5e444455e7269 (patch) | |
tree | 85c49bb225885cafb0e3a8841c73863118d71747 /src/plugins/pythoneditor | |
parent | be112d853a49d7d183819a22d6f776430b0b38e8 (diff) | |
download | qt-creator-b772001c82579f46b778341a3ad5e444455e7269.tar.gz |
EditorFactory: Replace some virtual functions with data members
Change-Id: I014cb57460c4e3a36bf7403960908b5ffec867ff
Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src/plugins/pythoneditor')
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorfactory.cpp | 19 | ||||
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorfactory.h | 15 |
2 files changed, 3 insertions, 31 deletions
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 <coreplugin/editormanager/ieditorfactory.h> -#include <QStringList> namespace PythonEditor { @@ -44,23 +43,9 @@ 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 |