From 561d4cb9ebb65e5dff964759459a25f5be56b2e2 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 26 Feb 2010 14:55:31 +0000 Subject: [PATCH] Sort the package credits case-insensitively. Fixes #5185. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35624 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/aboutsystem/AboutSystem.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index 1e8b1746f5..9aac613b9b 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -1255,7 +1256,7 @@ AboutView::_CreateCreditsView() " Guido Vollbeding. This software is based in part on the " "work of the Independent JPEG Group")); // TODO: License! - + // libprint copyrights _AddPackageCredit(PackageCredit("libprint") .SetCopyright(COPYRIGHT_STRING @@ -1477,9 +1478,22 @@ AboutView::_AddCopyrightsFromAttribute() void AboutView::_AddPackageCreditEntries() { + // sort the packages case-insensitively + PackageCredit* packages[fPackageCredits.size()]; + int32 count = 0; for (PackageCreditMap::iterator it = fPackageCredits.begin(); - it != fPackageCredits.end(); ++it) { - PackageCredit* package = it->second; + it != fPackageCredits.end(); ++it) { + packages[count++] = it->second; + } + + if (count > 1) { + std::sort(packages, packages + count, + &PackageCredit::NameLessInsensitive); + } + + // add the credits + for (int32 i = 0; i < count; i++) { + PackageCredit* package = packages[i]; BString text(package->CopyrightAt(0)); int32 count = package->CountCopyrights();