From efcb16c6ab532ad12ecf57822d61d6be464fc759 Mon Sep 17 00:00:00 2001 From: Zhang Sheng Date: Thu, 12 Dec 2024 15:34:34 +0800 Subject: [PATCH] fix: remove redundant path check in TagDirIterator Remove unnecessary path validation in TagDirIterator::loadTagsUrls(): - Remove check for "/home/" prefix - Remove check for "/media/" prefix - Remove TODO comment about SQL path handling The path validation was redundant since: 1. File existence is already checked later 2. All valid paths should be allowed for tagging 3. The path restriction was artificially limiting functionality Log: Bug: https://pms.uniontech.com/bug-view-293709.html --- .../dfmplugin-tag/files/private/tagdiriterator_p.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/plugins/common/dfmplugin-tag/files/private/tagdiriterator_p.cpp b/src/plugins/common/dfmplugin-tag/files/private/tagdiriterator_p.cpp index e4634ec105..0376b7f446 100644 --- a/src/plugins/common/dfmplugin-tag/files/private/tagdiriterator_p.cpp +++ b/src/plugins/common/dfmplugin-tag/files/private/tagdiriterator_p.cpp @@ -41,15 +41,7 @@ void TagDirIteratorPrivate::loadTagsUrls(const QUrl &url) QStringList pathList = TagManager::instance()->getFilesByTag(tagName); for (const QString &path : pathList) { - QUrl tagUrl; - // TODO(liuyangming): handle path in sql - if (!path.startsWith("/home/") - && !path.startsWith(FileUtils::bindPathTransform("/home/", true)) - && !path.startsWith("/media/")) - continue; - - tagUrl = QUrl::fromLocalFile(path); - + QUrl tagUrl = QUrl::fromLocalFile(path); const FileInfoPointer &info = InfoFactory::create(tagUrl); if (!info->exists()) continue;