From 68da593f577e94245cbb8bd52da9c56c77940e03 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 Mar 2013 14:50:03 +0000 Subject: no need to encode a string just to decode it later git-svn-id: http://svn.miranda-ng.org/main/trunk@4112 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clui.cpp | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'plugins/Clist_modern') diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 21dddd2a97..cc0b85635c 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -924,35 +924,15 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) return 8; } -static HICON CLUI_ExtractIconFromPath(const TCHAR *path) -{ - TCHAR file[MAX_PATH], fileFull[MAX_PATH]; - lstrcpyn(file, path, SIZEOF(file)); - TCHAR *comma = _tcsrchr(file, ','); - int n; - if (comma == NULL) - n = 0; - else - n = _ttoi(comma+1), *comma = 0; - PathToAbsoluteT(file, fileFull); - - HICON hIcon = NULL; - ExtractIconEx(fileFull, n, NULL, &hIcon, 1); - return hIcon; -} - static HICON CLUI_LoadIconFromExternalFile(TCHAR *filename, int i) { TCHAR szPath[MAX_PATH], szFullPath[MAX_PATH]; - GetModuleFileName( GetModuleHandle(NULL), szPath, SIZEOF(szPath)); - TCHAR *str = _tcsrchr(szPath,'\\'); - if (str != NULL) - *str = 0; - mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\Icons\\%s,%d"), szPath, filename, i); - if (str != NULL) - *str = '\\'; - - return CLUI_ExtractIconFromPath(szFullPath); + mir_sntprintf(szPath, SIZEOF(szPath), _T("Icons\\%s"), filename); + PathToAbsoluteT(szPath, szFullPath); + + HICON hIcon = NULL; + ExtractIconEx(szFullPath, i, NULL, &hIcon, 1); + return hIcon; } static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) -- cgit v1.2.3