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:
@@ -35,19 +35,7 @@
|
||||
|
||||
#include <qmljstools/qmljstoolsconstants.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <extensionsystem/pluginspec.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/infobar.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QDebug>
|
||||
#include <QSettings>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
||||
namespace QmlJSEditor {
|
||||
namespace Internal {
|
||||
@@ -55,24 +43,15 @@ namespace Internal {
|
||||
QmlJSEditorFactory::QmlJSEditorFactory(QObject *parent)
|
||||
: Core::IEditorFactory(parent)
|
||||
{
|
||||
m_mimeTypes
|
||||
<< QLatin1String(QmlJSTools::Constants::QML_MIMETYPE)
|
||||
<< QLatin1String(QmlJSTools::Constants::QMLPROJECT_MIMETYPE)
|
||||
<< QLatin1String(QmlJSTools::Constants::QBS_MIMETYPE)
|
||||
<< QLatin1String(QmlJSTools::Constants::QMLTYPES_MIMETYPE)
|
||||
<< QLatin1String(QmlJSTools::Constants::JS_MIMETYPE)
|
||||
<< QLatin1String(QmlJSTools::Constants::JSON_MIMETYPE)
|
||||
;
|
||||
}
|
||||
setId(Constants::C_QMLJSEDITOR_ID);
|
||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::C_QMLJSEDITOR_DISPLAY_NAME));
|
||||
|
||||
Core::Id QmlJSEditorFactory::id() const
|
||||
{
|
||||
return Core::Id(Constants::C_QMLJSEDITOR_ID);
|
||||
}
|
||||
|
||||
QString QmlJSEditorFactory::displayName() const
|
||||
{
|
||||
return qApp->translate("OpenWith::Editors", Constants::C_QMLJSEDITOR_DISPLAY_NAME);
|
||||
addMimeType(QmlJSTools::Constants::QML_MIMETYPE);
|
||||
addMimeType(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
|
||||
addMimeType(QmlJSTools::Constants::QBS_MIMETYPE);
|
||||
addMimeType(QmlJSTools::Constants::QMLTYPES_MIMETYPE);
|
||||
addMimeType(QmlJSTools::Constants::JS_MIMETYPE);
|
||||
addMimeType(QmlJSTools::Constants::JSON_MIMETYPE);
|
||||
}
|
||||
|
||||
Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent)
|
||||
@@ -82,10 +61,5 @@ Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent)
|
||||
return rc->editor();
|
||||
}
|
||||
|
||||
QStringList QmlJSEditorFactory::mimeTypes() const
|
||||
{
|
||||
return m_mimeTypes;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlJSEditor
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
namespace QmlJSEditor {
|
||||
namespace Internal {
|
||||
|
||||
@@ -44,14 +42,7 @@ class QmlJSEditorFactory : public Core::IEditorFactory
|
||||
public:
|
||||
QmlJSEditorFactory(QObject *parent);
|
||||
|
||||
// IEditorFactory
|
||||
QStringList mimeTypes() const;
|
||||
Core::Id id() const;
|
||||
QString displayName() const;
|
||||
Core::IEditor *createEditor(QWidget *parent);
|
||||
|
||||
private:
|
||||
QStringList m_mimeTypes;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user