diff options
author | slotwin <slotwin@users.noreply.github.com> | 2015-05-25 10:48:37 +0000 |
---|---|---|
committer | slotwin <slotwin@users.noreply.github.com> | 2015-05-25 10:48:37 +0000 |
commit | 0bab5b8df845b10cb0012be9baab1fe24e012c04 (patch) | |
tree | e97f9e3214999284e3bdc72dd862c5aee801c4c5 /plugins/AVS | |
parent | 53bf91d28b743808fad6b2afd2c8820d4dfa79eb (diff) |
AVS:
partly reverts r13335 - clear() is not a full clear, fixes options glitch in #932
minor fix and cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@13830 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AVS')
-rw-r--r-- | plugins/AVS/src/options.cpp | 18 | ||||
-rw-r--r-- | plugins/AVS/src/utils.cpp | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index a0c3d1a6b3..4506c4011f 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -48,11 +48,11 @@ struct WindowData static void RemoveProtoPic(const char *szProto) { - db_unset(NULL, PPICT_MODULE, szProto); - if (szProto == NULL) return; + db_unset(NULL, PPICT_MODULE, szProto); + if (!mir_strcmp(AVS_DEFAULT, szProto)) { for (int i = 0; i < g_ProtoPictures.getCount(); i++) { protoPicCacheEntry &p = g_ProtoPictures[i]; @@ -60,7 +60,7 @@ static void RemoveProtoPic(const char *szProto) continue; p.clear(); - CreateAvatarInCache(0, &p, (char*)p.szProtoname); + CreateAvatarInCache(0, &p, (char *)p.szProtoname); NotifyEventHooks(hEventChanged, 0, (LPARAM)&p); } return; @@ -71,7 +71,7 @@ static void RemoveProtoPic(const char *szProto) mir_strncpy(szProtoname, szProto, mir_strlen(szProto) - mir_strlen("accounts")); mir_strcpy(szProtoname, strrchr(szProtoname, ' ') + 1); for (int i = 0; i < g_ProtoPictures.getCount(); i++) { - protoPicCacheEntry& p = g_ProtoPictures[i]; + protoPicCacheEntry &p = g_ProtoPictures[i]; if (p.szProtoname == NULL) continue; @@ -81,7 +81,7 @@ static void RemoveProtoPic(const char *szProto) if (!mir_strcmp(p.szProtoname, szProto) || !mir_strcmp(pdescr->szProtoName, szProtoname)) { p.clear(); - CreateAvatarInCache(0, &p, (char*)p.szProtoname); + CreateAvatarInCache(0, &p, (char *)p.szProtoname); NotifyEventHooks(hEventChanged, 0, (LPARAM)&p); } } @@ -89,7 +89,7 @@ static void RemoveProtoPic(const char *szProto) } for (int i = 0; i < g_ProtoPictures.getCount(); i++) { - protoPicCacheEntry& p = g_ProtoPictures[i]; + protoPicCacheEntry &p = g_ProtoPictures[i]; if (!mir_strcmp(p.szProtoname, szProto)) { p.clear(); NotifyEventHooks(hEventChanged, 0, (LPARAM)&p); @@ -283,7 +283,7 @@ static char* GetProtoFromList(HWND hwndDlg, int iItem) if (!ListView_GetItem(GetDlgItem(hwndDlg, IDC_PROTOCOLS), &item)) return NULL; - protoPicCacheEntry *pce = (protoPicCacheEntry*)item.lParam; + protoPicCacheEntry *pce = (protoPicCacheEntry *)item.lParam; return (pce == NULL) ? NULL : pce->szProtoname; } @@ -314,7 +314,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar int newItem = ListView_InsertItem(hwndList, &item); if (newItem >= 0) ListView_SetCheckState(hwndList, newItem, - db_get_b(NULL, AVS_MODULE, g_ProtoPictures[i].szProtoname, 1) ? TRUE : FALSE); + db_get_b(NULL, AVS_MODULE, g_ProtoPictures[i].szProtoname, 1) ? TRUE : FALSE); } ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE); ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP); @@ -329,7 +329,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_SETPROTOPIC: case IDC_REMOVEPROTOPIC: int iItem = ListView_GetSelectionMark(hwndList); - char* szProto = GetProtoFromList(hwndDlg, iItem); + char *szProto = GetProtoFromList(hwndDlg, iItem); if (szProto) { if (LOWORD(wParam) == IDC_SETPROTOPIC) SetProtoPic(szProto); diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 0b94ecb461..3014820b81 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -280,7 +280,7 @@ void protoPicCacheEntry::clear() if (hbmPic != 0)
DeleteObject(hbmPic);
- memset(this, 0, sizeof(protoPicCacheEntry));
+ memset(this, 0, sizeof(avatarCacheEntry));
}
///////////////////////////////////////////////////////////////////////////////////////////////////
|