summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2017-11-24 10:46:31 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-01-24 11:48:42 +0000
commit92cdfc0c2ae853dd4b8b2e31f777ff7f3be70908 (patch)
tree1f3bd119baa1f5ec843fa601b86f4c71540b2d5a
parentcf7f898db33ebd89386920dc59ac5cd665ab5474 (diff)
downloadqt-creator-92cdfc0c2ae853dd4b8b2e31f777ff7f3be70908.tar.gz
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>
-rw-r--r--src/plugins/clangcodemodel/clangcodemodel.pro6
-rw-r--r--src/plugins/clangcodemodel/clangcodemodel.qbs2
-rw-r--r--src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp57
-rw-r--r--src/plugins/clangcodemodel/clangcurrentdocumentfilter.h46
-rw-r--r--src/plugins/clangcodemodel/clangmodelmanagersupport.cpp1
-rw-r--r--src/plugins/clangrefactoring/clangrefactoring-source.pri42
-rw-r--r--src/plugins/clangrefactoring/clangrefactoring.pro32
-rw-r--r--src/plugins/clangrefactoring/clangrefactoring.qbs14
-rw-r--r--src/plugins/clangrefactoring/clangrefactoringplugin.cpp31
-rw-r--r--src/plugins/clangrefactoring/clangrefactoringplugin.h3
-rw-r--r--src/plugins/clangrefactoring/classesfilter.cpp56
-rw-r--r--src/plugins/clangrefactoring/classesfilter.h45
-rw-r--r--src/plugins/clangrefactoring/functionsfilter.cpp56
-rw-r--r--src/plugins/clangrefactoring/functionsfilter.h45
-rw-r--r--src/plugins/clangrefactoring/includesfilter.cpp57
-rw-r--r--src/plugins/clangrefactoring/includesfilter.h45
-rw-r--r--src/plugins/clangrefactoring/locatorfilter.cpp56
-rw-r--r--src/plugins/clangrefactoring/locatorfilter.h45
-rw-r--r--src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.cpp41
-rw-r--r--src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.h41
-rw-r--r--src/plugins/clangrefactoring/refactoringclient.h2
-rw-r--r--src/plugins/clangrefactoring/symbolquery.h3
-rw-r--r--src/plugins/clangrefactoring/symbolsfindfilter.cpp67
-rw-r--r--src/plugins/clangrefactoring/symbolsfindfilter.h59
-rw-r--r--src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.cpp39
-rw-r--r--src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.h41
-rw-r--r--src/plugins/coreplugin/corepluginunittestfiles.pri6
-rw-r--r--src/plugins/cpptools/cppclassesfilter.cpp6
-rw-r--r--src/plugins/cpptools/cppcurrentdocumentfilter.cpp5
-rw-r--r--src/plugins/cpptools/cppfunctionsfilter.cpp6
-rw-r--r--src/plugins/cpptools/cppincludesfilter.cpp5
-rw-r--r--src/plugins/cpptools/cpplocatorfilter.cpp5
-rw-r--r--src/plugins/cpptools/cpptoolsconstants.h19
-rw-r--r--src/plugins/cpptools/symbolsfindfilter.cpp4
-rw-r--r--tests/unit/unittest/classesfilter-test.cpp61
-rw-r--r--tests/unit/unittest/functionsfilter-test.cpp61
-rw-r--r--tests/unit/unittest/includesfilter-test.cpp61
-rw-r--r--tests/unit/unittest/locatorfilter-test.cpp61
-rw-r--r--tests/unit/unittest/symbolsfindfilter-test.cpp43
-rw-r--r--tests/unit/unittest/unittest.pro5
40 files changed, 1229 insertions, 51 deletions
diff --git a/src/plugins/clangcodemodel/clangcodemodel.pro b/src/plugins/clangcodemodel/clangcodemodel.pro
index 0e444a350e..ad0d93f2e1 100644
--- a/src/plugins/clangcodemodel/clangcodemodel.pro
+++ b/src/plugins/clangcodemodel/clangcodemodel.pro
@@ -21,6 +21,7 @@ SOURCES += \
clangcompletionassistprovider.cpp \
clangcompletionchunkstotextconverter.cpp \
clangcompletioncontextanalyzer.cpp \
+ clangcurrentdocumentfilter.cpp \
clangdiagnosticfilter.cpp \
clangdiagnosticmanager.cpp \
clangdiagnostictooltipwidget.cpp \
@@ -58,6 +59,7 @@ HEADERS += \
clangcompletionchunkstotextconverter.h \
clangcompletioncontextanalyzer.h \
clangconstants.h \
+ clangcurrentdocumentfilter.h \
clangdiagnosticfilter.h \
clangdiagnosticmanager.h \
clangdiagnostictooltipwidget.h \
@@ -75,9 +77,9 @@ HEADERS += \
clangprojectsettingswidget.h \
clangrefactoringengine.h \
clangtextmark.h \
+ clangtokeninfosreporter.h \
clanguiheaderondiskmanager.h \
- clangutils.h \
- clangtokeninfosreporter.h
+ clangutils.h
FORMS += clangprojectsettingswidget.ui
diff --git a/src/plugins/clangcodemodel/clangcodemodel.qbs b/src/plugins/clangcodemodel/clangcodemodel.qbs
index 90105b86d3..a1c3d4d6df 100644
--- a/src/plugins/clangcodemodel/clangcodemodel.qbs
+++ b/src/plugins/clangcodemodel/clangcodemodel.qbs
@@ -62,6 +62,8 @@ QtcPlugin {
"clangcompletioncontextanalyzer.cpp",
"clangcompletioncontextanalyzer.h",
"clangconstants.h",
+ "clangcurrentdocumentfilter.cpp",
+ "clangcurrentdocumentfilter.h",
"clangdiagnosticfilter.cpp",
"clangdiagnosticfilter.h",
"clangdiagnosticmanager.cpp",
diff --git a/src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp
new file mode 100644
index 0000000000..b28ac97291
--- /dev/null
+++ b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp
@@ -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 "clangcurrentdocumentfilter.h"
+
+#include <cpptools/cpptoolsconstants.h>
+
+namespace ClangCodeModel {
+
+ClangCurrentDocumentFilter::ClangCurrentDocumentFilter()
+{
+ setId(CppTools::Constants::CURRENT_DOCUMENT_FILTER_ID);
+ setDisplayName(CppTools::Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME);
+ setShortcutString(QString(QLatin1Char('.')));
+ setPriority(High);
+ setIncludedByDefault(false);
+}
+
+QList<Core::LocatorFilterEntry> ClangCurrentDocumentFilter::matchesFor(
+ QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
+{
+ return QList<Core::LocatorFilterEntry>();
+}
+
+void ClangCurrentDocumentFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
+{
+
+}
+
+void ClangCurrentDocumentFilter::refresh(QFutureInterface<void> &)
+{
+
+}
+
+} // namespace ClangCodeModel
diff --git a/src/plugins/clangcodemodel/clangcurrentdocumentfilter.h b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.h
new file mode 100644
index 0000000000..6adba5d775
--- /dev/null
+++ b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** 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 <coreplugin/locator/ilocatorfilter.h>
+
+namespace ClangCodeModel {
+
+class ClangCurrentDocumentFilter : public Core::ILocatorFilter
+{
+ Q_OBJECT
+
+public:
+ explicit ClangCurrentDocumentFilter();
+
+ 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 ClangCodeModel
diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
index 4de96c5a0e..f4813c6eb6 100644
--- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
+++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
@@ -31,6 +31,7 @@
#include "clangfollowsymbol.h"
#include "clanghoverhandler.h"
#include "clangrefactoringengine.h"
+#include "clangcurrentdocumentfilter.h"
#include <coreplugin/editormanager/editormanager.h>
#include <cpptools/cppfollowsymbolundercursor.h>
diff --git a/src/plugins/clangrefactoring/clangrefactoring-source.pri b/src/plugins/clangrefactoring/clangrefactoring-source.pri
index 027f81794d..a3ef41ef57 100644
--- a/src/plugins/clangrefactoring/clangrefactoring-source.pri
+++ b/src/plugins/clangrefactoring/clangrefactoring-source.pri
@@ -1,28 +1,38 @@
INCLUDEPATH += $$PWD
HEADERS += \
- $$PWD/refactoringengine.h \
- $$PWD/refactoringconnectionclient.h \
- $$PWD/refactoringclient.h \
- $$PWD/searchinterface.h \
- $$PWD/searchhandle.h \
- $$PWD/projectpartutilities.h \
- $$PWD/clangqueryprojectsfindfilter.h \
- $$PWD/clangqueryexamplehighlightmarker.h \
- $$PWD/clangqueryhighlightmarker.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/symbolsfindfilter.h \
$$PWD/symbolqueryinterface.h
SOURCES += \
- $$PWD/refactoringengine.cpp \
- $$PWD/refactoringconnectionclient.cpp \
+ $$PWD/clangqueryexamplehighlighter.cpp \
+ $$PWD/clangqueryhighlighter.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/projectpartutilities.cpp \
- $$PWD/clangqueryprojectsfindfilter.cpp \
- $$PWD/clangqueryexamplehighlighter.cpp \
- $$PWD/clangqueryhighlighter.cpp \
- $$PWD/refactoringprojectupdater.cpp
+ $$PWD/symbolsfindfilter.cpp
diff --git a/src/plugins/clangrefactoring/clangrefactoring.pro b/src/plugins/clangrefactoring/clangrefactoring.pro
index d60de99636..0326f612c1 100644
--- a/src/plugins/clangrefactoring/clangrefactoring.pro
+++ b/src/plugins/clangrefactoring/clangrefactoring.pro
@@ -8,28 +8,32 @@ requires(!isEmpty(LIBTOOLING_LIBS))
HEADERS += \
clangrefactoringplugin.h \
- qtcreatorsearch.h \
- qtcreatorsearchhandle.h \
- qtcreatorclangqueryfindfilter.h \
- clangqueryprojectsfindfilterwidget.h \
- clangqueryexampletexteditorwidget.h \
- clangquerytexteditorwidget.h \
baseclangquerytexteditorwidget.h \
+ clangqueryexampletexteditorwidget.h \
clangqueryhoverhandler.h \
- symbolquery.h \
+ clangqueryprojectsfindfilterwidget.h \
+ clangquerytexteditorwidget.h \
+ qtcreatorclangqueryfindfilter.h \
+ qtcreatorsearch.h \
+ qtcreatorsearchhandle.h \
+ qtcreatorsymbolsfindfilter.h \
querysqlitestatementfactory.h \
- sourcelocations.h
+ sourcelocations.h \
+ symbolsfindfilterconfigwidget.h \
+ symbolquery.h
SOURCES += \
clangrefactoringplugin.cpp \
- qtcreatorsearch.cpp \
- qtcreatorsearchhandle.cpp \
- qtcreatorclangqueryfindfilter.cpp \
- clangqueryprojectsfindfilterwidget.cpp \
- clangqueryexampletexteditorwidget.cpp \
- clangquerytexteditorwidget.cpp \
baseclangquerytexteditorwidget.cpp \
+ clangqueryexampletexteditorwidget.cpp \
clangqueryhoverhandler.cpp \
+ clangqueryprojectsfindfilterwidget.cpp \
+ clangquerytexteditorwidget.cpp \
+ qtcreatorclangqueryfindfilter.cpp \
+ qtcreatorsearch.cpp \
+ qtcreatorsearchhandle.cpp \
+ qtcreatorsymbolsfindfilter.cpp \
+ symbolsfindfilterconfigwidget.cpp \
symbolquery.cpp
FORMS += \
diff --git a/src/plugins/clangrefactoring/clangrefactoring.qbs b/src/plugins/clangrefactoring/clangrefactoring.qbs
index 15c2ada59e..bf0bfba5da 100644
--- a/src/plugins/clangrefactoring/clangrefactoring.qbs
+++ b/src/plugins/clangrefactoring/clangrefactoring.qbs
@@ -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",
]
diff --git a/src/plugins/clangrefactoring/clangrefactoringplugin.cpp b/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
index 17138f0cd9..8e471b3beb 100644
--- a/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
+++ b/src/plugins/clangrefactoring/clangrefactoringplugin.cpp
@@ -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
diff --git a/src/plugins/clangrefactoring/clangrefactoringplugin.h b/src/plugins/clangrefactoring/clangrefactoringplugin.h
index c0b90c7668..72a8d3efef 100644
--- a/src/plugins/clangrefactoring/clangrefactoringplugin.h
+++ b/src/plugins/clangrefactoring/clangrefactoringplugin.h
@@ -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;
diff --git a/src/plugins/clangrefactoring/classesfilter.cpp b/src/plugins/clangrefactoring/classesfilter.cpp
new file mode 100644
index 0000000000..11ea4fb6ab
--- /dev/null
+++ b/src/plugins/clangrefactoring/classesfilter.cpp
@@ -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
diff --git a/src/plugins/clangrefactoring/classesfilter.h b/src/plugins/clangrefactoring/classesfilter.h
new file mode 100644
index 0000000000..6d994286f8
--- /dev/null
+++ b/src/plugins/clangrefactoring/classesfilter.h
@@ -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
diff --git a/src/plugins/clangrefactoring/functionsfilter.cpp b/src/plugins/clangrefactoring/functionsfilter.cpp
new file mode 100644
index 0000000000..a4a8a6f7a6
--- /dev/null
+++ b/src/plugins/clangrefactoring/functionsfilter.cpp
@@ -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
diff --git a/src/plugins/clangrefactoring/functionsfilter.h b/src/plugins/clangrefactoring/functionsfilter.h
new file mode 100644
index 0000000000..95454915a9
--- /dev/null
+++ b/src/plugins/clangrefactoring/functionsfilter.h
@@ -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
diff --git a/src/plugins/clangrefactoring/includesfilter.cpp b/src/plugins/clangrefactoring/includesfilter.cpp
new file mode 100644
index 0000000000..50c8a3e957
--- /dev/null
+++ b/src/plugins/clangrefactoring/includesfilter.cpp
@@ -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
diff --git a/src/plugins/clangrefactoring/includesfilter.h b/src/plugins/clangrefactoring/includesfilter.h
new file mode 100644
index 0000000000..23185660c9
--- /dev/null
+++ b/src/plugins/clangrefactoring/includesfilter.h
@@ -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
diff --git a/src/plugins/clangrefactoring/locatorfilter.cpp b/src/plugins/clangrefactoring/locatorfilter.cpp
new file mode 100644
index 0000000000..79e52b3999
--- /dev/null
+++ b/src/plugins/clangrefactoring/locatorfilter.cpp
@@ -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
diff --git a/src/plugins/clangrefactoring/locatorfilter.h b/src/plugins/clangrefactoring/locatorfilter.h
new file mode 100644
index 0000000000..00cbccfced
--- /dev/null
+++ b/src/plugins/clangrefactoring/locatorfilter.h
@@ -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
diff --git a/src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.cpp b/src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.cpp
new file mode 100644
index 0000000000..9e5bd7a750
--- /dev/null
+++ b/src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.cpp
@@ -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
diff --git a/src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.h b/src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.h
new file mode 100644
index 0000000000..db9a856ffd
--- /dev/null
+++ b/src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.h
@@ -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
diff --git a/src/plugins/clangrefactoring/refactoringclient.h b/src/plugins/clangrefactoring/refactoringclient.h
index d504538b3e..fbf10d7294 100644
--- a/src/plugins/clangrefactoring/refactoringclient.h
+++ b/src/plugins/clangrefactoring/refactoringclient.h
@@ -27,7 +27,7 @@
#include "refactoringengine.h"
-#include <searchhandle.h>
+#include "searchhandle.h"
#include <refactoringclientinterface.h>
diff --git a/src/plugins/clangrefactoring/symbolquery.h b/src/plugins/clangrefactoring/symbolquery.h
index 7f0b9f33ac..a65ab4eba3 100644
--- a/src/plugins/clangrefactoring/symbolquery.h
+++ b/src/plugins/clangrefactoring/symbolquery.h
@@ -27,8 +27,9 @@
#include "symbolqueryinterface.h"
+#include "sourcelocations.h"
+
#include <filepathid.h>
-#include <sourcelocations.h>
#include <cpptools/usages.h>
diff --git a/src/plugins/clangrefactoring/symbolsfindfilter.cpp b/src/plugins/clangrefactoring/symbolsfindfilter.cpp
new file mode 100644
index 0000000000..d6126826cb
--- /dev/null
+++ b/src/plugins/clangrefactoring/symbolsfindfilter.cpp
@@ -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
diff --git a/src/plugins/clangrefactoring/symbolsfindfilter.h b/src/plugins/clangrefactoring/symbolsfindfilter.h
new file mode 100644
index 0000000000..1693a19602
--- /dev/null
+++ b/src/plugins/clangrefactoring/symbolsfindfilter.h
@@ -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
diff --git a/src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.cpp b/src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.cpp
new file mode 100644
index 0000000000..9c391676e1
--- /dev/null
+++ b/src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.cpp
@@ -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
+
diff --git a/src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.h b/src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.h
new file mode 100644
index 0000000000..b51ab4ed1d
--- /dev/null
+++ b/src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.h
@@ -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
diff --git a/src/plugins/coreplugin/corepluginunittestfiles.pri b/src/plugins/coreplugin/corepluginunittestfiles.pri
index 51e1e6b424..f2ec908f26 100644
--- a/src/plugins/coreplugin/corepluginunittestfiles.pri
+++ b/src/plugins/coreplugin/corepluginunittestfiles.pri
@@ -3,9 +3,11 @@ DEFINES += CORE_STATIC_LIBRARY
HEADERS += \
$$PWD/coreicons.h \
$$PWD/id.h \
- $$PWD/find/ifindfilter.h
+ $$PWD/find/ifindfilter.h \
+ $$PWD/locator/ilocatorfilter.h
SOURCES += \
$$PWD/coreicons.cpp \
$$PWD/id.cpp \
- $$PWD/find/ifindfilter.cpp
+ $$PWD/find/ifindfilter.cpp \
+ $$PWD/locator/ilocatorfilter.cpp
diff --git a/src/plugins/cpptools/cppclassesfilter.cpp b/src/plugins/cpptools/cppclassesfilter.cpp
index a589a2f610..f4f29a3522 100644
--- a/src/plugins/cpptools/cppclassesfilter.cpp
+++ b/src/plugins/cpptools/cppclassesfilter.cpp
@@ -25,16 +25,18 @@
#include "cppclassesfilter.h"
+#include "cpptoolsconstants.h"
+
using namespace CppTools;
using namespace CppTools::Internal;
CppClassesFilter::CppClassesFilter(CppLocatorData *locatorData)
: CppLocatorFilter(locatorData)
{
- setId("Classes");
+ setId(Constants::CLASSES_FILTER_ID);
+ setDisplayName(Constants::CLASSES_FILTER_DISPLAY_NAME);
setShortcutString(QLatin1String("c"));
setIncludedByDefault(false);
- setDisplayName(tr("C++ Classes"));
}
CppClassesFilter::~CppClassesFilter()
diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
index d0d76d9d19..baace1529f 100644
--- a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
+++ b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
@@ -26,6 +26,7 @@
#include "cppcurrentdocumentfilter.h"
#include "cppmodelmanager.h"
+#include "cpptoolsconstants.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
@@ -41,8 +42,8 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppTools::CppModelManager *ma
: m_modelManager(manager)
, search(stringTable)
{
- setId("Methods in current Document");
- setDisplayName(tr("C++ Symbols in Current Document"));
+ setId(Constants::CURRENT_DOCUMENT_FILTER_ID);
+ setDisplayName(Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME);
setShortcutString(".");
setPriority(High);
setIncludedByDefault(false);
diff --git a/src/plugins/cpptools/cppfunctionsfilter.cpp b/src/plugins/cpptools/cppfunctionsfilter.cpp
index b841cac6f6..c7c29fdca1 100644
--- a/src/plugins/cpptools/cppfunctionsfilter.cpp
+++ b/src/plugins/cpptools/cppfunctionsfilter.cpp
@@ -25,6 +25,8 @@
#include "cppfunctionsfilter.h"
+#include "cpptoolsconstants.h"
+
#include <utils/fileutils.h>
using namespace CppTools;
@@ -33,8 +35,8 @@ using namespace CppTools::Internal;
CppFunctionsFilter::CppFunctionsFilter(CppLocatorData *locatorData)
: CppLocatorFilter(locatorData)
{
- setId("Methods");
- setDisplayName(tr("C++ Functions"));
+ setId(Constants::FUNCTIONS_FILTER_ID);
+ setDisplayName(Constants::FUNCTIONS_FILTER_DISPLAY_NAME);
setShortcutString("m");
setIncludedByDefault(false);
}
diff --git a/src/plugins/cpptools/cppincludesfilter.cpp b/src/plugins/cpptools/cppincludesfilter.cpp
index 97fc66e641..679d37b72a 100644
--- a/src/plugins/cpptools/cppincludesfilter.cpp
+++ b/src/plugins/cpptools/cppincludesfilter.cpp
@@ -26,6 +26,7 @@
#include "cppincludesfilter.h"
#include "cppmodelmanager.h"
+#include "cpptoolsconstants.h"
#include <cplusplus/CppDocument.h>
#include <coreplugin/editormanager/documentmodel.h>
@@ -130,8 +131,8 @@ void CppIncludesIterator::fetchMore()
CppIncludesFilter::CppIncludesFilter()
{
- setId("All Included C/C++ Files");
- setDisplayName(tr("All Included C/C++ Files"));
+ setId(Constants::INCLUDES_FILTER_ID);
+ setDisplayName(Constants::INCLUDES_FILTER_DISPLAY_NAME);
setShortcutString("ai");
setIncludedByDefault(true);
setPriority(ILocatorFilter::Low);
diff --git a/src/plugins/cpptools/cpplocatorfilter.cpp b/src/plugins/cpptools/cpplocatorfilter.cpp
index ffe854831f..109e999b23 100644
--- a/src/plugins/cpptools/cpplocatorfilter.cpp
+++ b/src/plugins/cpptools/cpplocatorfilter.cpp
@@ -25,6 +25,7 @@
#include "cpplocatorfilter.h"
#include "cppmodelmanager.h"
+#include "cpptoolsconstants.h"
#include <coreplugin/editormanager/editormanager.h>
#include <utils/algorithm.h>
@@ -39,8 +40,8 @@ using namespace CppTools::Internal;
CppLocatorFilter::CppLocatorFilter(CppLocatorData *locatorData)
: m_data(locatorData)
{
- setId("Classes and Methods");
- setDisplayName(tr("C++ Classes, Enums and Functions"));
+ setId(Constants::LOCATOR_FILTER_ID);
+ setDisplayName(Constants::LOCATOR_FILTER_DISPLAY_NAME);
setShortcutString(":");
setIncludedByDefault(false);
}
diff --git a/src/plugins/cpptools/cpptoolsconstants.h b/src/plugins/cpptools/cpptoolsconstants.h
index b5e9d86bdb..c8dad1066b 100644
--- a/src/plugins/cpptools/cpptoolsconstants.h
+++ b/src/plugins/cpptools/cpptoolsconstants.h
@@ -77,5 +77,24 @@ const char CPP_CLANG_FIXIT_AVAILABLE_MARKER_ID[] = "ClangFixItAvailableMarker";
const char CPP_SETTINGS_ID[] = "Cpp";
const char CPP_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++");
+const char CURRENT_DOCUMENT_FILTER_ID[] = "Methods in current Document";
+const char CURRENT_DOCUMENT_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Symbols in Current Document");
+
+const char CLASSES_FILTER_ID[] = "Classes";
+const char CLASSES_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Classes");
+
+const char FUNCTIONS_FILTER_ID[] = "Methods";
+const char FUNCTIONS_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Functions");
+
+const char INCLUDES_FILTER_ID[] = "All Included C/C++ Files";
+const char INCLUDES_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "All Included C/C++ Files");
+
+const char LOCATOR_FILTER_ID[] = "Classes and Methods";
+const char LOCATOR_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Classes, Enums and Functions");
+
+const char SYMBOLS_FIND_FILTER_ID[] = "Symbols";
+const char SYMBOLS_FIND_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Symbols");
+
+
} // namespace Constants
} // namespace CppTools
diff --git a/src/plugins/cpptools/symbolsfindfilter.cpp b/src/plugins/cpptools/symbolsfindfilter.cpp
index a011fb3a75..265a20ac7d 100644
--- a/src/plugins/cpptools/symbolsfindfilter.cpp
+++ b/src/plugins/cpptools/symbolsfindfilter.cpp
@@ -69,12 +69,12 @@ SymbolsFindFilter::SymbolsFindFilter(CppModelManager *manager)
QString SymbolsFindFilter::id() const
{
- return QLatin1String("CppSymbols");
+ return QLatin1String(Constants::SYMBOLS_FIND_FILTER_ID);
}
QString SymbolsFindFilter::displayName() const
{
- return tr("C++ Symbols");
+ return Constants::SYMBOLS_FIND_FILTER_DISPLAY_NAME;
}
bool SymbolsFindFilter::isEnabled() const
diff --git a/tests/unit/unittest/classesfilter-test.cpp b/tests/unit/unittest/classesfilter-test.cpp
new file mode 100644
index 0000000000..f43ac7b3c1
--- /dev/null
+++ b/tests/unit/unittest/classesfilter-test.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** 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 "googletest.h"
+
+#include <clangrefactoring/classesfilter.h>
+
+namespace {
+
+class ClassesFilter : public ::testing::Test
+{
+protected:
+ ClangRefactoring::ClassesFilter classesFilter;
+};
+
+TEST_F(ClassesFilter, MatchesFor)
+{
+ QFutureInterface<Core::LocatorFilterEntry> dummy;
+
+ auto matches = classesFilter.matchesFor(dummy, QString());
+}
+
+TEST_F(ClassesFilter, Accept)
+{
+ int start = 0;
+ int length = 0;
+ QString newText;
+
+ classesFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
+}
+
+TEST_F(ClassesFilter, Refresh)
+{
+ QFutureInterface<void> dummy;
+
+ classesFilter.refresh(dummy);
+}
+
+}
diff --git a/tests/unit/unittest/functionsfilter-test.cpp b/tests/unit/unittest/functionsfilter-test.cpp
new file mode 100644
index 0000000000..77a6e4dbc4
--- /dev/null
+++ b/tests/unit/unittest/functionsfilter-test.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** 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 "googletest.h"
+
+#include <clangrefactoring/functionsfilter.h>
+
+namespace {
+
+class FunctionsFilter : public ::testing::Test
+{
+protected:
+ ClangRefactoring::FunctionsFilter functionsFilter;
+};
+
+TEST_F(FunctionsFilter, MatchesFor)
+{
+ QFutureInterface<Core::LocatorFilterEntry> dummy;
+
+ auto matches = functionsFilter.matchesFor(dummy, QString());
+}
+
+TEST_F(FunctionsFilter, Accept)
+{
+ int start = 0;
+ int length = 0;
+ QString newText;
+
+ functionsFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
+}
+
+TEST_F(FunctionsFilter, Refresh)
+{
+ QFutureInterface<void> dummy;
+
+ functionsFilter.refresh(dummy);
+}
+
+}
diff --git a/tests/unit/unittest/includesfilter-test.cpp b/tests/unit/unittest/includesfilter-test.cpp
new file mode 100644
index 0000000000..084d0fdd2e
--- /dev/null
+++ b/tests/unit/unittest/includesfilter-test.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** 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 "googletest.h"
+
+#include <clangrefactoring/includesfilter.h>
+
+namespace {
+
+class IncludesFilter : public ::testing::Test
+{
+protected:
+ ClangRefactoring::IncludesFilter includesFilter;
+};
+
+TEST_F(IncludesFilter, MatchesFor)
+{
+ QFutureInterface<Core::LocatorFilterEntry> dummy;
+
+ auto matches = includesFilter.matchesFor(dummy, QString());
+}
+
+TEST_F(IncludesFilter, Accept)
+{
+ int start = 0;
+ int length = 0;
+ QString newText;
+
+ includesFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
+}
+
+TEST_F(IncludesFilter, Refresh)
+{
+ QFutureInterface<void> dummy;
+
+ includesFilter.refresh(dummy);
+}
+
+}
diff --git a/tests/unit/unittest/locatorfilter-test.cpp b/tests/unit/unittest/locatorfilter-test.cpp
new file mode 100644
index 0000000000..2cc77cb5c7
--- /dev/null
+++ b/tests/unit/unittest/locatorfilter-test.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** 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 "googletest.h"
+
+#include <clangrefactoring/locatorfilter.h>
+
+namespace {
+
+class LocatorFilter : public ::testing::Test
+{
+protected:
+ ClangRefactoring::LocatorFilter locatorFilter;
+};
+
+TEST_F(LocatorFilter, MatchesFor)
+{
+ QFutureInterface<Core::LocatorFilterEntry> dummy;
+
+ auto matches = locatorFilter.matchesFor(dummy, QString());
+}
+
+TEST_F(LocatorFilter, Accept)
+{
+ int start = 0;
+ int length = 0;
+ QString newText;
+
+ locatorFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
+}
+
+TEST_F(LocatorFilter, Refresh)
+{
+ QFutureInterface<void> dummy;
+
+ locatorFilter.refresh(dummy);
+}
+
+}
diff --git a/tests/unit/unittest/symbolsfindfilter-test.cpp b/tests/unit/unittest/symbolsfindfilter-test.cpp
new file mode 100644
index 0000000000..fad174dfce
--- /dev/null
+++ b/tests/unit/unittest/symbolsfindfilter-test.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** 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 "googletest.h"
+
+#include <clangrefactoring/symbolsfindfilter.h>
+
+namespace {
+
+class SymbolsFindFilter : public ::testing::Test
+{
+protected:
+ ClangRefactoring::SymbolsFindFilter symbolsFindFilter;
+};
+
+TEST_F(SymbolsFindFilter, FindAll)
+{
+ symbolsFindFilter.findAll("*", Core::FindRegularExpression);
+}
+
+}
diff --git a/tests/unit/unittest/unittest.pro b/tests/unit/unittest/unittest.pro
index 257a83370c..c0fcdff3ba 100644
--- a/tests/unit/unittest/unittest.pro
+++ b/tests/unit/unittest/unittest.pro
@@ -42,6 +42,7 @@ SOURCES += \
clangpathwatcher-test.cpp \
clangqueryexamplehighlightmarker-test.cpp \
clangqueryhighlightmarker-test.cpp \
+ classesfilter-test.cpp \
clientserverinprocess-test.cpp \
clientserveroutsideprocess-test.cpp \
cppprojectfilecategorizer-test.cpp \
@@ -50,9 +51,12 @@ SOURCES += \
fakeprocess.cpp \
filepath-test.cpp \
filepathview-test.cpp \
+ functionsfilter-test.cpp \
gtest-creator-printing.cpp \
gtest-qt-printing.cpp \
+ includesfilter-test.cpp \
lineprefixer-test.cpp \
+ locatorfilter-test.cpp \
matchingtext-test.cpp \
mimedatabase-utilities.cpp \
pchgenerator-test.cpp \
@@ -68,6 +72,7 @@ SOURCES += \
sourcerangefilter-test.cpp \
spydummy.cpp \
symbolindexer-test.cpp \
+ symbolsfindfilter-test.cpp \
stringcache-test.cpp \
eventspy.cpp \
unittests-main.cpp \