diff --git a/src/dfm-io/dfm-io/denumerator.cpp b/src/dfm-io/dfm-io/denumerator.cpp index 8c6d40a..6c12956 100644 --- a/src/dfm-io/dfm-io/denumerator.cpp +++ b/src/dfm-io/dfm-io/denumerator.cpp @@ -453,7 +453,10 @@ QUrl DEnumeratorPrivate::buildUrl(const QUrl &url, const char *fileName) QString dirPath = url.path(); path = dirPath.endsWith('/') ? dirPath + QString(fileName) : dirPath + "/" + QString(fileName); } - QUrl nextUrl = QUrl::fromLocalFile(path); + + // 保留原始 URL 的 scheme 和 host,而不是假定为本地文件 + QUrl nextUrl = url; + nextUrl.setPath(path); if (url.userInfo().startsWith("originPath::")) { nextUrl.setUserInfo(url.userInfo() + QString::fromLatin1("/") + QString::fromLatin1(fileName)); diff --git a/src/dfm-search/dfm-search-lib/utils/filenameblacklistmatcher.cpp b/src/dfm-search/dfm-search-lib/utils/filenameblacklistmatcher.cpp index f997ef4..387e509 100644 --- a/src/dfm-search/dfm-search-lib/utils/filenameblacklistmatcher.cpp +++ b/src/dfm-search/dfm-search-lib/utils/filenameblacklistmatcher.cpp @@ -31,8 +31,11 @@ static bool isAbsolutePathMatch(const QString &normalizedPath, const QString &bl bool isPathBlacklisted(const QString &inputPath, const QStringList &blacklistEntries) { const QString normalizedPath = normalizePathForBlacklistMatch(inputPath); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const QStringList pathSegments = normalizedPath.split('/', Qt::SkipEmptyParts); - +#else + const QStringList pathSegments = normalizedPath.split('/', QString::SkipEmptyParts); +#endif for (const QString &entry : blacklistEntries) { const QString trimmedEntry = entry.trimmed(); if (trimmedEntry.isEmpty()) {