[PR #2480] [CLOSED] Refactor string comparison helper function for case-insensitive compa… #2767

Closed
opened 2026-02-27 22:01:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2480
Author: @colinmendoza121
Created: 2/19/2025
Status: Closed

Base: mainHead: feature


📝 Commits (1)

  • 7d8d6e7 Refactor string comparison helper function for case-insensitive comparison

📊 Changes

1 file changed (+22 additions, -8 deletions)

View changed files

📝 src/qt_gui/game_list_frame.h (+22 -8)

📄 Description

Summary

Refactor case-insensitive string comparison functionality into a helper function.

Changes

  • Moved the string comparison logic for case-insensitive sorting from the GameListFrame class into a dedicated helper function, CompareStringsCaseInsensitive.
  • Used std::transform to convert both strings to lowercase before performing the comparison.
  • Ensured consistent code spacing for readability and alignment with the project's coding style guidelines.

Motivation

The refactor improves code readability and modularity by encapsulating the case-insensitive comparison logic in a reusable helper function. This also reduces redundancy and ensures that the string comparison logic is easier to maintain and extend in the future.

Testing

  • The string comparison function was tested with various game titles to ensure the sorting works correctly regardless of case (uppercase or lowercase).
  • No regressions were observed in sorting behavior, and the UI displays the game list in the correct order.

Fixes Issue #2260: Sorting Order Broken When Game Title Is in ALL CAPS.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2480 **Author:** [@colinmendoza121](https://github.com/colinmendoza121) **Created:** 2/19/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature` --- ### 📝 Commits (1) - [`7d8d6e7`](https://github.com/shadps4-emu/shadPS4/commit/7d8d6e7aeb79c885274c383d3f33f93a0e21d998) Refactor string comparison helper function for case-insensitive comparison ### 📊 Changes **1 file changed** (+22 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/qt_gui/game_list_frame.h` (+22 -8) </details> ### 📄 Description ## Summary Refactor case-insensitive string comparison functionality into a helper function. ## Changes - Moved the string comparison logic for case-insensitive sorting from the `GameListFrame` class into a dedicated helper function, `CompareStringsCaseInsensitive`. - Used `std::transform` to convert both strings to lowercase before performing the comparison. - Ensured consistent code spacing for readability and alignment with the project's coding style guidelines. ## Motivation The refactor improves code readability and modularity by encapsulating the case-insensitive comparison logic in a reusable helper function. This also reduces redundancy and ensures that the string comparison logic is easier to maintain and extend in the future. ## Testing - The string comparison function was tested with various game titles to ensure the sorting works correctly regardless of case (uppercase or lowercase). - No regressions were observed in sorting behavior, and the UI displays the game list in the correct order. ## Related Issues Fixes Issue #2260: Sorting Order Broken When Game Title Is in ALL CAPS. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2767
No description provided.