diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-23 12:26:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-23 12:26:03 +0000 |
commit | 0c4dc97b703e93e2503c9cabedaa6c42984d0f00 (patch) | |
tree | f1a46a67fe7bb62ed8556d0a0a8cecb65baddea3 /plugins/Clist_modern | |
parent | 9f0105daab3c080213ebb30d3a6449bb3d77e37f (diff) |
- we don't drop data cache upon the embedded clists rebuild;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16862 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 15 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.h | 35 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcpaint.cpp | 6 |
4 files changed, 21 insertions, 37 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 5cf0d6f8ba..febdac5d3a 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1463,21 +1463,12 @@ static LRESULT clcOnIntmTimeZoneChanged(ClcData *dat, HWND hwnd, UINT msg, WPARA static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
-
- pcli->pfnInvalidateDisplayNameCacheEntry(wParam);
+ LRESULT ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
ClcContact *contact;
- if (!FindItem(hwnd, dat, wParam, &contact, NULL, NULL, false))
- return ret;
-
- if (contact) {
- mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
+ if (FindItem(hwnd, dat, wParam, &contact, NULL, NULL, false))
Cache_GetText(dat, contact);
- // cliRecalcScrollBar(hwnd, dat);
- }
- dat->needsResort = 1;
return ret;
}
@@ -1536,7 +1527,7 @@ static LRESULT clcOnIntmScrollBarChanged(ClcData *dat, HWND hwnd, UINT, WPARAM, static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+ LRESULT ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (wParam != 0) {
ClcContact *contact;
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h index f4321024cc..ab542e615b 100644 --- a/plugins/Clist_modern/src/modern_clc.h +++ b/plugins/Clist_modern/src/modern_clc.h @@ -103,15 +103,12 @@ void clcSetDelayTimer(UINT_PTR uIDEvent, HWND hwnd, int nDelay = -1); #define DROPTARGET_ONMETACONTACT 6
#define DROPTARGET_ONSUBCONTACT 7
-ClcGroup;
-
#define CONTACTF_ONLINE 1
#define CONTACTF_INVISTO 2
#define CONTACTF_VISTO 4
#define CONTACTF_NOTONLIST 8
#define CONTACTF_CHECKED 16
#define CONTACTF_IDLE 32
-//#define CONTACTF_STATUSMSG 64
#define AVATAR_POS_DONT_HAVE -1
#define AVATAR_POS_ANIMATED -2
@@ -234,7 +231,7 @@ struct ClcLineInfo struct ClcModernFontInfo {
HFONT hFont;
- int fontHeight, changed;
+ int fontHeight, changed;
COLORREF colour;
BYTE effect;
COLORREF effectColour1;
@@ -245,34 +242,34 @@ struct ClcData : public ClcDataBase {
BYTE HiLightMode;
BYTE doubleClickExpand;
- int MetaIgnoreEmptyExtra;
+ int MetaIgnoreEmptyExtra;
BYTE expandMeta;
BYTE IsMetaContactsEnabled;
time_t last_tick_time;
BOOL force_in_dialog;
- int subIndent;
- int rightMargin;
+ int subIndent;
+ int rightMargin;
HBITMAP hMenuBackground;
DWORD MenuBkColor, MenuBkHiColor, MenuTextColor, MenuTextHiColor;
- int MenuBmpUse;
+ int MenuBmpUse;
// Row height
int *row_heights;
- int row_heights_size;
- int row_heights_allocated;
+ int row_heights_size;
+ int row_heights_allocated;
// Avatar cache
IMAGE_ARRAY_DATA avatar_cache;
// Row
- int row_min_heigh;
- int row_border;
- int row_before_group_space;
+ int row_min_heigh;
+ int row_border;
+ int row_before_group_space;
BOOL row_variable_height;
BOOL row_align_left_items_to_left;
BOOL row_align_right_items_to_right;
- int row_items[NUM_ITEM_TYPE];
+ int row_items[NUM_ITEM_TYPE];
BOOL row_hide_group_icon;
BYTE row_align_group_mode;
@@ -282,13 +279,13 @@ struct ClcData : public ClcDataBase COLORREF avatars_border_color;
BOOL avatars_round_corners;
BOOL avatars_use_custom_corner_size;
- int avatars_custom_corner_size;
+ int avatars_custom_corner_size;
BOOL avatars_ignore_size_for_row_height;
BOOL avatars_draw_overlay;
- int avatars_overlay_type;
+ int avatars_overlay_type;
- int avatars_maxheight_size;
- int avatars_maxwidth_size;
+ int avatars_maxheight_size;
+ int avatars_maxwidth_size;
// Icon
BOOL icon_hide_on_avatar;
@@ -304,7 +301,7 @@ struct ClcData : public ClcDataBase BOOL text_align_right;
BOOL text_replace_smileys;
BOOL text_resize_smileys;
- int text_smiley_height;
+ int text_smiley_height;
BOOL text_use_protocol_smileys;
BOOL text_ignore_size_for_row_height;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 2440bbec89..23066ac3d4 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -114,8 +114,6 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, if (!cont)
return;
- pcli->pfnInvalidateDisplayNameCacheEntry(hContact);
-
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hContact);
char *szProto = cacheEntry->m_pszProto;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 4c74ef50f0..a2e9ff2165 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -2289,8 +2289,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT // Get contact time
TCHAR buf[70] = _T("");
TimeZone_PrintDateTime(pdnce->hTimeZone, _T("t"), buf, _countof(buf), 0);
- mir_free(pdnce->szSecondLineText);
- pdnce->szSecondLineText = mir_tstrdup(buf);
+ replaceStrT(pdnce->szSecondLineText, buf);
}
if (pdnce->szSecondLineText && pdnce->szSecondLineText[0] && free_height > dat->secondLine.top_space) {
@@ -2323,8 +2322,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT // Get contact time
TCHAR buf[70] = _T("");
TimeZone_PrintDateTime(pdnce->hTimeZone, _T("t"), buf, _countof(buf), 0);
- mir_free(pdnce->szThirdLineText);
- pdnce->szThirdLineText = mir_tstrdup(buf);
+ replaceStrT(pdnce->szThirdLineText, buf);
}
if (pdnce->szThirdLineText != NULL && pdnce->szThirdLineText[0] && free_height > dat->thirdLine.top_space) {
ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL);
|