feat(color): Make model sorting case insensitive (#4482)

This commit is contained in:
philmoz
2024-01-01 07:36:31 +10:00
committed by GitHub
parent 795789a033
commit 68f0f3d864
+2 -2
View File
@@ -856,11 +856,11 @@ void ModelMap::sortModelsBy(ModelsVector &mv, ModelsSortBy sortby)
}); });
} else if (sortby == NAME_ASC) { } else if (sortby == NAME_ASC) {
std::sort(mv.begin(), mv.end(), [](ModelCell *a, ModelCell *b) -> bool { std::sort(mv.begin(), mv.end(), [](ModelCell *a, ModelCell *b) -> bool {
return strcmp(a->modelName, b->modelName) < 0; return strcasecmp(a->modelName, b->modelName) < 0;
}); });
} else if (sortby == NAME_DES) { } else if (sortby == NAME_DES) {
std::sort(mv.begin(), mv.end(), [](ModelCell *a, ModelCell *b) -> bool { std::sort(mv.begin(), mv.end(), [](ModelCell *a, ModelCell *b) -> bool {
return strcmp(a->modelName, b->modelName) > 0; return strcasecmp(a->modelName, b->modelName) > 0;
}); });
} }
} }