forked from qt-creator/qt-creator
Rename QuickOpen namespace.
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
\o Support for searching text in arbitrary widgets, and arbitrary other things.
|
\o Support for searching text in arbitrary widgets, and arbitrary other things.
|
||||||
|
|
||||||
\row
|
\row
|
||||||
\o \l{QuickOpen}
|
\o \l{Locator}
|
||||||
\o Hooks for providing content for Locator.
|
\o Hooks for providing content for Locator.
|
||||||
|
|
||||||
\endtable
|
\endtable
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
\row
|
\row
|
||||||
\o Add a new filter to Locator.
|
\o Add a new filter to Locator.
|
||||||
\o For a text typed in by the user you provide a list of things to show in the popup. When the user selects an entry you are requested to do whatever you want.
|
\o For a text typed in by the user you provide a list of things to show in the popup. When the user selects an entry you are requested to do whatever you want.
|
||||||
\o \l{QuickOpen::ILocatorFilter}, \l{QuickOpen::FilterEntry}, \l{QuickOpen::BaseFileFilter}
|
\o \l{Locator::ILocatorFilter}, \l{Locator::FilterEntry}, \l{Locator::BaseFileFilter}
|
||||||
|
|
||||||
\row
|
\row
|
||||||
\o
|
\o
|
||||||
|
|||||||
@@ -58,11 +58,11 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Cor
|
|||||||
this, SLOT(onEditorAboutToClose(Core::IEditor*)));
|
this, SLOT(onEditorAboutToClose(Core::IEditor*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QuickOpen::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString & origEntry)
|
QList<Locator::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString & origEntry)
|
||||||
{
|
{
|
||||||
QString entry = trimWildcards(origEntry);
|
QString entry = trimWildcards(origEntry);
|
||||||
QList<QuickOpen::FilterEntry> goodEntries;
|
QList<Locator::FilterEntry> goodEntries;
|
||||||
QList<QuickOpen::FilterEntry> betterEntries;
|
QList<Locator::FilterEntry> betterEntries;
|
||||||
QStringMatcher matcher(entry, Qt::CaseInsensitive);
|
QStringMatcher matcher(entry, Qt::CaseInsensitive);
|
||||||
const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
|
const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
|
||||||
if (!regexp.isValid())
|
if (!regexp.isValid())
|
||||||
@@ -86,7 +86,7 @@ QList<QuickOpen::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString
|
|||||||
{
|
{
|
||||||
QString symbolName = info.symbolName;// + (info.type == ModelItemInfo::Declaration ? ";" : " {...}");
|
QString symbolName = info.symbolName;// + (info.type == ModelItemInfo::Declaration ? ";" : " {...}");
|
||||||
QVariant id = qVariantFromValue(info);
|
QVariant id = qVariantFromValue(info);
|
||||||
QuickOpen::FilterEntry filterEntry(this, symbolName, id, info.icon);
|
Locator::FilterEntry filterEntry(this, symbolName, id, info.icon);
|
||||||
filterEntry.extraInfo = info.symbolType;
|
filterEntry.extraInfo = info.symbolType;
|
||||||
|
|
||||||
if (info.symbolName.startsWith(entry))
|
if (info.symbolName.startsWith(entry))
|
||||||
@@ -102,7 +102,7 @@ QList<QuickOpen::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString
|
|||||||
return betterEntries;
|
return betterEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppCurrentDocumentFilter::accept(QuickOpen::FilterEntry selection) const
|
void CppCurrentDocumentFilter::accept(Locator::FilterEntry selection) const
|
||||||
{
|
{
|
||||||
ModelItemInfo info = qvariant_cast<CppTools::Internal::ModelItemInfo>(selection.internalData);
|
ModelItemInfo info = qvariant_cast<CppTools::Internal::ModelItemInfo>(selection.internalData);
|
||||||
TextEditor::BaseTextEditor::openEditorAt(info.fileName, info.line);
|
TextEditor::BaseTextEditor::openEditorAt(info.fileName, info.line);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class CppModelManager;
|
class CppModelManager;
|
||||||
|
|
||||||
class CppCurrentDocumentFilter : public QuickOpen::ILocatorFilter
|
class CppCurrentDocumentFilter : public Locator::ILocatorFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -53,8 +53,8 @@ public:
|
|||||||
QString trName() const { return tr("Methods in current Document"); }
|
QString trName() const { return tr("Methods in current Document"); }
|
||||||
QString name() const { return QLatin1String("Methods in current Document"); }
|
QString name() const { return QLatin1String("Methods in current Document"); }
|
||||||
Priority priority() const { return Medium; }
|
Priority priority() const { return Medium; }
|
||||||
QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
|
QList<Locator::FilterEntry> matchesFor(const QString &entry);
|
||||||
void accept(QuickOpen::FilterEntry selection) const;
|
void accept(Locator::FilterEntry selection) const;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
@@ -73,17 +73,17 @@ void CppLocatorFilter::refresh(QFutureInterface<void> &future)
|
|||||||
Q_UNUSED(future)
|
Q_UNUSED(future)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool compareLexigraphically(const QuickOpen::FilterEntry &a,
|
static bool compareLexigraphically(const Locator::FilterEntry &a,
|
||||||
const QuickOpen::FilterEntry &b)
|
const Locator::FilterEntry &b)
|
||||||
{
|
{
|
||||||
return a.displayName < b.displayName;
|
return a.displayName < b.displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QuickOpen::FilterEntry> CppLocatorFilter::matchesFor(const QString &origEntry)
|
QList<Locator::FilterEntry> CppLocatorFilter::matchesFor(const QString &origEntry)
|
||||||
{
|
{
|
||||||
QString entry = trimWildcards(origEntry);
|
QString entry = trimWildcards(origEntry);
|
||||||
QList<QuickOpen::FilterEntry> goodEntries;
|
QList<Locator::FilterEntry> goodEntries;
|
||||||
QList<QuickOpen::FilterEntry> betterEntries;
|
QList<Locator::FilterEntry> betterEntries;
|
||||||
QStringMatcher matcher(entry, Qt::CaseInsensitive);
|
QStringMatcher matcher(entry, Qt::CaseInsensitive);
|
||||||
const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
|
const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
|
||||||
if (!regexp.isValid())
|
if (!regexp.isValid())
|
||||||
@@ -108,7 +108,7 @@ QList<QuickOpen::FilterEntry> CppLocatorFilter::matchesFor(const QString &origEn
|
|||||||
|| (!hasWildcard && matcher.indexIn(info.symbolName) != -1)) {
|
|| (!hasWildcard && matcher.indexIn(info.symbolName) != -1)) {
|
||||||
|
|
||||||
QVariant id = qVariantFromValue(info);
|
QVariant id = qVariantFromValue(info);
|
||||||
QuickOpen::FilterEntry filterEntry(this, info.symbolName, id, info.icon);
|
Locator::FilterEntry filterEntry(this, info.symbolName, id, info.icon);
|
||||||
if (! info.symbolType.isEmpty())
|
if (! info.symbolType.isEmpty())
|
||||||
filterEntry.extraInfo = info.symbolType;
|
filterEntry.extraInfo = info.symbolType;
|
||||||
else
|
else
|
||||||
@@ -131,7 +131,7 @@ QList<QuickOpen::FilterEntry> CppLocatorFilter::matchesFor(const QString &origEn
|
|||||||
return betterEntries;
|
return betterEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppLocatorFilter::accept(QuickOpen::FilterEntry selection) const
|
void CppLocatorFilter::accept(Locator::FilterEntry selection) const
|
||||||
{
|
{
|
||||||
ModelItemInfo info = qvariant_cast<CppTools::Internal::ModelItemInfo>(selection.internalData);
|
ModelItemInfo info = qvariant_cast<CppTools::Internal::ModelItemInfo>(selection.internalData);
|
||||||
TextEditor::BaseTextEditor::openEditorAt(info.fileName, info.line);
|
TextEditor::BaseTextEditor::openEditorAt(info.fileName, info.line);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class CppModelManager;
|
class CppModelManager;
|
||||||
|
|
||||||
class CppLocatorFilter : public QuickOpen::ILocatorFilter
|
class CppLocatorFilter : public Locator::ILocatorFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@@ -53,8 +53,8 @@ public:
|
|||||||
QString trName() const { return tr("Classes and Methods"); }
|
QString trName() const { return tr("Classes and Methods"); }
|
||||||
QString name() const { return QLatin1String("Classes and Methods"); }
|
QString name() const { return QLatin1String("Classes and Methods"); }
|
||||||
Priority priority() const { return Medium; }
|
Priority priority() const { return Medium; }
|
||||||
QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
|
QList<Locator::FilterEntry> matchesFor(const QString &entry);
|
||||||
void accept(QuickOpen::FilterEntry selection) const;
|
void accept(Locator::FilterEntry selection) const;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -104,9 +104,9 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
|
|
||||||
addAutoReleasedObject(new CppQuickFixCollector(m_modelManager));
|
addAutoReleasedObject(new CppQuickFixCollector(m_modelManager));
|
||||||
|
|
||||||
CppLocatorFilter *quickOpenFilter = new CppLocatorFilter(m_modelManager,
|
CppLocatorFilter *locatorFilter = new CppLocatorFilter(m_modelManager,
|
||||||
core->editorManager());
|
core->editorManager());
|
||||||
addAutoReleasedObject(quickOpenFilter);
|
addAutoReleasedObject(locatorFilter);
|
||||||
addAutoReleasedObject(new CppClassesFilter(m_modelManager, core->editorManager()));
|
addAutoReleasedObject(new CppClassesFilter(m_modelManager, core->editorManager()));
|
||||||
addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, core->editorManager()));
|
addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, core->editorManager()));
|
||||||
addAutoReleasedObject(new CppCurrentDocumentFilter(m_modelManager, core->editorManager()));
|
addAutoReleasedObject(new CppCurrentDocumentFilter(m_modelManager, core->editorManager()));
|
||||||
|
|||||||
@@ -63,6 +63,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Designer
|
||||||
|
|
||||||
#endif // DESIGNER_SETTINGSPAGE_H
|
#endif // DESIGNER_SETTINGSPAGE_H
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
// There is always a "current" cursor (m_tc). A current "region of interest"
|
// There is always a "current" cursor (m_tc). A current "region of interest"
|
||||||
// spans between m_anchor (== anchor()) and m_tc.position() (== position())
|
// spans between m_anchor (== anchor()) and m_tc.position() (== position())
|
||||||
// The value of m_tc.anchor() is not used.
|
// The value of m_tc.anchor() is not used.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ struct Range
|
|||||||
|
|
||||||
Range(int b, int e, RangeMode m = RangeCharMode)
|
Range(int b, int e, RangeMode m = RangeCharMode)
|
||||||
: beginPos(qMin(b, e)), endPos(qMax(b, e)), rangemode(m)
|
: beginPos(qMin(b, e)), endPos(qMax(b, e)), rangemode(m)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
int beginPos;
|
int beginPos;
|
||||||
int endPos;
|
int endPos;
|
||||||
@@ -518,7 +518,7 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
|
|||||||
|
|
||||||
// We are interested in overriding most Ctrl key combinations
|
// We are interested in overriding most Ctrl key combinations
|
||||||
if (mods == Qt::ControlModifier && key >= Key_A && key <= Key_Z && key != Key_K) {
|
if (mods == Qt::ControlModifier && key >= Key_A && key <= Key_Z && key != Key_K) {
|
||||||
// Ctrl-K is special as it is the Core's default notion of QuickOpen
|
// Ctrl-K is special as it is the Core's default notion of Locator
|
||||||
if (m_passing) {
|
if (m_passing) {
|
||||||
KEY_DEBUG(" PASSING CTRL KEY");
|
KEY_DEBUG(" PASSING CTRL KEY");
|
||||||
// We get called twice on the same key
|
// We get called twice on the same key
|
||||||
@@ -566,7 +566,7 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
|
|||||||
setTargetColumn();
|
setTargetColumn();
|
||||||
|
|
||||||
m_tc.setVisualNavigation(true);
|
m_tc.setVisualNavigation(true);
|
||||||
|
|
||||||
if (m_fakeEnd)
|
if (m_fakeEnd)
|
||||||
moveRight();
|
moveRight();
|
||||||
|
|
||||||
@@ -913,9 +913,9 @@ void FakeVimHandler::Private::updateMiniBuffer()
|
|||||||
const QString pos = QString::fromLatin1("%1,%2").arg(l + 1).arg(cursorColumnInDocument() + 1);
|
const QString pos = QString::fromLatin1("%1,%2").arg(l + 1).arg(cursorColumnInDocument() + 1);
|
||||||
// FIXME: physical "-" logical
|
// FIXME: physical "-" logical
|
||||||
if (linesInDoc != 0) {
|
if (linesInDoc != 0) {
|
||||||
status = FakeVimHandler::tr("%1%2%").arg(pos, -10).arg(l * 100 / linesInDoc, 4);
|
status = FakeVimHandler::tr("%1%2%").arg(pos, -10).arg(l * 100 / linesInDoc, 4);
|
||||||
} else {
|
} else {
|
||||||
status = FakeVimHandler::tr("%1All").arg(pos, -10);
|
status = FakeVimHandler::tr("%1All").arg(pos, -10);
|
||||||
}
|
}
|
||||||
emit q->statusDataChanged(status);
|
emit q->statusDataChanged(status);
|
||||||
}
|
}
|
||||||
@@ -974,7 +974,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
setDotCommand("%1dd", count());
|
setDotCommand("%1dd", count());
|
||||||
m_submode = NoSubMode;
|
m_submode = NoSubMode;
|
||||||
moveToFirstNonBlankOnLine();
|
moveToFirstNonBlankOnLine();
|
||||||
setTargetColumn();
|
setTargetColumn();
|
||||||
finishMovement();
|
finishMovement();
|
||||||
} else if (m_submode == ShiftLeftSubMode && key == '<') {
|
} else if (m_submode == ShiftLeftSubMode && key == '<') {
|
||||||
setAnchor();
|
setAnchor();
|
||||||
@@ -1529,7 +1529,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
m_savedYankPosition = position();
|
m_savedYankPosition = position();
|
||||||
setAnchor(firstPositionInLine(line));
|
setAnchor(firstPositionInLine(line));
|
||||||
setPosition(lastPositionInLine(line+count() - 1));
|
setPosition(lastPositionInLine(line+count() - 1));
|
||||||
if (count() > 1)
|
if (count() > 1)
|
||||||
showBlackMessage(QString("%1 lines yanked").arg(count()));
|
showBlackMessage(QString("%1 lines yanked").arg(count()));
|
||||||
m_rangemode = RangeLineMode;
|
m_rangemode = RangeLineMode;
|
||||||
m_movetype = MoveLineWise;
|
m_movetype = MoveLineWise;
|
||||||
@@ -1666,7 +1666,7 @@ EventResult FakeVimHandler::Private::handleInsertMode(int key, int,
|
|||||||
insertAutomaticIndentation(true);
|
insertAutomaticIndentation(true);
|
||||||
setTargetColumn();
|
setTargetColumn();
|
||||||
} else if (key == Key_Backspace || key == control('h')) {
|
} else if (key == Key_Backspace || key == control('h')) {
|
||||||
if (!removeAutomaticIndentation())
|
if (!removeAutomaticIndentation())
|
||||||
if (!m_lastInsertion.isEmpty() || hasConfig(ConfigBackspace, "start")) {
|
if (!m_lastInsertion.isEmpty() || hasConfig(ConfigBackspace, "start")) {
|
||||||
m_tc.deletePreviousChar();
|
m_tc.deletePreviousChar();
|
||||||
m_lastInsertion.chop(1);
|
m_lastInsertion.chop(1);
|
||||||
@@ -1899,7 +1899,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
|
|||||||
static QRegExp reSet("^set?( (.*))?$");
|
static QRegExp reSet("^set?( (.*))?$");
|
||||||
static QRegExp reWrite("^[wx]q?a?!?( (.*))?$");
|
static QRegExp reWrite("^[wx]q?a?!?( (.*))?$");
|
||||||
static QRegExp reSubstitute("^s(.)(.*)\\1(.*)\\1([gi]*)");
|
static QRegExp reSubstitute("^s(.)(.*)\\1(.*)\\1([gi]*)");
|
||||||
|
|
||||||
enterCommandMode();
|
enterCommandMode();
|
||||||
showBlackMessage(QString());
|
showBlackMessage(QString());
|
||||||
|
|
||||||
@@ -2509,12 +2509,12 @@ QString FakeVimHandler::Private::text(const Range &range) const
|
|||||||
int beginColumn = 0;
|
int beginColumn = 0;
|
||||||
int endColumn = INT_MAX;
|
int endColumn = INT_MAX;
|
||||||
if (range.rangemode == RangeBlockMode) {
|
if (range.rangemode == RangeBlockMode) {
|
||||||
int column1 = range.beginPos - firstPositionInLine(beginLine);
|
int column1 = range.beginPos - firstPositionInLine(beginLine);
|
||||||
int column2 = range.endPos - firstPositionInLine(endLine);
|
int column2 = range.endPos - firstPositionInLine(endLine);
|
||||||
beginColumn = qMin(column1, column2);
|
beginColumn = qMin(column1, column2);
|
||||||
endColumn = qMax(column1, column2);
|
endColumn = qMax(column1, column2);
|
||||||
qDebug() << "COLS: " << beginColumn << endColumn;
|
qDebug() << "COLS: " << beginColumn << endColumn;
|
||||||
}
|
}
|
||||||
int len = endColumn - beginColumn + 1;
|
int len = endColumn - beginColumn + 1;
|
||||||
QString contents;
|
QString contents;
|
||||||
QTextBlock block = m_tc.document()->findBlockByNumber(beginLine - 1);
|
QTextBlock block = m_tc.document()->findBlockByNumber(beginLine - 1);
|
||||||
@@ -2580,8 +2580,8 @@ void FakeVimHandler::Private::removeText(const Range &range)
|
|||||||
case RangeBlockMode: {
|
case RangeBlockMode: {
|
||||||
int beginLine = lineForPosition(range.beginPos);
|
int beginLine = lineForPosition(range.beginPos);
|
||||||
int endLine = lineForPosition(range.endPos);
|
int endLine = lineForPosition(range.endPos);
|
||||||
int column1 = range.beginPos - firstPositionInLine(beginLine);
|
int column1 = range.beginPos - firstPositionInLine(beginLine);
|
||||||
int column2 = range.endPos - firstPositionInLine(endLine);
|
int column2 = range.endPos - firstPositionInLine(endLine);
|
||||||
int beginColumn = qMin(column1, column2);
|
int beginColumn = qMin(column1, column2);
|
||||||
int endColumn = qMax(column1, column2);
|
int endColumn = qMax(column1, column2);
|
||||||
qDebug() << "COLS: " << beginColumn << endColumn;
|
qDebug() << "COLS: " << beginColumn << endColumn;
|
||||||
@@ -2645,7 +2645,7 @@ void FakeVimHandler::Private::pasteText(bool afterCursor)
|
|||||||
tc.movePosition(EndOfLine, MoveAnchor);
|
tc.movePosition(EndOfLine, MoveAnchor);
|
||||||
fixMarks(position(), QString(col - line.size() + 1, QChar(' ')).length());
|
fixMarks(position(), QString(col - line.size() + 1, QChar(' ')).length());
|
||||||
tc.insertText(QString(col - line.size() + 1, QChar(' ')));
|
tc.insertText(QString(col - line.size() + 1, QChar(' ')));
|
||||||
} else {
|
} else {
|
||||||
tc.movePosition(Right, MoveAnchor, col);
|
tc.movePosition(Right, MoveAnchor, col);
|
||||||
}
|
}
|
||||||
qDebug() << "INSERT " << line << " AT " << tc.position()
|
qDebug() << "INSERT " << line << " AT " << tc.position()
|
||||||
@@ -2673,8 +2673,8 @@ void FakeVimHandler::Private::fixMarks(int positionAction, int positionChange)
|
|||||||
QHashIterator<int, int> i(m_marks);
|
QHashIterator<int, int> i(m_marks);
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
i.next();
|
i.next();
|
||||||
if (i.value() >= positionAction) {
|
if (i.value() >= positionAction) {
|
||||||
if (i.value() + positionChange > 0)
|
if (i.value() + positionChange > 0)
|
||||||
m_marks[i.key()] = i.value() + positionChange;
|
m_marks[i.key()] = i.value() + positionChange;
|
||||||
else
|
else
|
||||||
m_marks.remove(i.key());
|
m_marks.remove(i.key());
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <QtHelp/QHelpEngine>
|
#include <QtHelp/QHelpEngine>
|
||||||
#include <QtHelp/QHelpIndexModel>
|
#include <QtHelp/QHelpIndexModel>
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace Help;
|
using namespace Help;
|
||||||
using namespace Help::Internal;
|
using namespace Help::Internal;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class HelpPlugin;
|
class HelpPlugin;
|
||||||
|
|
||||||
class HelpIndexFilter : public QuickOpen::ILocatorFilter
|
class HelpIndexFilter : public Locator::ILocatorFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -55,8 +55,8 @@ public:
|
|||||||
QString trName() const;
|
QString trName() const;
|
||||||
QString name() const;
|
QString name() const;
|
||||||
Priority priority() const;
|
Priority priority() const;
|
||||||
QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
|
QList<Locator::FilterEntry> matchesFor(const QString &entry);
|
||||||
void accept(QuickOpen::FilterEntry selection) const;
|
void accept(Locator::FilterEntry selection) const;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class ProjectExplorerPlugin;
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class AllProjectsFilter : public QuickOpen::BaseFileFilter
|
class AllProjectsFilter : public Locator::BaseFileFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
explicit AllProjectsFilter(ProjectExplorerPlugin *pe);
|
explicit AllProjectsFilter(ProjectExplorerPlugin *pe);
|
||||||
QString trName() const { return tr("Files in any project"); }
|
QString trName() const { return tr("Files in any project"); }
|
||||||
QString name() const { return "Files in any project"; }
|
QString name() const { return "Files in any project"; }
|
||||||
QuickOpen::ILocatorFilter::Priority priority() const { return QuickOpen::ILocatorFilter::Low; }
|
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Low; }
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class Project;
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CurrentProjectFilter : public QuickOpen::BaseFileFilter
|
class CurrentProjectFilter : public Locator::BaseFileFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
CurrentProjectFilter(ProjectExplorerPlugin *pe);
|
CurrentProjectFilter(ProjectExplorerPlugin *pe);
|
||||||
QString trName() const { return tr("Files in current project"); }
|
QString trName() const { return tr("Files in current project"); }
|
||||||
QString name() const { return "Files in current project"; }
|
QString name() const { return "Files in current project"; }
|
||||||
QuickOpen::ILocatorFilter::Priority priority() const { return QuickOpen::ILocatorFilter::Low; }
|
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Low; }
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include <QtCore/QStringMatcher>
|
#include <QtCore/QStringMatcher>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
|
|
||||||
BaseFileFilter::BaseFileFilter()
|
BaseFileFilter::BaseFileFilter()
|
||||||
: m_forceNewSearchList(false)
|
: m_forceNewSearchList(false)
|
||||||
@@ -85,12 +85,12 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry)
|
|||||||
m_previousResultNames.append(name);
|
m_previousResultNames.append(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
matches.append(badMatches);
|
matches.append(badMatches);
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseFileFilter::accept(QuickOpen::FilterEntry selection) const
|
void BaseFileFilter::accept(Locator::FilterEntry selection) const
|
||||||
{
|
{
|
||||||
Core::EditorManager *em = Core::EditorManager::instance();
|
Core::EditorManager *em = Core::EditorManager::instance();
|
||||||
em->openEditor(selection.internalData.toString());
|
em->openEditor(selection.internalData.toString());
|
||||||
|
|||||||
@@ -36,16 +36,16 @@
|
|||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
|
|
||||||
class LOCATOR_EXPORT BaseFileFilter : public QuickOpen::ILocatorFilter
|
class LOCATOR_EXPORT BaseFileFilter : public Locator::ILocatorFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BaseFileFilter();
|
BaseFileFilter();
|
||||||
QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
|
QList<Locator::FilterEntry> matchesFor(const QString &entry);
|
||||||
void accept(QuickOpen::FilterEntry selection) const;
|
void accept(Locator::FilterEntry selection) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void updateFiles();
|
virtual void updateFiles();
|
||||||
@@ -59,6 +59,6 @@ protected:
|
|||||||
QString m_previousEntry;
|
QString m_previousEntry;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // BASEFILEFILTER_H
|
#endif // BASEFILEFILTER_H
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
|
|
||||||
#include <qtconcurrent/QtConcurrentTools>
|
#include <qtconcurrent/QtConcurrentTools>
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
DirectoryFilter::DirectoryFilter()
|
DirectoryFilter::DirectoryFilter()
|
||||||
: m_name(tr("Generic Directory Filter")),
|
: m_name(tr("Generic Directory Filter")),
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
#include <QtGui/QDialog>
|
#include <QtGui/QDialog>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class DirectoryFilter : public BaseFileFilter
|
class DirectoryFilter : public BaseFileFilter
|
||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
DirectoryFilter();
|
DirectoryFilter();
|
||||||
QString trName() const { return m_name; }
|
QString trName() const { return m_name; }
|
||||||
QString name() const { return m_name; }
|
QString name() const { return m_name; }
|
||||||
QuickOpen::ILocatorFilter::Priority priority() const { return QuickOpen::ILocatorFilter::Medium; }
|
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Medium; }
|
||||||
QByteArray saveState() const;
|
QByteArray saveState() const;
|
||||||
bool restoreState(const QByteArray &state);
|
bool restoreState(const QByteArray &state);
|
||||||
bool openConfigDialog(QWidget *parent, bool &needsRefresh);
|
bool openConfigDialog(QWidget *parent, bool &needsRefresh);
|
||||||
@@ -76,6 +76,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // DIRECTORYFILTER_H
|
#endif // DIRECTORYFILTER_H
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>QuickOpen::Internal::DirectoryFilterOptions</class>
|
<class>Locator::Internal::DirectoryFilterOptions</class>
|
||||||
<widget class="QDialog" name="QuickOpen::Internal::DirectoryFilterOptions">
|
<widget class="QDialog" name="Locator::Internal::DirectoryFilterOptions">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>393</width>
|
<width>393</width>
|
||||||
<height>271</height>
|
<height>275</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
@@ -72,12 +72,12 @@ To do this, you type this shortcut and a space in the Locator entry field, and t
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Limit to prefix</string>
|
<string>Limit to prefix</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
<item row="1" column="3">
|
||||||
@@ -161,7 +161,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>QuickOpen::Internal::DirectoryFilterOptions</receiver>
|
<receiver>Locator::Internal::DirectoryFilterOptions</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
@@ -177,7 +177,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>QuickOpen::Internal::DirectoryFilterOptions</receiver>
|
<receiver>Locator::Internal::DirectoryFilterOptions</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
FileSystemFilter::FileSystemFilter(EditorManager *editorManager, LocatorWidget *locatorWidget)
|
FileSystemFilter::FileSystemFilter(EditorManager *editorManager, LocatorWidget *locatorWidget)
|
||||||
: m_editorManager(editorManager), m_locatorWidget(locatorWidget), m_includeHidden(true)
|
: m_editorManager(editorManager), m_locatorWidget(locatorWidget), m_includeHidden(true)
|
||||||
|
|||||||
@@ -40,12 +40,12 @@
|
|||||||
#include <QtCore/QByteArray>
|
#include <QtCore/QByteArray>
|
||||||
#include <QtCore/QFutureInterface>
|
#include <QtCore/QFutureInterface>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class LocatorWidget;
|
class LocatorWidget;
|
||||||
|
|
||||||
class FileSystemFilter : public QuickOpen::ILocatorFilter
|
class FileSystemFilter : public Locator::ILocatorFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -53,9 +53,9 @@ public:
|
|||||||
FileSystemFilter(Core::EditorManager *editorManager, LocatorWidget *locatorWidget);
|
FileSystemFilter(Core::EditorManager *editorManager, LocatorWidget *locatorWidget);
|
||||||
QString trName() const { return tr("Files in file system"); }
|
QString trName() const { return tr("Files in file system"); }
|
||||||
QString name() const { return "Files in file system"; }
|
QString name() const { return "Files in file system"; }
|
||||||
QuickOpen::ILocatorFilter::Priority priority() const { return QuickOpen::ILocatorFilter::Medium; }
|
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Medium; }
|
||||||
QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
|
QList<Locator::FilterEntry> matchesFor(const QString &entry);
|
||||||
void accept(QuickOpen::FilterEntry selection) const;
|
void accept(Locator::FilterEntry selection) const;
|
||||||
QByteArray saveState() const;
|
QByteArray saveState() const;
|
||||||
bool restoreState(const QByteArray &state);
|
bool restoreState(const QByteArray &state);
|
||||||
bool openConfigDialog(QWidget *parent, bool &needsRefresh);
|
bool openConfigDialog(QWidget *parent, bool &needsRefresh);
|
||||||
@@ -68,6 +68,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // FILESYSTEMFILTER_H
|
#endif // FILESYSTEMFILTER_H
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>QuickOpen::Internal::FileSystemFilterOptions</class>
|
<class>Locator::Internal::FileSystemFilterOptions</class>
|
||||||
<widget class="QDialog" name="QuickOpen::Internal::FileSystemFilterOptions">
|
<widget class="QDialog" name="Locator::Internal::FileSystemFilterOptions">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>327</width>
|
<width>335</width>
|
||||||
<height>131</height>
|
<height>131</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>QuickOpen::Internal::FileSystemFilterOptions</receiver>
|
<receiver>Locator::Internal::FileSystemFilterOptions</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>QuickOpen::Internal::FileSystemFilterOptions</receiver>
|
<receiver>Locator::Internal::FileSystemFilterOptions</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include <QtGui/QLabel>
|
#include <QtGui/QLabel>
|
||||||
#include <QtGui/QLineEdit>
|
#include <QtGui/QLineEdit>
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
|
|
||||||
ILocatorFilter::ILocatorFilter(QObject *parent):
|
ILocatorFilter::ILocatorFilter(QObject *parent):
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <QtCore/QFutureInterface>
|
#include <QtCore/QFutureInterface>
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
|
|
||||||
class ILocatorFilter;
|
class ILocatorFilter;
|
||||||
|
|
||||||
@@ -151,6 +151,6 @@ private:
|
|||||||
bool m_hidden;
|
bool m_hidden;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // ILOCATORFILTER_H
|
#endif // ILOCATORFILTER_H
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(ILocatorFilter*);
|
Q_DECLARE_METATYPE(ILocatorFilter*);
|
||||||
|
|
||||||
|
|||||||
@@ -34,14 +34,14 @@
|
|||||||
|
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class LocatorPlugin;
|
class LocatorPlugin;
|
||||||
class LocatorWidget;
|
class LocatorWidget;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
This filter provides the user with the list of available QuickOpen filters.
|
This filter provides the user with the list of available Locator filters.
|
||||||
The list is only shown when nothing has been typed yet.
|
The list is only shown when nothing has been typed yet.
|
||||||
*/
|
*/
|
||||||
class LocatorFiltersFilter : public ILocatorFilter
|
class LocatorFiltersFilter : public ILocatorFilter
|
||||||
@@ -68,6 +68,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // LOCATORFILTERSFILTER_H
|
#endif // LOCATORFILTERSFILTER_H
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
LocatorManager *LocatorManager::m_instance = 0;
|
LocatorManager *LocatorManager::m_instance = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class LocatorWidget;
|
class LocatorWidget;
|
||||||
@@ -57,6 +57,6 @@ private:
|
|||||||
static LocatorManager *m_instance;
|
static LocatorManager *m_instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // LOCATORMANAGER_H
|
#endif // LOCATORMANAGER_H
|
||||||
|
|||||||
@@ -52,16 +52,16 @@
|
|||||||
#include <qtconcurrent/QtConcurrentTools>
|
#include <qtconcurrent/QtConcurrentTools>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\namespace QuickOpen
|
\namespace Locator
|
||||||
The QuickOpen namespace provides the hooks for Locator content.
|
The Locator namespace provides the hooks for Locator content.
|
||||||
*/
|
*/
|
||||||
/*!
|
/*!
|
||||||
\namespace QuickOpen::Internal
|
\namespace Locator::Internal
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
static bool filterLessThan(const ILocatorFilter *first, const ILocatorFilter *second)
|
static bool filterLessThan(const ILocatorFilter *first, const ILocatorFilter *second)
|
||||||
@@ -245,7 +245,7 @@ void LocatorPlugin::refresh(QList<ILocatorFilter*> filters)
|
|||||||
QFuture<void> task = QtConcurrent::run(&ILocatorFilter::refresh, filters);
|
QFuture<void> task = QtConcurrent::run(&ILocatorFilter::refresh, filters);
|
||||||
Core::FutureProgress *progress = Core::ICore::instance()
|
Core::FutureProgress *progress = Core::ICore::instance()
|
||||||
->progressManager()->addTask(task, tr("Indexing"),
|
->progressManager()->addTask(task, tr("Indexing"),
|
||||||
QuickOpen::Constants::TASK_INDEX,
|
Locator::Constants::TASK_INDEX,
|
||||||
Core::ProgressManager::CloseOnSuccess);
|
Core::ProgressManager::CloseOnSuccess);
|
||||||
connect(progress, SIGNAL(finished()), this, SLOT(saveSettings()));
|
connect(progress, SIGNAL(finished()), this, SLOT(saveSettings()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtCore/QFutureWatcher>
|
#include <QtCore/QFutureWatcher>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class LocatorWidget;
|
class LocatorWidget;
|
||||||
@@ -121,6 +121,6 @@ void LocatorPlugin::loadSettingsHelper(S *settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // LOCATORPLUGIN_H
|
#endif // LOCATORPLUGIN_H
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
struct FilterEntry;
|
struct FilterEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
unsigned int qHash(const QuickOpen::FilterEntry &entry);
|
unsigned int qHash(const Locator::FilterEntry &entry);
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#include "locatorwidget.h"
|
#include "locatorwidget.h"
|
||||||
@@ -67,13 +67,13 @@ QT_END_NAMESPACE
|
|||||||
#include <QtGui/QScrollBar>
|
#include <QtGui/QScrollBar>
|
||||||
#include <QtGui/QTreeView>
|
#include <QtGui/QTreeView>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QuickOpen::ILocatorFilter*);
|
Q_DECLARE_METATYPE(Locator::ILocatorFilter*);
|
||||||
Q_DECLARE_METATYPE(QuickOpen::FilterEntry);
|
Q_DECLARE_METATYPE(Locator::FilterEntry);
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
/*! A model to represent the QuickOpen results. */
|
/*! A model to represent the Locator results. */
|
||||||
class LocatorModel : public QAbstractListModel
|
class LocatorModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -107,10 +107,10 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
uint qHash(const FilterEntry &entry)
|
uint qHash(const FilterEntry &entry)
|
||||||
@@ -122,7 +122,7 @@ uint qHash(const FilterEntry &entry)
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
// =========== QuickOpenModel ===========
|
// =========== LocatorModel ===========
|
||||||
|
|
||||||
int LocatorModel::rowCount(const QModelIndex & /* parent */) const
|
int LocatorModel::rowCount(const QModelIndex & /* parent */) const
|
||||||
{
|
{
|
||||||
@@ -135,7 +135,7 @@ int LocatorModel::columnCount(const QModelIndex &parent) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* When asked for the icon via Qt::DecorationRole, the QuickOpenModel lazily
|
* When asked for the icon via Qt::DecorationRole, the LocatorModel lazily
|
||||||
* resolves and caches the Greehouse-specific file icon when
|
* resolves and caches the Greehouse-specific file icon when
|
||||||
* FilterEntry::resolveFileIcon is true. FilterEntry::internalData is assumed
|
* FilterEntry::resolveFileIcon is true. FilterEntry::internalData is assumed
|
||||||
* to be the filename.
|
* to be the filename.
|
||||||
@@ -174,7 +174,7 @@ void LocatorModel::setEntries(const QList<FilterEntry> &entries)
|
|||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
void QuickOpenModel::setDisplayCount(int count)
|
void LocatorModel::setDisplayCount(int count)
|
||||||
{
|
{
|
||||||
// TODO: This method is meant to be used for increasing the number of items displayed at the
|
// TODO: This method is meant to be used for increasing the number of items displayed at the
|
||||||
// user's request. There is however no way yet for the user to request this.
|
// user's request. There is however no way yet for the user to request this.
|
||||||
@@ -484,6 +484,6 @@ void LocatorWidget::showEvent(QShowEvent *event)
|
|||||||
|
|
||||||
void LocatorWidget::showConfigureDialog()
|
void LocatorWidget::showConfigureDialog()
|
||||||
{
|
{
|
||||||
Core::ICore::instance()->showOptionsDialog(Constants::QUICKOPEN_CATEGORY,
|
Core::ICore::instance()->showOptionsDialog(Constants::LOCATOR_CATEGORY,
|
||||||
Constants::FILTER_OPTIONS_PAGE);
|
Constants::FILTER_OPTIONS_PAGE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Utils {
|
|||||||
class FancyLineEdit;
|
class FancyLineEdit;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class LocatorModel;
|
class LocatorModel;
|
||||||
@@ -92,6 +92,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // LOCATORWIDGET_H
|
#endif // LOCATORWIDGET_H
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
Q_DECLARE_METATYPE(Core::IEditor*);
|
Q_DECLARE_METATYPE(Core::IEditor*);
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
OpenDocumentsFilter::OpenDocumentsFilter(EditorManager *editorManager) :
|
OpenDocumentsFilter::OpenDocumentsFilter(EditorManager *editorManager) :
|
||||||
m_editorManager(editorManager)
|
m_editorManager(editorManager)
|
||||||
|
|||||||
@@ -41,10 +41,10 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class OpenDocumentsFilter : public QuickOpen::ILocatorFilter
|
class OpenDocumentsFilter : public Locator::ILocatorFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -52,9 +52,9 @@ public:
|
|||||||
OpenDocumentsFilter(Core::EditorManager *editorManager);
|
OpenDocumentsFilter(Core::EditorManager *editorManager);
|
||||||
QString trName() const { return tr("Open documents"); }
|
QString trName() const { return tr("Open documents"); }
|
||||||
QString name() const { return "Open documents"; }
|
QString name() const { return "Open documents"; }
|
||||||
QuickOpen::ILocatorFilter::Priority priority() const { return QuickOpen::ILocatorFilter::Medium; }
|
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Medium; }
|
||||||
QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
|
QList<Locator::FilterEntry> matchesFor(const QString &entry);
|
||||||
void accept(QuickOpen::FilterEntry selection) const;
|
void accept(Locator::FilterEntry selection) const;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@@ -67,6 +67,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // OPENDOCUMENTSFILTER_H
|
#endif // OPENDOCUMENTSFILTER_H
|
||||||
|
|||||||
@@ -27,19 +27,19 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef QUICKOPENCONSTANTS_H
|
#ifndef LOCATORCONSTANTS_H
|
||||||
#define QUICKOPENCONSTANTS_H
|
#define LOCATORCONSTANTS_H
|
||||||
|
|
||||||
#include <QtCore/QtGlobal>
|
#include <QtCore/QtGlobal>
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
namespace Constants {
|
namespace Constants {
|
||||||
|
|
||||||
const char * const FILTER_OPTIONS_PAGE = QT_TRANSLATE_NOOP("Locator", "Filters");
|
const char * const FILTER_OPTIONS_PAGE = QT_TRANSLATE_NOOP("Locator", "Filters");
|
||||||
const char * const QUICKOPEN_CATEGORY = QT_TRANSLATE_NOOP("Locator", "Locator");
|
const char * const LOCATOR_CATEGORY = QT_TRANSLATE_NOOP("Locator", "Locator");
|
||||||
const char * const TASK_INDEX = "QuickOpen.Task.Index";
|
const char * const TASK_INDEX = "Locator.Task.Index";
|
||||||
|
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // QUICKOPENCONSTANTS_H
|
#endif // LOCATORCONSTANTS_H
|
||||||
|
|||||||
@@ -39,10 +39,10 @@
|
|||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QuickOpen::ILocatorFilter*)
|
Q_DECLARE_METATYPE(Locator::ILocatorFilter*)
|
||||||
|
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace Locator::Internal;
|
||||||
|
|
||||||
SettingsPage::SettingsPage(LocatorPlugin *plugin)
|
SettingsPage::SettingsPage(LocatorPlugin *plugin)
|
||||||
: m_plugin(plugin), m_page(0)
|
: m_plugin(plugin), m_page(0)
|
||||||
@@ -56,17 +56,17 @@ QString SettingsPage::id() const
|
|||||||
|
|
||||||
QString SettingsPage::trName() const
|
QString SettingsPage::trName() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("Locator", QuickOpen::Constants::FILTER_OPTIONS_PAGE);
|
return QCoreApplication::translate("Locator", Locator::Constants::FILTER_OPTIONS_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SettingsPage::category() const
|
QString SettingsPage::category() const
|
||||||
{
|
{
|
||||||
return Constants::QUICKOPEN_CATEGORY;
|
return Constants::LOCATOR_CATEGORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SettingsPage::trCategory() const
|
QString SettingsPage::trCategory() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("Locator", QuickOpen::Constants::QUICKOPEN_CATEGORY);
|
return QCoreApplication::translate("Locator", Locator::Constants::LOCATOR_CATEGORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *SettingsPage::createPage(QWidget *parent)
|
QWidget *SettingsPage::createPage(QWidget *parent)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QListWidgetItem;
|
class QListWidgetItem;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QuickOpen {
|
namespace Locator {
|
||||||
|
|
||||||
class ILocatorFilter;
|
class ILocatorFilter;
|
||||||
|
|
||||||
@@ -88,6 +88,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QuickOpen
|
} // namespace Locator
|
||||||
|
|
||||||
#endif // SETTINGSPAGE_H
|
#endif // SETTINGSPAGE_H
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>QuickOpen::Internal::SettingsWidget</class>
|
<class>Locator::Internal::SettingsWidget</class>
|
||||||
<widget class="QWidget" name="QuickOpen::Internal::SettingsWidget">
|
<widget class="QWidget" name="Locator::Internal::SettingsWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -91,9 +91,6 @@
|
|||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
<enum>QAbstractSpinBox::PlusMinus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
|
||||||
<number>60</number>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> min</string>
|
<string> min</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -103,6 +100,9 @@
|
|||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>60</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QuickOpen;
|
using namespace Locator;
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class ITextEditor;
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class LineNumberFilter : public QuickOpen::ILocatorFilter
|
class LineNumberFilter : public Locator::ILocatorFilter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -51,9 +51,9 @@ public:
|
|||||||
|
|
||||||
QString trName() const { return tr("Line in current document"); }
|
QString trName() const { return tr("Line in current document"); }
|
||||||
QString name() const { return "Line in current document"; }
|
QString name() const { return "Line in current document"; }
|
||||||
QuickOpen::ILocatorFilter::Priority priority() const { return QuickOpen::ILocatorFilter::High; }
|
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::High; }
|
||||||
QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
|
QList<Locator::FilterEntry> matchesFor(const QString &entry);
|
||||||
void accept(QuickOpen::FilterEntry selection) const;
|
void accept(Locator::FilterEntry selection) const;
|
||||||
void refresh(QFutureInterface<void> &) {}
|
void refresh(QFutureInterface<void> &) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ void TextEditorActionHandler::updateCopyAction()
|
|||||||
|
|
||||||
void TextEditorActionHandler::gotoAction()
|
void TextEditorActionHandler::gotoAction()
|
||||||
{
|
{
|
||||||
QuickOpen::LocatorManager *locatorManager = QuickOpen::LocatorManager::instance();
|
Locator::LocatorManager *locatorManager = Locator::LocatorManager::instance();
|
||||||
QTC_ASSERT(locatorManager, return);
|
QTC_ASSERT(locatorManager, return);
|
||||||
const QString shortcut = TextEditorPlugin::instance()->lineNumberFilter()->shortcutString();
|
const QString shortcut = TextEditorPlugin::instance()->lineNumberFilter()->shortcutString();
|
||||||
const QString text = tr(" <line number>");
|
const QString text = tr(" <line number>");
|
||||||
|
|||||||
Reference in New Issue
Block a user