diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp index 92a170dcfc..151a90a2b1 100644 --- a/src/apps/deskbar/TimeView.cpp +++ b/src/apps/deskbar/TimeView.cpp @@ -96,6 +96,8 @@ TTimeView::TTimeView(float maxWidth, float height, bool showSeconds, fLastTimeStr[0] = 0; fLastDateStr[0] = 0; fNeedToUpdate = true; + + be_locale_roster->GetDefaultCountry(&fHere); } @@ -109,6 +111,8 @@ TTimeView::TTimeView(BMessage* data) data->FindBool("eurodate", &fEuroDate); data->FindBool("interval", &fInterval); fShowingDate = false; + + be_locale_roster->GetDefaultCountry(&fHere); } #endif @@ -317,11 +321,7 @@ TTimeView::GetCurrentTime() fMinute = time.tm_min; fHour = time.tm_hour; - - BCountry* here; - be_locale_roster->GetDefaultCountry(&here); - - here->FormatTime(fTimeStr, 64, fTime, fShowSeconds); + fHere->FormatTime(fTimeStr, 64, fTime, fShowSeconds); } diff --git a/src/apps/deskbar/TimeView.h b/src/apps/deskbar/TimeView.h index 9837665e39..333eba695a 100644 --- a/src/apps/deskbar/TimeView.h +++ b/src/apps/deskbar/TimeView.h @@ -44,12 +44,14 @@ const uint32 kShowSeconds = 'ShSc'; const uint32 kFullDate = 'FDat'; const uint32 kEuroDate = 'EDat'; +class BCountry; class BMessageRunner; #ifdef AS_REPLICANT class _EXPORT TTimeView; #endif + class TTimeView : public BView { public: TTimeView(float maxWidth, float height, bool showSeconds = false, @@ -130,6 +132,8 @@ class TTimeView : public BView { BMessenger fCalendarWindow; BMessageRunner* fLongClickMessageRunner; + + BCountry* fHere; // For date and time localizing purposes };