Parcourir la source

Sort strings in the correct order

kiwec il y a 4 mois
Parent
commit
ca456e4baa
2 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 1 0
      src/App/Osu/Changelog.cpp
  2. 3 3
      src/App/Osu/SongBrowser/SongBrowser.cpp

+ 1 - 0
src/App/Osu/Changelog.cpp

@@ -29,6 +29,7 @@ Changelog::Changelog() : ScreenBackable() {
     CHANGELOG latest;
     latest.title =
         UString::format("%.2f (%s, %s)", convar->getConVarByName("osu_version")->getFloat(), __DATE__, __TIME__);
+    latest.changes.push_back("- Fixed Artist/Creator/Title sorting to be in A-Z order");
     latest.changes.push_back("- Improved sound engine reliability");
     latest.changes.push_back("- Removed herobrine");
     changelogs.push_back(latest);

+ 3 - 3
src/App/Osu/SongBrowser/SongBrowser.cpp

@@ -249,7 +249,7 @@ bool SongBrowser::SortByArtist::operator()(Button const *a, Button const *b) con
 
     int res = strcasecmp(a->getDatabaseBeatmap()->getArtist().c_str(), b->getDatabaseBeatmap()->getArtist().c_str());
     if(res == 0) return a->getSortHack() < b->getSortHack();
-    return res > 0;
+    return res < 0;
 }
 
 bool SongBrowser::SortByBPM::operator()(Button const *a, Button const *b) const {
@@ -266,7 +266,7 @@ bool SongBrowser::SortByCreator::operator()(Button const *a, Button const *b) co
 
     int res = strcasecmp(a->getDatabaseBeatmap()->getCreator().c_str(), b->getDatabaseBeatmap()->getCreator().c_str());
     if(res == 0) return a->getSortHack() < b->getSortHack();
-    return res > 0;
+    return res < 0;
 }
 
 bool SongBrowser::SortByDateAdded::operator()(Button const *a, Button const *b) const {
@@ -310,7 +310,7 @@ bool SongBrowser::SortByTitle::operator()(Button const *a, Button const *b) cons
 
     int res = strcasecmp(a->getDatabaseBeatmap()->getTitle().c_str(), b->getDatabaseBeatmap()->getTitle().c_str());
     if(res == 0) return a->getSortHack() < b->getSortHack();
-    return res > 0;
+    return res < 0;
 }
 
 SongBrowser::SongBrowser() : ScreenBackable() {