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

@@ -20,7 +20,6 @@ HEADERS = builddirmanager.h \
cmaketool.h \
cmakeparser.h \
cmakesettingspage.h \
cmakesnippetprovider.h \
cmaketoolmanager.h \
cmake_global.h \
cmakekitinformation.h \
@@ -53,7 +52,6 @@ SOURCES = builddirmanager.cpp \
cmaketool.cpp \
cmakeparser.cpp \
cmakesettingspage.cpp \
cmakesnippetprovider.cpp \
cmaketoolmanager.cpp \
cmakekitinformation.cpp \
cmakekitconfigwidget.cpp \

View File

@@ -66,8 +66,6 @@ QtcPlugin {
"cmaketoolmanager.h",
"cmakesettingspage.h",
"cmakesettingspage.cpp",
"cmakesnippetprovider.cpp",
"cmakesnippetprovider.h",
"cmakeindenter.h",
"cmakeindenter.cpp",
"cmakeautocompleter.h",

View File

@@ -33,7 +33,6 @@
#include "cmakeprojectnodes.h"
#include "cmakebuildconfiguration.h"
#include "cmakerunconfiguration.h"
#include "cmakesnippetprovider.h"
#include "cmakeprojectconstants.h"
#include "cmakelocatorfilter.h"
#include "cmakesettingspage.h"
@@ -48,6 +47,8 @@
#include <projectexplorer/projectmanager.h>
#include <projectexplorer/projecttree.h>
#include <texteditor/snippets/snippetprovider.h>
#include <utils/parameteraction.h>
using namespace CMakeProjectManager::Internal;
@@ -62,7 +63,8 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
Core::FileIconProvider::registerIconOverlayForSuffix(Constants::FILEOVERLAY_CMAKE, "cmake");
Core::FileIconProvider::registerIconOverlayForFilename(Constants::FILEOVERLAY_CMAKE, "CMakeLists.txt");
addAutoReleasedObject(new Internal::CMakeSnippetProvider);
TextEditor::SnippetProvider::registerGroup(Constants::CMAKE_SNIPPETS_GROUP_ID,
tr("CMake", "SnippetProvider"));
addAutoReleasedObject(new CMakeSettingsPage);
addAutoReleasedObject(new CMakeManager);

View File

@@ -1,55 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "cmakesnippetprovider.h"
#include "cmakeprojectconstants.h"
#include "cmakeeditor.h"
#include <texteditor/snippets/snippeteditor.h>
namespace CMakeProjectManager {
namespace Internal {
CMakeSnippetProvider::~CMakeSnippetProvider() = default;
QString CMakeSnippetProvider::groupId() const
{
return QLatin1String(Constants::CMAKE_SNIPPETS_GROUP_ID);
}
QString CMakeSnippetProvider::displayName() const
{
return tr("CMake");
}
void CMakeSnippetProvider::decorateEditor(TextEditor::SnippetEditorWidget *editor) const
{
Q_UNUSED(editor);
// What needs to go here?
}
} // namespace Internal
} // namespace CMakeProjectManager

View File

@@ -1,46 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <texteditor/snippets/isnippetprovider.h>
namespace CMakeProjectManager {
namespace Internal {
class CMakeSnippetProvider : public TextEditor::ISnippetProvider
{
Q_OBJECT
public:
~CMakeSnippetProvider() final;
QString groupId() const final;
QString displayName() const final;
void decorateEditor(TextEditor::SnippetEditorWidget *editor) const final;
};
} // namespace Internal
} // namespace CMakeProjectManager