forked from qt-creator/qt-creator
TextEditor: Move BookmarkFilter class definition to .cpp
Change-Id: I6da2710afde7af153353e184de72df2325dc4644 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
#include "bookmarkmanager.h"
|
#include "bookmarkmanager.h"
|
||||||
#include "texteditortr.h"
|
#include "texteditortr.h"
|
||||||
|
|
||||||
|
#include <coreplugin/locator/ilocatorfilter.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -14,15 +16,23 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace TextEditor::Internal {
|
namespace TextEditor::Internal {
|
||||||
|
|
||||||
BookmarkFilter::BookmarkFilter()
|
class BookmarkFilter final : public ILocatorFilter
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
BookmarkFilter()
|
||||||
|
{
|
||||||
setId("Bookmarks");
|
setId("Bookmarks");
|
||||||
setDisplayName(Tr::tr("Bookmarks"));
|
setDisplayName(Tr::tr("Bookmarks"));
|
||||||
setDescription(Tr::tr("Locates bookmarks. Filter by file name, by the text on the line of the "
|
setDescription(Tr::tr("Locates bookmarks. Filter by file name, by the text on the line of the "
|
||||||
"bookmark, or by the bookmark's note text."));
|
"bookmark, or by the bookmark's note text."));
|
||||||
setPriority(Medium);
|
setPriority(Medium);
|
||||||
setDefaultShortcutString("b");
|
setDefaultShortcutString("b");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
LocatorMatcherTasks matchers() final;
|
||||||
|
LocatorFilterEntries match(const QString &input) const;
|
||||||
|
};
|
||||||
|
|
||||||
LocatorMatcherTasks BookmarkFilter::matchers()
|
LocatorMatcherTasks BookmarkFilter::matchers()
|
||||||
{
|
{
|
||||||
@@ -114,4 +124,9 @@ LocatorFilterEntries BookmarkFilter::match(const QString &input) const
|
|||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setupBookmarkFilter()
|
||||||
|
{
|
||||||
|
static BookmarkFilter theBookmarkFilter;
|
||||||
|
}
|
||||||
|
|
||||||
} // TextEditor::Internal
|
} // TextEditor::Internal
|
||||||
|
|||||||
@@ -3,18 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/locator/ilocatorfilter.h>
|
|
||||||
|
|
||||||
namespace TextEditor::Internal {
|
namespace TextEditor::Internal {
|
||||||
|
|
||||||
class BookmarkFilter : public Core::ILocatorFilter
|
void setupBookmarkFilter();
|
||||||
{
|
|
||||||
public:
|
|
||||||
BookmarkFilter();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Core::LocatorMatcherTasks matchers() final;
|
|
||||||
Core::LocatorFilterEntries match(const QString &input) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // TextEditor::Internal
|
} // TextEditor::Internal
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ const char kCurrentDocumentWordUnderCursor[] = "CurrentDocument:WordUnderCursor"
|
|||||||
class TextEditorPluginPrivate : public QObject
|
class TextEditorPluginPrivate : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BookmarkFilter m_bookmarkFilter;
|
|
||||||
|
|
||||||
TextEditorSettings settings;
|
TextEditorSettings settings;
|
||||||
|
|
||||||
FindInFiles findInFilesFilter;
|
FindInFiles findInFilesFilter;
|
||||||
@@ -121,6 +119,7 @@ void TextEditorPlugin::initialize()
|
|||||||
|
|
||||||
setupBookmarkManager(this);
|
setupBookmarkManager(this);
|
||||||
setupBookmarkView();
|
setupBookmarkView();
|
||||||
|
setupBookmarkFilter();
|
||||||
|
|
||||||
d = new TextEditorPluginPrivate;
|
d = new TextEditorPluginPrivate;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user