FSEngine: Speed optimization

Change-Id: I1fdb61042df47941921a8f278d0626b440084ec4
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-09-27 09:47:59 +02:00
parent 5d4bbd38d4
commit 0f4ba36008

View File

@@ -48,16 +48,15 @@ QAbstractFileEngine *FSEngineHandler::create(const QString &fileName) const
return new FixedListFSEngine(rootFilePath.pathAppended(scheme), filteredRoots); return new FixedListFSEngine(rootFilePath.pathAppended(scheme), filteredRoots);
} }
} }
FilePath filePath = FilePath::fromString(fixedFileName);
if (filePath.needsDevice())
return new FSEngineImpl(filePath);
if (fixedFileName.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0)
return new RootInjectFSEngine(fixedFileName);
} }
FilePath filePath = FilePath::fromString(fixedFileName);
if (filePath.needsDevice())
return new FSEngineImpl(filePath);
if (fixedFileName.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0)
return new RootInjectFSEngine(fixedFileName);
return nullptr; return nullptr;
} }