Fix opening files created with file system filter

Using the "Create and Open" functionality of the file system locator
filter was no longer opening the file.

Amends 5ce704b394

Change-Id: Icb5bdad714d27e2cf74e47048d362e43e4247574
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2021-06-11 16:17:32 +02:00
parent c9ffce8e50
commit cb5d120724

View File

@@ -155,8 +155,12 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
const QString fullFilePath = dirInfo.filePath(link.targetFilePath.fileName());
const bool containsWildcard = entry.contains('?') || entry.contains('*');
if (!containsWildcard && !QFileInfo::exists(fullFilePath) && dirInfo.exists()) {
LocatorFilterEntry createAndOpen(this, tr("Create and Open \"%1\"").arg(entry), fullFilePath);
createAndOpen.extraInfo = Utils::FilePath::fromString(dirInfo.absolutePath()).shortNativePath();
LocatorFilterEntry createAndOpen(this,
tr("Create and Open \"%1\"").arg(entry),
fullFilePath);
createAndOpen.filePath = FilePath::fromString(fullFilePath);
createAndOpen.extraInfo = Utils::FilePath::fromString(dirInfo.absolutePath())
.shortNativePath();
entries[int(MatchLevel::Normal)].append(createAndOpen);
}