Remove the need to create ISnippetProvider subclasses

Change-Id: I1810aaa945136d9726a66dad41377429a6adc8e1
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2017-04-24 15:52:04 +02:00
parent 46b7701398
commit 9443f7104b
49 changed files with 163 additions and 629 deletions

View File

@@ -34,7 +34,7 @@
#include "linenumberfilter.h"
#include "outlinefactory.h"
#include "plaintexteditorfactory.h"
#include "snippets/plaintextsnippetprovider.h"
#include "snippets/snippetprovider.h"
#include "texteditoractionhandler.h"
#include "texteditorsettings.h"
#include "textmarkregistry.h"
@@ -80,6 +80,11 @@ TextEditorPlugin::~TextEditorPlugin()
m_instance = 0;
}
TextEditorPlugin *TextEditorPlugin::instance()
{
return m_instance;
}
// ExtensionSystem::PluginInterface
bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
@@ -119,7 +124,8 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
connect(ICore::instance(), &ICore::coreOpened, Manager::instance(), &Manager::registerHighlightingFiles);
// Add text snippet provider.
addAutoReleasedObject(new PlainTextSnippetProvider);
SnippetProvider::registerGroup(Constants::TEXT_SNIPPET_GROUP_ID,
tr("Text", "SnippetProvider"));
m_outlineFactory = new OutlineFactory;
addAutoReleasedObject(m_outlineFactory);