From a63e68f4047e60f85597ce052c23563228c1af78 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 28 Dec 2018 13:29:27 +0300 Subject: related to #1679 - fix for protocol names --- plugins/IEView/src/Options.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/IEView/src') diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index eb62d1db80..874438be12 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -312,18 +312,18 @@ static void RefreshProtoList(HWND hwndDlg, int mode, bool protoTemplates) TreeView_SetImageList(hProtoList, hProtocolImageList, TVSIL_NORMAL); for (auto &it : arTemp) { - char protoName[128]; TVINSERTSTRUCT tvi = {}; tvi.hParent = TVI_ROOT; tvi.hInsertAfter = TVI_LAST; tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_STATE | TVIF_SELECTEDIMAGE; tvi.item.stateMask = TVIS_SELECTED | TVIS_STATEIMAGEMASK; if (it->getProtocolName() == nullptr) - strncpy_s(protoName, Translate("Default"), _TRUNCATE); - else - CallProtoService(it->getProtocolName(), PS_GETNAME, sizeof(protoName), (LPARAM)protoName); + tvi.item.pszText = TranslateT("Default"); + else { + PROTOACCOUNT *pa = Proto_GetAccount(it->getProtocolName()); + tvi.item.pszText = (pa == nullptr) ? L"" : pa->tszAccountName; + } - tvi.item.pszText = mir_a2u(protoName); tvi.item.lParam = (LPARAM)it; tvi.item.iImage = tvi.item.iSelectedImage = arTemp.indexOf(&it); switch (mode) { -- cgit v1.2.3