-
Notifications
You must be signed in to change notification settings - Fork 28
检出排序的算法到1071上 #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
检出排序的算法到1071上 #242
Conversation
- Refactor compareByStringEx to improve natural sorting, including better handling of numbers, letters, Han characters, and symbols. - Add isFullWidthChar to normalize full-width characters for accurate comparison. - Improve numberStr to extract numeric substrings with normalization. - Remove unused parameters from compareByStringEx and update all call sites. - Enhance robustness and accuracy of file name sorting, especially for mixed character types and full-width characters. Log: enhance string comparison and sorting for file names
1. Removed the previous file extension splitting logic in DLocalHelper::compareByStringEx that caused incorrect sorting 2. Added a new public method DFMUtils::compareFileName to expose the corrected comparison function 3. Now comparing full strings without separating names and extensions 4. Also fixed URL handling to use toLocal8Bit() instead of toStdString() for better compatibility The change was necessary because: 1. The old implementation incorrectly sorted files by splitting names and extensions 2. The new approach provides more accurate natural sorting by comparing entire strings 3. Makes the functionality available as a public API for broader use 4. Improves compatibility with various file name encodings Bug: https://pms.uniontech.com/bug-view-335751.html fix: 修正文件名比较逻辑 1. 移除 DLocalHelper::compareByStringEx 中导致排序错误的扩展名分割逻辑 2. 新增公共方法 DFMUtils::compareFileName 提供正确的比较功能 3. 现在直接比较完整字符串而不分割名称和扩展名 4. 同时将 URL 处理改为使用 toLocal8Bit() 提高兼容性 修改原因: 1. 旧实现在分割文件名和扩展名时排序不正确 2. 新方法通过比较完整字符串提供更准确的自然排序 3. 将该功能作为公共 API 开放以方便其他模块使用 4. 提高对各种文件名编码的兼容性
Apply QUrl::fromPercentEncoding to g_file_get_uri result before using it as a key to look up delete information, ensuring proper handling of URL-encoded file URIs in trash operations. Log: decode URL-encoded URIs in TrashHelper::getTrashUrls Bug: https://pms.uniontech.com/bug-view-336357.html
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liyigang1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liyigang1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review我来对这个 diff 进行详细的代码审查:
总体来说,这次改动提高了代码的质量和性能,特别是在处理全角字符和文件名比较方面。代码结构更加清晰,维护性更好。建议在后续开发中重点关注边界条件的处理和测试覆盖。 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
检出排序的算法到1071上