Clang: new empty locator filter classes

Introduce classes to replace builtin locator filters.

Change-Id: I5cc6f15fb0f59ea8a51b14a86301cf219cc0d6d6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2017-11-24 10:46:31 +01:00
parent cf7f898db3
commit 92cdfc0c2a
40 changed files with 1230 additions and 52 deletions

View File

@@ -1,28 +1,38 @@
INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/refactoringengine.h \
$$PWD/refactoringconnectionclient.h \
$$PWD/clangqueryexamplehighlighter.h \
$$PWD/clangqueryexamplehighlightmarker.h \
$$PWD/clangqueryhighlighter.h \
$$PWD/clangqueryhighlightmarker.h \
$$PWD/clangqueryprojectsfindfilter.h \
$$PWD/classesfilter.h \
$$PWD/functionsfilter.h \
$$PWD/includesfilter.h \
$$PWD/locatorfilter.h \
$$PWD/projectpartutilities.h \
$$PWD/refactoringclient.h \
$$PWD/refactoringconnectionclient.h \
$$PWD/refactoringengine.h \
$$PWD/refactoringprojectupdater.h \
$$PWD/searchinterface.h \
$$PWD/searchhandle.h \
$$PWD/projectpartutilities.h \
$$PWD/clangqueryprojectsfindfilter.h \
$$PWD/clangqueryexamplehighlightmarker.h \
$$PWD/clangqueryhighlightmarker.h \
$$PWD/clangqueryexamplehighlighter.h \
$$PWD/clangqueryhighlighter.h \
$$PWD/refactoringprojectupdater.h \
$$PWD/symbolsfindfilter.h \
$$PWD/symbolqueryinterface.h
SOURCES += \
$$PWD/refactoringengine.cpp \
$$PWD/refactoringconnectionclient.cpp \
$$PWD/refactoringclient.cpp \
$$PWD/searchinterface.cpp \
$$PWD/searchhandle.cpp \
$$PWD/projectpartutilities.cpp \
$$PWD/clangqueryprojectsfindfilter.cpp \
$$PWD/clangqueryexamplehighlighter.cpp \
$$PWD/clangqueryhighlighter.cpp \
$$PWD/refactoringprojectupdater.cpp
$$PWD/clangqueryprojectsfindfilter.cpp \
$$PWD/classesfilter.cpp \
$$PWD/functionsfilter.cpp \
$$PWD/includesfilter.cpp \
$$PWD/locatorfilter.cpp \
$$PWD/projectpartutilities.cpp \
$$PWD/refactoringclient.cpp \
$$PWD/refactoringconnectionclient.cpp \
$$PWD/refactoringengine.cpp \
$$PWD/refactoringprojectupdater.cpp \
$$PWD/searchinterface.cpp \
$$PWD/searchhandle.cpp \
$$PWD/symbolsfindfilter.cpp

View File

@@ -8,28 +8,32 @@ requires(!isEmpty(LIBTOOLING_LIBS))
HEADERS += \
clangrefactoringplugin.h \
baseclangquerytexteditorwidget.h \
clangqueryexampletexteditorwidget.h \
clangqueryhoverhandler.h \
clangqueryprojectsfindfilterwidget.h \
clangquerytexteditorwidget.h \
qtcreatorclangqueryfindfilter.h \
qtcreatorsearch.h \
qtcreatorsearchhandle.h \
qtcreatorclangqueryfindfilter.h \
clangqueryprojectsfindfilterwidget.h \
clangqueryexampletexteditorwidget.h \
clangquerytexteditorwidget.h \
baseclangquerytexteditorwidget.h \
clangqueryhoverhandler.h \
symbolquery.h \
qtcreatorsymbolsfindfilter.h \
querysqlitestatementfactory.h \
sourcelocations.h
sourcelocations.h \
symbolsfindfilterconfigwidget.h \
symbolquery.h
SOURCES += \
clangrefactoringplugin.cpp \
baseclangquerytexteditorwidget.cpp \
clangqueryexampletexteditorwidget.cpp \
clangqueryhoverhandler.cpp \
clangqueryprojectsfindfilterwidget.cpp \
clangquerytexteditorwidget.cpp \
qtcreatorclangqueryfindfilter.cpp \
qtcreatorsearch.cpp \
qtcreatorsearchhandle.cpp \
qtcreatorclangqueryfindfilter.cpp \
clangqueryprojectsfindfilterwidget.cpp \
clangqueryexampletexteditorwidget.cpp \
clangquerytexteditorwidget.cpp \
baseclangquerytexteditorwidget.cpp \
clangqueryhoverhandler.cpp \
qtcreatorsymbolsfindfilter.cpp \
symbolsfindfilterconfigwidget.cpp \
symbolquery.cpp
FORMS += \

View File

@@ -52,6 +52,14 @@ QtcPlugin {
"clangquerytexteditorwidget.h",
"clangrefactoringplugin.cpp",
"clangrefactoringplugin.h",
"classesfilter.cpp",
"classesfilter.h",
"functionsfilter.cpp",
"functionsfilter.h",
"includesfilter.cpp",
"includesfilter.h",
"locatorfilter.cpp",
"locatorfilter.h",
"projectpartutilities.cpp",
"projectpartutilities.h",
"qtcreatorclangqueryfindfilter.cpp",
@@ -60,6 +68,8 @@ QtcPlugin {
"qtcreatorsearch.h",
"qtcreatorsearchhandle.cpp",
"qtcreatorsearchhandle.h",
"qtcreatorsymbolsfindfilter.cpp",
"qtcreatorsymbolsfindfilter.h",
"querysqlitestatementfactory.h",
"refactoringclient.cpp",
"refactoringclient.h",
@@ -74,6 +84,10 @@ QtcPlugin {
"searchinterface.cpp",
"searchinterface.h",
"sourcelocations.h",
"symbolsfindfilter.cpp",
"symbolsfindfilter.h",
"symbolsfindfilterconfigwidget.cpp",
"symbolsfindfilterconfigwidget.h",
"symbolquery.cpp",
"symbolquery.h",
]

View File

@@ -24,6 +24,11 @@
****************************************************************************/
#include "clangrefactoringplugin.h"
#include "classesfilter.h"
#include "functionsfilter.h"
#include "includesfilter.h"
#include "locatorfilter.h"
#include "symbolsfindfilter.h"
#include "symbolquery.h"
#include "sqlitereadstatement.h"
#include "sqlitedatabase.h"
@@ -94,6 +99,12 @@ ClangRefactoringPlugin::~ClangRefactoringPlugin()
{
}
static bool useClangFilters()
{
static bool use = qEnvironmentVariableIntValue("QTC_CLANG_LOCATORS");
return use;
}
bool ClangRefactoringPlugin::initialize(const QStringList & /*arguments*/, QString * /*errorMessage*/)
{
d.reset(new ClangRefactoringPluginData);
@@ -105,13 +116,16 @@ bool ClangRefactoringPlugin::initialize(const QStringList & /*arguments*/, QStri
connectBackend();
startBackend();
CppTools::CppModelManager::addRefactoringEngine(
CppTools::RefactoringEngineType::ClangRefactoring, &refactoringEngine());
initializeFilters();
return true;
}
void ClangRefactoringPlugin::extensionsInitialized()
{
CppTools::CppModelManager::addRefactoringEngine(
CppTools::RefactoringEngineType::ClangRefactoring, &refactoringEngine());
}
ExtensionSystem::IPlugin::ShutdownFlag ClangRefactoringPlugin::aboutToShutdown()
@@ -152,4 +166,17 @@ void ClangRefactoringPlugin::backendIsConnected()
d->engine.setRefactoringEngineAvailable(true);
}
void ClangRefactoringPlugin::initializeFilters()
{
if (!useClangFilters())
return;
CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
modelManager->setLocatorFilter(std::make_unique<LocatorFilter>());
modelManager->setClassesFilter(std::make_unique<ClassesFilter>());
modelManager->setIncludesFilter(std::make_unique<IncludesFilter>());
modelManager->setFunctionsFilter(std::make_unique<FunctionsFilter>());
modelManager->setSymbolsFindFilter(std::make_unique<SymbolsFindFilter>());
}
} // namespace ClangRefactoring

View File

@@ -29,8 +29,8 @@
#include "refactoringclient.h"
#include "qtcreatorclangqueryfindfilter.h"
#include "qtcreatorsearch.h"
#include "refactoringconnectionclient.h"
#include <refactoringconnectionclient.h>
#include <refactoringserverproxy.h>
#include <extensionsystem/iplugin.h>
@@ -59,6 +59,7 @@ private:
void startBackend();
void connectBackend();
void backendIsConnected();
void initializeFilters();
private:
static std::unique_ptr<ClangRefactoringPluginData> d;

View File

@@ -0,0 +1,56 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "classesfilter.h"
#include <cpptools/cpptoolsconstants.h>
namespace ClangRefactoring {
ClassesFilter::ClassesFilter()
{
setId(CppTools::Constants::CLASSES_FILTER_ID);
setDisplayName(CppTools::Constants::CLASSES_FILTER_DISPLAY_NAME);
setShortcutString(QLatin1String("c"));
setIncludedByDefault(false);
}
QList<Core::LocatorFilterEntry> ClassesFilter::matchesFor(
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
{
return QList<Core::LocatorFilterEntry>();
}
void ClassesFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
{
}
void ClassesFilter::refresh(QFutureInterface<void> &)
{
}
} // namespace ClangRefactoring

View File

@@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2017 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 <coreplugin/locator/ilocatorfilter.h>
namespace ClangRefactoring {
class ClassesFilter : public Core::ILocatorFilter
{
Q_OBJECT
public:
ClassesFilter();
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
};
} // namespace ClangRefactoring

View File

@@ -0,0 +1,56 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "functionsfilter.h"
#include <cpptools/cpptoolsconstants.h>
namespace ClangRefactoring {
FunctionsFilter::FunctionsFilter()
{
setId(CppTools::Constants::FUNCTIONS_FILTER_ID);
setDisplayName(CppTools::Constants::FUNCTIONS_FILTER_DISPLAY_NAME);
setShortcutString(QString(QLatin1Char('m')));
setIncludedByDefault(false);
}
QList<Core::LocatorFilterEntry> FunctionsFilter::matchesFor(
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
{
return QList<Core::LocatorFilterEntry>();
}
void FunctionsFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
{
}
void FunctionsFilter::refresh(QFutureInterface<void> &)
{
}
} // namespace ClangRefactoring

View File

@@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2017 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 <coreplugin/locator/ilocatorfilter.h>
namespace ClangRefactoring {
class FunctionsFilter : public Core::ILocatorFilter
{
Q_OBJECT
public:
FunctionsFilter();
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
};
} // namespace ClangRefactoring

View File

@@ -0,0 +1,57 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "includesfilter.h"
#include <cpptools/cpptoolsconstants.h>
namespace ClangRefactoring {
IncludesFilter::IncludesFilter()
{
setId(CppTools::Constants::INCLUDES_FILTER_ID);
setDisplayName(CppTools::Constants::INCLUDES_FILTER_DISPLAY_NAME);
setShortcutString(QString(QLatin1Char('a')));
setIncludedByDefault(true);
setPriority(ILocatorFilter::Low);
}
QList<Core::LocatorFilterEntry> IncludesFilter::matchesFor(
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
{
return QList<Core::LocatorFilterEntry>();
}
void IncludesFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
{
}
void IncludesFilter::refresh(QFutureInterface<void> &)
{
}
} // namespace ClangRefactoring

View File

@@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2017 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 <coreplugin/locator/ilocatorfilter.h>
namespace ClangRefactoring {
class IncludesFilter : public Core::ILocatorFilter
{
Q_OBJECT
public:
IncludesFilter();
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
};
} // namespace ClangRefactoring

View File

@@ -0,0 +1,56 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "locatorfilter.h"
#include <cpptools/cpptoolsconstants.h>
namespace ClangRefactoring {
LocatorFilter::LocatorFilter()
{
setId(CppTools::Constants::LOCATOR_FILTER_ID);
setDisplayName(CppTools::Constants::LOCATOR_FILTER_DISPLAY_NAME);
setShortcutString(QString(QLatin1Char(':')));
setIncludedByDefault(false);
}
QList<Core::LocatorFilterEntry> LocatorFilter::matchesFor(
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
{
return QList<Core::LocatorFilterEntry>();
}
void LocatorFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
{
}
void LocatorFilter::refresh(QFutureInterface<void> &)
{
}
} // namespace ClangRefactoring

View File

@@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2017 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 <coreplugin/locator/ilocatorfilter.h>
namespace ClangRefactoring {
class LocatorFilter : public Core::ILocatorFilter
{
Q_OBJECT
public:
LocatorFilter();
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
};
} // namespace ClangRefactoring

View File

@@ -0,0 +1,41 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "qtcreatorsymbolsfindfilter.h"
#include "symbolsfindfilterconfigwidget.h"
namespace ClangRefactoring {
QtcreatorSymbolsFindFilter::QtcreatorSymbolsFindFilter()
{
}
QWidget *QtcreatorSymbolsFindFilter::createConfigWidget()
{
return new SymbolsFindFilterConfigWidget(this);
}
} // ClangRefactoring

View File

@@ -0,0 +1,41 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "symbolsfindfilter.h"
namespace ClangRefactoring {
class QtcreatorSymbolsFindFilter : public SymbolsFindFilter
{
Q_OBJECT
public:
QtcreatorSymbolsFindFilter();
QWidget *createConfigWidget() override;
};
} // ClangRefactoring

View File

@@ -27,7 +27,7 @@
#include "refactoringengine.h"
#include <searchhandle.h>
#include "searchhandle.h"
#include <refactoringclientinterface.h>

View File

@@ -27,8 +27,9 @@
#include "symbolqueryinterface.h"
#include "sourcelocations.h"
#include <filepathid.h>
#include <sourcelocations.h>
#include <cpptools/usages.h>

View File

@@ -0,0 +1,67 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "symbolsfindfilter.h"
#include <cpptools/cpptoolsconstants.h>
#include <QSettings>
using namespace Core;
namespace ClangRefactoring {
SymbolsFindFilter::SymbolsFindFilter()
{
}
QString SymbolsFindFilter::id() const
{
return QLatin1String(CppTools::Constants::SYMBOLS_FIND_FILTER_ID);
}
QString SymbolsFindFilter::displayName() const
{
return CppTools::Constants::SYMBOLS_FIND_FILTER_DISPLAY_NAME;
}
bool SymbolsFindFilter::isEnabled() const
{
return true;
}
void SymbolsFindFilter::findAll(const QString &, FindFlags)
{
}
void SymbolsFindFilter::writeSettings(QSettings *)
{
}
void SymbolsFindFilter::readSettings(QSettings *)
{
}
} // ClangRefactoring

View File

@@ -0,0 +1,59 @@
/****************************************************************************
**
** Copyright (C) 2017 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 <coreplugin/find/ifindfilter.h>
#include <QFutureWatcher>
#include <QPointer>
#include <QWidget>
#include <QCheckBox>
#include <QRadioButton>
namespace Core { class SearchResult; }
namespace ClangRefactoring {
class CppModelManager;
class SymbolsFindFilter : public Core::IFindFilter
{
Q_OBJECT
public:
explicit SymbolsFindFilter();
QString id() const;
QString displayName() const;
bool isEnabled() const;
void findAll(const QString &txt, Core::FindFlags findFlags);
void writeSettings(QSettings *settings);
void readSettings(QSettings *settings);
};
} // ClangRefactoring

View File

@@ -0,0 +1,39 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "symbolsfindfilterconfigwidget.h"
#include "symbolsfindfilter.h"
namespace ClangRefactoring {
SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *)
{
}
} // ClangRefactoring

View File

@@ -0,0 +1,41 @@
/****************************************************************************
**
** Copyright (C) 2017 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 <QWidget>
namespace ClangRefactoring {
class SymbolsFindFilter;
class SymbolsFindFilterConfigWidget : public QWidget
{
Q_OBJECT
public:
SymbolsFindFilterConfigWidget(SymbolsFindFilter *filter);
};
} // ClangRefactoring