diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-19 09:27:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-19 09:27:43 +0000 |
commit | 5289c28256d3474da6abefac968fb1a6d1133bcd (patch) | |
tree | 8b55e3dac7e64d52ef66a25adbce9220f45aa4e1 | |
parent | 390140ffd07469ce5e3cac6dcbdf117cae2c08f6 (diff) |
- unused functions removed;
- cliFreeCacheItem & cliCheckCacheItem functions are teached to call basic core functions
git-svn-id: http://svn.miranda-ng.org/main/trunk@16852 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_modern/src/init.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistmod.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistsettings.cpp | 23 | ||||
-rw-r--r-- | plugins/Clist_modern/src/stdafx.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/clistsettings.cpp | 4 |
5 files changed, 11 insertions, 26 deletions
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 236275a2a0..c579ba513b 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -136,6 +136,7 @@ static HRESULT SubclassClistInterface() pcli->hInst = g_hInst;
pcli->bDisplayLocked = TRUE;
+ pcli->pfnCreateCacheItem = cliCreateCacheItem;
pcli->pfnCheckCacheItem = cliCheckCacheItem;
pcli->pfnFreeCacheItem = cliFreeCacheItem;
pcli->pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry;
@@ -148,7 +149,6 @@ static HRESULT SubclassClistInterface() pcli->pfnBeginRenameSelection = cliBeginRenameSelection;
pcli->pfnCreateClcContact = cliCreateClcContact;
- pcli->pfnCreateCacheItem = cliCreateCacheItem;
pcli->pfnGetRowBottomY = cliGetRowBottomY;
pcli->pfnGetRowHeight = cliGetRowHeight;
pcli->pfnGetRowTopY = cliGetRowTopY;
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index fe2f583a82..a6d774893a 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stdafx.h"
+#include "modern_awaymsg.h"
#include "modern_sync.h"
#include "modern_clui.h"
@@ -134,7 +135,7 @@ void UnLoadContactListModule() //unhooks noncritical events int CListMod_ContactListShutdownProc(WPARAM, LPARAM)
{
- FreeDisplayNameCache();
+ UninitAwayMsgModule();
return 0;
}
@@ -157,7 +158,8 @@ INT_PTR SvcApplySkin(WPARAM wParam, LPARAM lParam); HRESULT CluiLoadModule()
{
- InitDisplayNameCache();
+ InitAwayMsgModule();
+
HookEvent(ME_SYSTEM_SHUTDOWN, CListMod_ContactListShutdownProc);
HookEvent(ME_OPT_INITIALISE, CListOptInit);
HookEvent(ME_OPT_INITIALISE, SkinOptInit);
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 4a5013b7c2..08b5b17827 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -23,30 +23,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stdafx.h"
-#include "modern_awaymsg.h"
void InsertContactIntoTree(MCONTACT hContact, int status);
TCHAR* UnknownConctactTranslatedName = NULL;
-void InitDisplayNameCache(void)
-{
- InitAwayMsgModule();
-}
-
-void FreeDisplayNameCache()
-{
- UninitAwayMsgModule();
-}
-
void cliFreeCacheItem(ClcCacheEntry *p)
{
- mir_free_and_nil(p->tszName);
- mir_free_and_nil(p->tszGroup);
mir_free_and_nil(p->szSecondLineText);
mir_free_and_nil(p->szThirdLineText);
p->ssSecondLine.DestroySmileyList();
p->ssThirdLine.DestroySmileyList();
+
+ corecli.pfnFreeCacheItem(p);
}
void cliCheckCacheItem(ClcCacheEntry *pdnce)
@@ -74,18 +63,14 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) if (pdnce->m_iStatus == 0) //very strange look status sort is broken let always reread status
pdnce->m_iStatus = GetStatusForContact(pdnce->hContact, pdnce->m_pszProto);
- if (pdnce->tszGroup == NULL) {
- pdnce->tszGroup = db_get_tsa(pdnce->hContact, "CList", "Group");
- if (pdnce->tszGroup == NULL)
- pdnce->tszGroup = mir_tstrdup(_T(""));
- }
-
// 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)
pdnce->dwLastMsgTime = CompareContacts2_getLMTime(pdnce->hContact);
}
+
+ corecli.pfnCheckCacheItem(pdnce);
}
int GetStatusForContact(MCONTACT hContact, char *szProto)
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h index b8d2006b04..dd9534c389 100644 --- a/plugins/Clist_modern/src/stdafx.h +++ b/plugins/Clist_modern/src/stdafx.h @@ -168,8 +168,6 @@ char* __cdecl strstri(char *a, const char *b); HBITMAP ske_CreateDIB32(int cx, int cy);
-void InitDisplayNameCache(void);
-void FreeDisplayNameCache();
int CLUI_ShowWindowMod(HWND hwnd, int cmd);
void MakeButtonSkinned(HWND hWnd);
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index 9f2b8f6593..54d36ca38f 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -63,8 +63,8 @@ void fnCheckCacheItem(ClcCacheEntry *p) void fnFreeCacheItem(ClcCacheEntry *p)
{
- if (p->tszName) { mir_free(p->tszName); p->tszName = NULL; }
- if (p->tszGroup) { mir_free(p->tszGroup); p->tszGroup = NULL; }
+ replaceStrT(p->tszName, NULL);
+ replaceStrT(p->tszGroup, NULL);
p->bIsHidden = -1;
}
|