forked from qt-creator/qt-creator
Utils: FsEngine micro-optimizations
Mostly for shorter code, but also save a few cycles due to less string construction and run time dispatch. Also, make testFilePathFromToString() test two paths instead one path twice. Change-Id: I50a3145bca1a4b262a15e96173ea7ebd9cb678ad Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -138,10 +138,8 @@ bool FolderSortProxyModel::filterAcceptsRow(int source_row, const QModelIndex &s
|
||||
if (static_cast<QFileSystemModel *>(sourceModel())->rootPath().isEmpty()) {
|
||||
QModelIndex sourceIndex = sourceModel()->index(source_row, 0, source_parent);
|
||||
while (sourceIndex.isValid()) {
|
||||
if (sourceIndex.data().toString()
|
||||
== FilePath::specialPath(FilePath::SpecialPathComponent::RootName)) {
|
||||
if (sourceIndex.data().toString() == FilePath::specialRootName())
|
||||
return false;
|
||||
}
|
||||
|
||||
sourceIndex = sourceIndex.parent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user