summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clistsettings.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-22 11:28:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-22 11:28:05 +0000
commitdc7a8b1f54463500d2c13339829db6c665f097da (patch)
treef93e3f2cbc72687e69bfd18945751a1f08743353 /plugins/Clist_modern/src/modern_clistsettings.cpp
parent5212643f256d5cf75b295aeb42783c81ce033519 (diff)
- major atavism removed: clist_modern own cache;
- cache items are never deleted; - MS_CLIST_INVALIDATEDISPLAYNAME service removed and replaced with pcli->pfnInvalidateDisplayNameCacheEntry() call git-svn-id: http://svn.miranda-ng.org/main/trunk@16744 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clistsettings.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp62
1 files changed, 1 insertions, 61 deletions
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index 5586f5cba8..f244b0b54f 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -31,10 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void InsertContactIntoTree(MCONTACT hContact, int status);
void CListSettings_FreeCacheItemDataOption(ClcCacheEntry *pDst, DWORD flag);
-static int displayNameCacheSize;
-
-LIST<ClcCacheEntry> clistCache(50, NumericKeySortT);
-
TCHAR* UnknownConctactTranslatedName = NULL;
void InitDisplayNameCache(void)
@@ -46,27 +42,6 @@ void InitDisplayNameCache(void)
void FreeDisplayNameCache()
{
UninitAwayMsgModule();
-
- for (int i = 0; i < clistCache.getCount(); i++) {
- pcli->pfnFreeCacheItem(clistCache[i]);
- mir_free(clistCache[i]);
- }
- clistCache.destroy();
-}
-
-ClcCacheEntry* cliGetCacheEntry(MCONTACT hContact)
-{
- ClcCacheEntry *p;
- int idx = clistCache.getIndex((ClcCacheEntry*)&hContact);
- if (idx == -1) {
- if ((p = pcli->pfnCreateCacheItem(hContact)) != NULL) {
- clistCache.insert(p);
- pcli->pfnInvalidateDisplayNameCacheEntry(hContact);
- }
- }
- else p = clistCache[idx];
- pcli->pfnCheckCacheItem(p);
- return p;
}
void CListSettings_FreeCacheItemData(ClcCacheEntry *pDst)
@@ -200,26 +175,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce)
pdnce->tszGroup = mir_tstrdup(_T(""));
}
- if (pdnce->bIsHidden == -1)
- pdnce->bIsHidden = db_get_b(pdnce->hContact, "CList", "Hidden", 0);
-
- pdnce->m_bIsSub = db_mc_isSub(pdnce->hContact) != 0;
-
- if (pdnce->m_bNoHiddenOffline == -1)
- pdnce->m_bNoHiddenOffline = db_get_b(pdnce->hContact, "CList", "noOffline", 0);
-
- if (pdnce->IdleTS == -1)
- pdnce->IdleTS = db_get_dw(pdnce->hContact, pdnce->m_pszProto, "IdleTS", 0);
-
- if (pdnce->ApparentMode == -1)
- pdnce->ApparentMode = db_get_w(pdnce->hContact, pdnce->m_pszProto, "ApparentMode", 0);
-
- if (pdnce->NotOnList == -1)
- pdnce->NotOnList = db_get_b(pdnce->hContact, "CList", "NotOnList", 0);
-
- if (pdnce->IsExpanded == -1)
- pdnce->IsExpanded = db_get_b(pdnce->hContact, "CList", "Expanded", 0);
-
+ // this variable isn't filled inside cliCreateCacheItem() because the filter could be changed dynamically
if (pdnce->dwLastMsgTime == -1 && g_CluiData.bFilterEffective & (CLVM_FILTER_LASTMSG | CLVM_FILTER_LASTMSG_NEWERTHAN | CLVM_FILTER_LASTMSG_OLDERTHAN)) {
pdnce->dwLastMsgTime = db_get_dw(pdnce->hContact, "CList", "mf_lastmsg", 0);
if (pdnce->dwLastMsgTime == 0)
@@ -227,22 +183,6 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce)
}
}
-void IvalidateDisplayNameCache()
-{
- for (int i = 0; i < clistCache.getCount(); i++) {
- ClcCacheEntry *pdnce = (ClcCacheEntry *)clistCache[i];
- pdnce->ssSecondLine.DestroySmileyList();
- mir_free_and_nil(pdnce->szSecondLineText);
- pdnce->ssThirdLine.DestroySmileyList();
- mir_free_and_nil(pdnce->szThirdLineText);
- pdnce->ssSecondLine.iMaxSmileyHeight = 0;
- pdnce->ssThirdLine.iMaxSmileyHeight = 0;
- pdnce->hTimeZone = NULL;
- pdnce->dwLastMsgTime = -1;
- Cache_GetTimezone(NULL, pdnce->hContact);
- }
-}
-
int GetStatusForContact(MCONTACT hContact, char *szProto)
{
return (szProto) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : ID_STATUS_OFFLINE;