diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-19 14:50:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-19 14:50:03 +0000 |
commit | 68da593f577e94245cbb8bd52da9c56c77940e03 (patch) | |
tree | 53c1cfa0c767446d57fd60849572d5fdcfbdc26f /plugins/Clist_modern | |
parent | 72ac346981e6bc01d9d971067a231852bddd8c81 (diff) |
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
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
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)
|