forked from qt-creator/qt-creator
Fix that locator filters filter did not show entries with same prefix
When setting filters to the same prefix, only one of them was shown in the locator filters filter (i.e. the in the first entries shown when opening locator without any input). Change-Id: If409b5d4292d865318747f2a09610652a80757ca Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "locatorwidget.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
@@ -83,7 +84,7 @@ QList<LocatorFilterEntry> LocatorFiltersFilter::matchesFor(QFutureInterface<Loca
|
||||
break;
|
||||
LocatorFilterEntry filterEntry(this,
|
||||
m_filterShortcutStrings.at(i),
|
||||
m_filterShortcutStrings.at(i),
|
||||
i,
|
||||
m_icon);
|
||||
filterEntry.extraInfo = m_filterDisplayNames.at(i);
|
||||
entries.append(filterEntry);
|
||||
@@ -93,7 +94,10 @@ QList<LocatorFilterEntry> LocatorFiltersFilter::matchesFor(QFutureInterface<Loca
|
||||
|
||||
void LocatorFiltersFilter::accept(LocatorFilterEntry selection) const
|
||||
{
|
||||
const QString shortcutString = selection.internalData.toString();
|
||||
bool ok;
|
||||
int index = selection.internalData.toInt(&ok);
|
||||
QTC_ASSERT(ok && index >= 0 && index < m_filterShortcutStrings.size(), return);
|
||||
const QString shortcutString = m_filterShortcutStrings.at(index);
|
||||
if (!shortcutString.isEmpty())
|
||||
m_locatorWidget->show(shortcutString + QLatin1Char(' '),
|
||||
shortcutString.length() + 1);
|
||||
|
Reference in New Issue
Block a user