Author: bonefish Date: 2010-02-26 15:55:31 +0100 (Fri, 26 Feb 2010) New Revision: 35624 Changeset: http://dev.haiku-os.org/changeset/35624/haiku Ticket: http://dev.haiku-os.org/ticket/5185 Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp Log: Sort the package credits case-insensitively. Fixes #5185. Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp =================================================================== --- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2010-02-26 14:54:32 UTC (rev 35623) +++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp 2010-02-26 14:55:31 UTC (rev 35624) @@ -14,6 +14,7 @@ #include <time.h> #include <unistd.h> +#include <algorithm> #include <map> #include <string> @@ -1255,7 +1256,7 @@ " 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,10 +1478,23 @@ 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(); for (int32 i = 1; i < count; i++)