diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-24 22:59:00 +0200 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-24 22:59:00 +0200 |
commit | a7d2130464fa5e73ba7faf8b697b98443e80257a (patch) | |
tree | d7b8cb2837e525fcb83e2fb31a6b4332a806f1bc /indra/newview/llavatarlist.cpp | |
parent | 11a9fe3e7c10fddee6bcf4294e852f6ae389e3d6 (diff) |
Fixed major bug EXT-2701 (Recent People > last_interaction value is not internationalized).
Made the avatar last interaction time localizeable.
This also fixes task EXT-1096 (Implement Recent time in Recent People list for Avatar items).
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index bb03f47f46..7f3f869e5d 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -363,37 +363,6 @@ void LLAvatarList::computeDifference( vadded.erase(it, vadded.end()); } -static std::string format_secs(S32 secs) -{ - // *TODO: reinventing the wheel? - // *TODO: i18n - static const int LL_AL_MIN = 60; - static const int LL_AL_HOUR = LL_AL_MIN * 60; - static const int LL_AL_DAY = LL_AL_HOUR * 24; - static const int LL_AL_WEEK = LL_AL_DAY * 7; - static const int LL_AL_MONTH = LL_AL_DAY * 31; - static const int LL_AL_YEAR = LL_AL_DAY * 365; - - std::string s; - - if (secs >= LL_AL_YEAR) - s = llformat("%dy", secs / LL_AL_YEAR); - else if (secs >= LL_AL_MONTH) - s = llformat("%dmon", secs / LL_AL_MONTH); - else if (secs >= LL_AL_WEEK) - s = llformat("%dw", secs / LL_AL_WEEK); - else if (secs >= LL_AL_DAY) - s = llformat("%dd", secs / LL_AL_DAY); - else if (secs >= LL_AL_HOUR) - s = llformat("%dh", secs / LL_AL_HOUR); - else if (secs >= LL_AL_MIN) - s = llformat("%dm", secs / LL_AL_MIN); - else - s = llformat("%ds", secs); - - return s; -} - // Refresh shown time of our last interaction with all listed avatars. void LLAvatarList::updateLastInteractionTimes() { @@ -407,7 +376,7 @@ void LLAvatarList::updateLastInteractionTimes() LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it); S32 secs_since = now - (S32) LLRecentPeople::instance().getDate(item->getAvatarId()).secondsSinceEpoch(); if (secs_since >= 0) - item->setLastInteractionTime(format_secs(secs_since)); + item->setLastInteractionTime(secs_since); } } |