Commit 9a61bf2a authored by Nikita Baryshnikov's avatar Nikita Baryshnikov

Locator: make sure that parent dir is always first

in FileSystemFilter

Change-Id: Idb4e0510b6d7e9e5de3fc32880c1fc1d423902ac
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent ce4d7e9d
......@@ -87,7 +87,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
directory.prepend(m_currentDocumentDirectory + "/");
}
QDir dirInfo(directory);
QDir::Filters dirFilter = QDir::Dirs|QDir::Drives|QDir::NoDot;
QDir::Filters dirFilter = QDir::Dirs|QDir::Drives|QDir::NoDot|QDir::NoDotDot;
QDir::Filters fileFilter = QDir::Files;
if (m_includeHidden) {
dirFilter |= QDir::Hidden;
......@@ -100,6 +100,8 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
QStringList files = dirInfo.entryList(fileFilter,
QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
dirs.prepend("..");
foreach (const QString &dir, dirs) {
if (future.isCanceled())
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment