Deskbar: get default collator from BLocale
...using BLocale::Default()->GetCollator(&collator) Thanks waddlesplash
This commit is contained in:
@@ -70,8 +70,6 @@ All rights reserved.
|
||||
#include "tracker_private.h"
|
||||
|
||||
|
||||
BCollator gCollator;
|
||||
|
||||
BLocker TBarApp::sSubscriberLock;
|
||||
BList TBarApp::sBarTeamInfoList;
|
||||
BList TBarApp::sSubscribers;
|
||||
|
||||
@@ -36,7 +36,6 @@ All rights reserved.
|
||||
#define BAR_APP_H
|
||||
|
||||
|
||||
#include <Collator.h>
|
||||
#include <Server.h>
|
||||
|
||||
#include "BarSettings.h"
|
||||
@@ -77,8 +76,6 @@ const int32 kIconCacheCount = (kMaximumIconSize - kMinimumIconSize)
|
||||
// update preferences message constant
|
||||
const uint32 kUpdatePreferences = 'Pref';
|
||||
|
||||
extern BCollator gCollator;
|
||||
|
||||
/* --------------------------------------------- */
|
||||
|
||||
class BBitmap;
|
||||
|
||||
@@ -42,6 +42,7 @@ All rights reserved.
|
||||
|
||||
#include <Autolock.h>
|
||||
#include <Bitmap.h>
|
||||
#include <Collator.h>
|
||||
#include <ControlLook.h>
|
||||
#include <Debug.h>
|
||||
#include <MenuPrivate.h>
|
||||
@@ -643,11 +644,14 @@ TExpandoMenuBar::AddTeam(BList* team, BBitmap* icon, char* name,
|
||||
firstApp++;
|
||||
}
|
||||
|
||||
BCollator collator;
|
||||
BLocale::Default()->GetCollator(&collator);
|
||||
|
||||
int32 i = firstApp;
|
||||
int32 itemCount = CountItems();
|
||||
while (i < itemCount) {
|
||||
teamItem = dynamic_cast<TTeamMenuItem*>(ItemAt(i));
|
||||
if (teamItem != NULL && gCollator.Compare(teamItem->Label(), name)
|
||||
if (teamItem != NULL && collator.Compare(teamItem->Label(), name)
|
||||
> 0) {
|
||||
AddItem(item, i);
|
||||
break;
|
||||
|
||||
@@ -39,6 +39,7 @@ All rights reserved.
|
||||
#include <strings.h>
|
||||
|
||||
#include <Application.h>
|
||||
#include <Collator.h>
|
||||
#include <Debug.h>
|
||||
#include <Roster.h>
|
||||
|
||||
@@ -65,7 +66,10 @@ TTeamMenu::TTeamMenu()
|
||||
int
|
||||
TTeamMenu::CompareByName(const void* first, const void* second)
|
||||
{
|
||||
return gCollator.Compare(
|
||||
BCollator collator;
|
||||
BLocale::Default()->GetCollator(&collator);
|
||||
|
||||
return collator.Compare(
|
||||
(*(static_cast<BarTeamInfo* const*>(first)))->name,
|
||||
(*(static_cast<BarTeamInfo* const*>(second)))->name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user