summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Scipione <jscipione@gmail.com>2016-08-23 00:14:57 (GMT)
committerJohn Scipione <jscipione@gmail.com>2016-08-23 00:15:56 (GMT)
commitc2507fb82b2e98c644fcecce88b64c3cd267775c (patch)
treeebfa1bdb7f612c4183fae1617628e23155d8d814
parentdd6fccb0629852693b4bbb03037431a63470d0f1 (diff)
Deskbar: get default collator from BLocaleHEADhrev50509master
...using BLocale::Default()->GetCollator(&collator) Thanks waddlesplash
-rw-r--r--src/apps/deskbar/BarApp.cpp2
-rw-r--r--src/apps/deskbar/BarApp.h3
-rw-r--r--src/apps/deskbar/ExpandoMenuBar.cpp6
-rw-r--r--src/apps/deskbar/TeamMenu.cpp6
4 files changed, 10 insertions, 7 deletions
diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
index 8043fb2..d196bd8 100644
--- a/src/apps/deskbar/BarApp.cpp
+++ b/src/apps/deskbar/BarApp.cpp
@@ -70,8 +70,6 @@ All rights reserved.
#include "tracker_private.h"
-BCollator gCollator;
-
BLocker TBarApp::sSubscriberLock;
BList TBarApp::sBarTeamInfoList;
BList TBarApp::sSubscribers;
diff --git a/src/apps/deskbar/BarApp.h b/src/apps/deskbar/BarApp.h
index 080e7af..362b62d 100644
--- a/src/apps/deskbar/BarApp.h
+++ b/src/apps/deskbar/BarApp.h
@@ -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;
diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp
index 66df4e6..f3226f8 100644
--- a/src/apps/deskbar/ExpandoMenuBar.cpp
+++ b/src/apps/deskbar/ExpandoMenuBar.cpp
@@ -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;
diff --git a/src/apps/deskbar/TeamMenu.cpp b/src/apps/deskbar/TeamMenu.cpp
index 9017c65..2816fe4 100644
--- a/src/apps/deskbar/TeamMenu.cpp
+++ b/src/apps/deskbar/TeamMenu.cpp
@@ -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);
}