Sort the package credits case-insensitively. Fixes #5185.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35624 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -1477,9 +1478,22 @@ AboutView::_AddCopyrightsFromAttribute()
|
|||||||
void
|
void
|
||||||
AboutView::_AddPackageCreditEntries()
|
AboutView::_AddPackageCreditEntries()
|
||||||
{
|
{
|
||||||
|
// sort the packages case-insensitively
|
||||||
|
PackageCredit* packages[fPackageCredits.size()];
|
||||||
|
int32 count = 0;
|
||||||
for (PackageCreditMap::iterator it = fPackageCredits.begin();
|
for (PackageCreditMap::iterator it = fPackageCredits.begin();
|
||||||
it != fPackageCredits.end(); ++it) {
|
it != fPackageCredits.end(); ++it) {
|
||||||
PackageCredit* package = it->second;
|
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));
|
BString text(package->CopyrightAt(0));
|
||||||
int32 count = package->CountCopyrights();
|
int32 count = package->CountCopyrights();
|
||||||
|
|||||||
Reference in New Issue
Block a user