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:
@@ -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
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "pythoneditor_global.h"
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
#include <QStringList>
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user