Commit 7dfbb1b1 authored by hjk's avatar hjk

TextEditor: Remove HighLighterFactory

Unused.

Change-Id: Idd9805756c51e025e99842fa6fc8707b10927c4d
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent f566d7ea
......@@ -55,7 +55,6 @@
#include <cpptools/cpptoolsconstants.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/highlighterfactory.h>
#include <utils/hostosinfo.h>
......@@ -160,15 +159,6 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
addAutoReleasedObject(new CppIncludeHierarchyFactory);
addAutoReleasedObject(new CppSnippetProvider);
auto hf = new TextEditor::HighlighterFactory;
hf->setProductType<CppHighlighter>();
hf->setId(Constants::CPPEDITOR_ID);
hf->addMimeType(Constants::C_SOURCE_MIMETYPE);
hf->addMimeType(Constants::C_HEADER_MIMETYPE);
hf->addMimeType(Constants::CPP_SOURCE_MIMETYPE);
hf->addMimeType(Constants::CPP_HEADER_MIMETYPE);
addAutoReleasedObject(hf);
m_quickFixProvider = new CppQuickFixAssistProvider;
addAutoReleasedObject(m_quickFixProvider);
registerQuickFixes(this);
......
......@@ -46,7 +46,6 @@
#include <texteditor/texteditor.h>
#include <texteditor/textdocumentlayout.h>
#include <texteditor/highlighterfactory.h>
#include <texteditor/syntaxhighlighter.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditorsettings.h>
......
......@@ -45,7 +45,6 @@
#include <texteditor/texteditor.h>
#include <texteditor/textdocumentlayout.h>
#include <texteditor/highlighterfactory.h>
#include <texteditor/syntaxhighlighter.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditorsettings.h>
......
......@@ -49,7 +49,6 @@
#include <extensionsystem/pluginmanager.h>
#include <texteditor/highlighterfactory.h>
#include <texteditor/texteditorconstants.h>
#include <utils/qtcassert.h>
......@@ -155,16 +154,6 @@ bool GlslEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT_ES);
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG_ES);
auto hf = new HighlighterFactory;
hf->setProductType<GlslHighlighter>();
hf->setId(Constants::C_GLSLEDITOR_ID);
hf->addMimeType(Constants::GLSL_MIMETYPE);
hf->addMimeType(Constants::GLSL_MIMETYPE_VERT);
hf->addMimeType(Constants::GLSL_MIMETYPE_FRAG);
hf->addMimeType(Constants::GLSL_MIMETYPE_VERT_ES);
hf->addMimeType(Constants::GLSL_MIMETYPE_FRAG_ES);
addAutoReleasedObject(hf);
return true;
}
......
......@@ -41,7 +41,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/highlighterfactory.h>
#include <QtPlugin>
#include <QCoreApplication>
......@@ -225,12 +224,6 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
// Add Python files and classes creation dialogs
addAutoReleasedObject(new ClassWizard);
auto hf = new TextEditor::HighlighterFactory;
hf->setId(Constants::C_PYTHONEDITOR_ID);
hf->setProductType<PythonHighlighter>();
hf->addMimeType(QLatin1String(Constants::C_PY_MIMETYPE));
addAutoReleasedObject(hf);
return true;
}
......
......@@ -64,7 +64,6 @@
#include <coreplugin/editormanager/ieditor.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/highlighterfactory.h>
#include <utils/hostosinfo.h>
#include <utils/parameteraction.h>
......@@ -137,14 +136,6 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
addAutoReleasedObject(new ProFileCompletionAssistProvider);
addAutoReleasedObject(new ProFileEditorFactory);
auto hf = new TextEditor::HighlighterFactory;
hf->setProductType<ProFileHighlighter>();
hf->setId(QmakeProjectManager::Constants::PROFILE_EDITOR_ID);
hf->addMimeType(QmakeProjectManager::Constants::PROFILE_MIMETYPE);
hf->addMimeType(QmakeProjectManager::Constants::PROINCLUDEFILE_MIMETYPE);
hf->addMimeType(QmakeProjectManager::Constants::PROFEATUREFILE_MIMETYPE);
addAutoReleasedObject(hf);
//menus
Core::ActionContainer *mbuild =
Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT);
......
......@@ -58,7 +58,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/taskhub.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/highlighterfactory.h>
#include <utils/qtcassert.h>
#include <utils/json.h>
......@@ -108,17 +107,6 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
m_modelManager = QmlJS::ModelManagerInterface::instance();
addAutoReleasedObject(new QmlJSSnippetProvider);
auto hf = new TextEditor::HighlighterFactory;
hf->setProductType<QmlJSHighlighter>();
hf->setId(Constants::C_QMLJSEDITOR_ID);
hf->addMimeType(QmlJSTools::Constants::QML_MIMETYPE);
hf->addMimeType(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
hf->addMimeType(QmlJSTools::Constants::QBS_MIMETYPE);
hf->addMimeType(QmlJSTools::Constants::QMLTYPES_MIMETYPE);
hf->addMimeType(QmlJSTools::Constants::JS_MIMETYPE);
hf->addMimeType(QmlJSTools::Constants::JSON_MIMETYPE);
addAutoReleasedObject(hf);
// QML task updating manager
m_qmlTaskManager = new QmlTaskManager;
addAutoReleasedObject(m_qmlTaskManager);
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef HIGHLIGHTERFACTORY_H
#define HIGHLIGHTERFACTORY_H
#include <texteditor/texteditor_global.h>
#include <coreplugin/id.h>
#include <QObject>
#include <QStringList>
#include <functional>
namespace TextEditor {
class SyntaxHighlighter;
class TEXTEDITOR_EXPORT HighlighterFactory : public QObject
{
Q_OBJECT
public:
typedef std::function<SyntaxHighlighter *()> Creator;
TextEditor::SyntaxHighlighter *createHighlighter() const { return m_creator(); }
template <class T> void setProductType() { m_creator = []() { return new T; }; }
Core::Id id() const { return m_id; }
QStringList mimeTypes() const { return m_mimeTypes; }
void setId(Core::Id id) { m_id = id; }
void setMimeTypes(const QStringList &mimeTypes) { m_mimeTypes = mimeTypes; }
void addMimeType(const char *mimeType) { m_mimeTypes.append(QLatin1String(mimeType)); }
void addMimeType(const QString &mimeType) { m_mimeTypes.append(mimeType); }
private:
Core::Id m_id;
QStringList m_mimeTypes;
Creator m_creator;
};
} // TextEditor
#endif // HIGHLIGHTERFACTORY_H
......@@ -134,7 +134,6 @@ HEADERS += texteditorplugin.h \
normalindenter.h \
indenter.h \
quickfix.h \
highlighterfactory.h \
syntaxhighlighter.h \
highlighterutils.h \
generichighlighter/reuse.h \
......
......@@ -77,7 +77,6 @@ QtcPlugin {
"icodestylepreferences.h",
"icodestylepreferencesfactory.cpp",
"icodestylepreferencesfactory.h",
"highlighterfactory.h",
"indenter.cpp",
"indenter.h",
"ioutlinewidget.h",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment