From 794fa3fb5cc63ac9b69908bd04f4be985a4a8cd1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 10 Aug 2013 13:28:49 +0000 Subject: - unused services MS_FP_SAMECLIENTS & MS_FP_GETCLIENTICON removed; - Finger_IsSameClents & Finger_GetClientIcon helpers added; - unused code removed from FingerPrint or replaced with the calls from mir_core.dll git-svn-id: http://svn.miranda-ng.org/main/trunk@5632 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../ClientChangeNotify/src/ClientChangeNotify.cpp | 8 +-- .../ClientChangeNotify/src/CommonLibs/CString.h | 69 ---------------------- plugins/ClientChangeNotify/src/Misc.h | 22 ------- 3 files changed, 4 insertions(+), 95 deletions(-) (limited to 'plugins/ClientChangeNotify') diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 00113d2b31..8a91324ae4 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -176,7 +176,7 @@ void ShowPopup(SHOWPOPUP_DATA *sd) POPUPDATAT ppd = {0}; ppd.lchContact = sd->hContact; char *szProto = GetContactProto(sd->hContact); - pdata->hIcon = ppd.lchIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)(const char*)TCHAR2ANSI(sd->MirVer), false); + pdata->hIcon = ppd.lchIcon = Finger_GetClientIcon(sd->MirVer, false); _ASSERT(ppd.lchIcon); if (!ppd.lchIcon || (DWORD)ppd.lchIcon == CALLSERVICE_NOTFOUND) { // if we didn't succeed retrieving client icon, show the usual status icon instead @@ -247,8 +247,8 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) sd.PopupOptPage = &PopupOptPage; if (!PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWVER)) { if (bFingerprintExists) { - LPCTSTR ptszOldClient = (LPCTSTR)CallService(MS_FP_SAMECLIENTST, (WPARAM)(TCHAR*)sd.OldMirVer, (LPARAM)(TCHAR*)sd.OldMirVer); // remove version from MirVer strings. I know, the way in which MS_FP_SAMECLIENTS is used here is pretty ugly, but at least it gives necessary results - LPCTSTR ptszClient = (LPCTSTR)CallService(MS_FP_SAMECLIENTST, (WPARAM)(TCHAR*)sd.MirVer, (LPARAM)(TCHAR*)sd.MirVer); + LPCTSTR ptszOldClient = Finger_IsSameClents(sd.OldMirVer, sd.OldMirVer); + LPCTSTR ptszClient = Finger_IsSameClents(sd.MirVer, sd.MirVer); if (ptszOldClient && ptszClient) { if (PerContactSetting != NOTIFY_ALMOST_ALWAYS && PerContactSetting != NOTIFY_ALWAYS && !PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) && !_tcscmp(ptszClient, ptszOldClient)) return 0; @@ -371,7 +371,7 @@ static int ModuleLoad(WPARAM wParam, LPARAM lParam) { bPopupExists = ServiceExists(MS_POPUP_ADDPOPUP); bMetaContactsExists = ServiceExists(MS_MC_GETPROTOCOLNAME) && ServiceExists(MS_MC_GETMETACONTACT); - bFingerprintExists = ServiceExists(MS_FP_SAMECLIENTS) && ServiceExists(MS_FP_GETCLIENTICON); + bFingerprintExists = ServiceExists(MS_FP_SAMECLIENTST) && ServiceExists(MS_FP_GETCLIENTICONT); bVariablesExists = ServiceExists(MS_VARS_FORMATSTRING); return 0; } diff --git a/plugins/ClientChangeNotify/src/CommonLibs/CString.h b/plugins/ClientChangeNotify/src/CommonLibs/CString.h index c9a4a9538e..fc81efed22 100644 --- a/plugins/ClientChangeNotify/src/CommonLibs/CString.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.h @@ -101,75 +101,6 @@ typedef TString TCString; typedef TString CString; typedef TString WCString; - -/*#define TCString TString -#define CString TString -#define WCString TString*/ - - -__inline CString TCHAR2ANSI(TCString Str) -{ - - if (Str == NULL) - { - return CString(); - } - CString AStr; - if (!WideCharToMultiByte(CP_ACP, 0, Str, -1, AStr.GetBuffer(Str.GetLen() + 1), Str.GetLen() + 1, NULL, NULL)) - { - AStr.ReleaseBuffer(0); - } else - { - AStr.ReleaseBuffer(Str.GetLen()); - } - return AStr; - -} - - -__inline TCString ANSI2TCHAR(CString Str) -{ - - if (Str == NULL) - { - return TCString(); - } - TCString TStr; - int Len = MultiByteToWideChar(CP_ACP, 0, Str, -1, NULL, 0); - if (!MultiByteToWideChar(CP_ACP, 0, Str, -1, TStr.GetBuffer(Len), Len)) - { - TStr.ReleaseBuffer(0); - } else - { - TStr.ReleaseBuffer(Len - 1); - } - return TStr; - -} - - -__inline WCString TCHAR2WCHAR(TCString Str) -{ - - return Str; - -} - - -__inline TCString WCHAR2TCHAR(WCString Str) -{ - - return Str; - -} - - - -#define WCHAR2ANSI TCHAR2ANSI -#define ANSI2WCHAR ANSI2TCHAR - - - #ifdef CHARARRAY_CONVERT __inline CHARARRAY WCHAR2ANSI_ARRAY(CHARARRAY &c) diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h index e64855bb5b..8f3d299073 100644 --- a/plugins/ClientChangeNotify/src/Misc.h +++ b/plugins/ClientChangeNotify/src/Misc.h @@ -38,27 +38,6 @@ __inline void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine = _T(""), bool IsError } } - -__inline TCString Path_ToRelative(TCString &Path) -{ - CString Str; - Str.GetBuffer(MAX_PATH); - PathToRelative(TCHAR2ANSI(Path), Str); - Str.ReleaseBuffer(); - return ANSI2TCHAR(Str); -} - - -__inline TCString Path_ToAbsolute(TCString &Path) -{ - CString Str; - Str.GetBuffer(MAX_PATH); - PathToAbsolute( TCHAR2ANSI(Path), Str); - Str.ReleaseBuffer(); - return ANSI2TCHAR(Str); -} - - __inline void ShowLog(TCString &LogFilePath) { int Result = (int)ShellExecute(NULL, _T("open"), LogFilePath, NULL, NULL, SW_SHOW); @@ -70,7 +49,6 @@ __inline void ShowLog(TCString &LogFilePath) } } - __inline void RecompileRegexps(TCString IgnoreSubstrings) { FreePcreCompileData(); -- cgit v1.2.3