summaryrefslogtreecommitdiff
path: root/indra/newview/llavatariconctrl.h
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
committerMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
commit3e10fa4d51a23bf6f1ced23e8d90c636d84fa5db (patch)
treed4991e4c1a9dd934f48d33804e55eb8ffa085679 /indra/newview/llavatariconctrl.h
parente9f7205ba9f4dfb3422759218609b62d61972722 (diff)
parentf20e9521a9b70f4e83cbb6888feae08a70681ea7 (diff)
merge from latest svn/viewer-2-0 to hg/viewer-2-0
Diffstat (limited to 'indra/newview/llavatariconctrl.h')
-rw-r--r--indra/newview/llavatariconctrl.h42
1 files changed, 30 insertions, 12 deletions
diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h
index 49e304a521..77390eb233 100644
--- a/indra/newview/llavatariconctrl.h
+++ b/indra/newview/llavatariconctrl.h
@@ -37,6 +37,35 @@
#include "llavatarpropertiesprocessor.h"
#include "llviewermenu.h"
+class LLAvatarIconIDCache: public LLSingleton<LLAvatarIconIDCache>
+{
+public:
+ struct LLAvatarIconIDCacheItem
+ {
+ LLUUID icon_id;
+ LLDate cached_time;
+
+ bool expired();
+ };
+
+ LLAvatarIconIDCache():mFilename("avatar_icons_cache.txt")
+ {
+ }
+
+ void load ();
+ void save ();
+
+ LLUUID* get (const LLUUID& id);
+ void add (const LLUUID& avatar_id,const LLUUID& icon_id);
+
+ void remove (const LLUUID& id);
+protected:
+
+
+ std::string mFilename;
+ std::map<LLUUID,LLAvatarIconIDCacheItem> mCache;//we cache only LLUID and time
+};
+
class LLAvatarIconCtrl
: public LLIconCtrl, public LLAvatarPropertiesObserver
{
@@ -82,19 +111,8 @@ protected:
LLHandle<LLView> mPopupMenuHandle;
bool mDrawTooltip;
- struct LLImagesCacheItem
- {
- LLUUID image_id;
- U32 flags;
-
- LLImagesCacheItem(LLUUID image_id_, U32 flags_) : image_id(image_id_), flags(flags_) {}
- };
-
- typedef std::map<LLUUID, LLAvatarIconCtrl::LLImagesCacheItem> avatar_image_map_t;
-
- static avatar_image_map_t sImagesCache;
- void updateFromCache(LLAvatarIconCtrl::LLImagesCacheItem data);
+ bool updateFromCache();
};
#endif // LL_LLAVATARICONCTRL_H