From ddba4ede6b451d0cfcd0d32b5180fbd0689966bf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 08:04:30 +0000 Subject: - HANDLE hContact => HCONTACT - GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Msg_Export/src/FileViewer.cpp | 8 +++--- plugins/Msg_Export/src/FileViewer.h | 4 +-- plugins/Msg_Export/src/main.cpp | 4 +-- plugins/Msg_Export/src/options.cpp | 46 ++++++++++++----------------------- plugins/Msg_Export/src/utils.cpp | 23 +++++++++--------- plugins/Msg_Export/src/utils.h | 10 ++++---- 6 files changed, 41 insertions(+), 54 deletions(-) (limited to 'plugins/Msg_Export') diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index c993b3299e..4c42c78ba3 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -103,7 +103,7 @@ class CLHistoryDlg public: HWND hWnd; - HANDLE hContact; + HCONTACT hContact; tstring sPath; HWND hFindDlg; @@ -113,7 +113,7 @@ class CLHistoryDlg bool bFirstLoad; bool bUtf8File; - CLHistoryDlg( HANDLE hContact) : hContact( hContact ) + CLHistoryDlg( HCONTACT hContact) : hContact( hContact ) { hFindDlg = NULL; acFindStr[0] = 0; @@ -489,7 +489,7 @@ void UpdateFileViews( const TCHAR *pszFile ) // Developer : KN ///////////////////////////////////////////////////////////////////// -bool bOpenExternaly( HANDLE hContact ) +bool bOpenExternaly( HCONTACT hContact ) { tstring sPath = GetFilePathFromUser( hContact); @@ -1232,7 +1232,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, // Developer : KN ///////////////////////////////////////////////////////////////////// -bool bShowFileViewer(HANDLE hContact) +bool bShowFileViewer(HCONTACT hContact) { HWND hInternalWindow = WindowList_Find(hInternalWindowList,hContact); if(hInternalWindow) { diff --git a/plugins/Msg_Export/src/FileViewer.h b/plugins/Msg_Export/src/FileViewer.h index d76509e4de..fb060a2c50 100755 --- a/plugins/Msg_Export/src/FileViewer.h +++ b/plugins/Msg_Export/src/FileViewer.h @@ -24,8 +24,8 @@ void Uninitilize(); void UpdateFileViews( const TCHAR *pszFile); -bool bOpenExternaly( HANDLE hContact); -bool bShowFileViewer( HANDLE hContact); +bool bOpenExternaly( HCONTACT hContact); +bool bShowFileViewer( HCONTACT hContact); bool bUseInternalViewer( bool bNew); bool bUseInternalViewer(); diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp index 898eb2c5c6..1aafecbf02 100755 --- a/plugins/Msg_Export/src/main.cpp +++ b/plugins/Msg_Export/src/main.cpp @@ -62,10 +62,10 @@ static INT_PTR ShowExportHistory(WPARAM wParam, LPARAM /*lParam*/) { if (bUseInternalViewer()) { - bShowFileViewer((HANDLE)wParam); + bShowFileViewer((HCONTACT)wParam); return 0; } - bOpenExternaly((HANDLE)wParam); + bOpenExternaly((HCONTACT)wParam); return 0; } diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 4f6cd64214..30b37937d8 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -92,29 +92,15 @@ class CLDBEvent int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) { if (lParamSort == 1 ) - { - return _tcsicmp( NickFromHandle((HANDLE)lParam1), NickFromHandle((HANDLE)lParam2)); - } + return _tcsicmp( NickFromHandle((HCONTACT)lParam1), NickFromHandle((HCONTACT)lParam2)); if (lParamSort == 2 ) - { - return _DBGetString( (HANDLE)lParam1, "Protocol", "p", _T("")).compare( - _DBGetString( (HANDLE)lParam2, "Protocol", "p", _T("")) - ); - } + return _DBGetString((HCONTACT)lParam1, "Protocol", "p", _T("")).compare(_DBGetString((HCONTACT)lParam2, "Protocol", "p", _T(""))); + if (lParamSort == 3 ) { - DWORD dwUin1 = db_get_dw( - (HANDLE)lParam1, - _DBGetStringA( (HANDLE)lParam1, "Protocol", "p", "" ).c_str(), - "UIN", - 0); - DWORD dwUin2 = db_get_dw( - (HANDLE)lParam2, - _DBGetStringA( (HANDLE)lParam2, "Protocol", "p", "" ).c_str(), - "UIN", - 0); - + DWORD dwUin1 = db_get_dw((HCONTACT)lParam1, _DBGetStringA((HCONTACT)lParam1, "Protocol", "p", "" ).c_str(), "UIN", 0); + DWORD dwUin2 = db_get_dw((HCONTACT)lParam2, _DBGetStringA((HCONTACT)lParam2, "Protocol", "p", "" ).c_str(), "UIN", 0); if (dwUin1 == dwUin2 ) return 0; if (dwUin1 > dwUin2 ) @@ -235,7 +221,7 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) continue; } - HANDLE hContact = (HANDLE)sItem.lParam; + HCONTACT hContact = (HCONTACT)sItem.lParam; list< CLDBEvent > & rclCurList = AllEvents[ GetFilePathFromUser( hContact) ]; @@ -329,7 +315,7 @@ void SetToDefault( HWND hParent ) continue; tstring sFileName = szTemp; - ReplaceDefines( (HANDLE)sItem.lParam, sFileName); + ReplaceDefines((HCONTACT)sItem.lParam, sFileName); ReplaceTimeVariables( sFileName); sItem.mask = LVIF_TEXT; @@ -414,16 +400,16 @@ BOOL bApplyChanges( HWND hwndDlg ) if (ListView_GetItem( hMapUser, &sItem)) { - HANDLE hUser = (HANDLE)sItem.lParam; + HCONTACT hUser = (HCONTACT)sItem.lParam; if (_tcslen( szTemp) > 0 ) - db_set_ts( hUser, MODULE, "FileName", szTemp); + db_set_ts(hUser, MODULE, "FileName", szTemp); else - db_unset( hUser, MODULE, "FileName"); + db_unset(hUser, MODULE, "FileName"); if (sItem.iImage ) - db_unset( hUser, MODULE, "EnableLog"); // default is Enabled !! + db_unset(hUser, MODULE, "EnableLog"); // default is Enabled !! else - db_set_b( hUser, MODULE, "EnableLog",0); + db_set_b(hUser, MODULE, "EnableLog",0); } } UpdateFileToColWidth(); @@ -507,7 +493,7 @@ void AutoFindeFileNames(HWND hwndDlg) } int nShortestMatch = 0xFFFF; - HANDLE hStortest = 0; + HCONTACT hStortest = 0; int nStortestIndex = -1; for (int nSubCur = 0 ; nSubCur < nCount ; nSubCur++ ) { @@ -528,7 +514,7 @@ void AutoFindeFileNames(HWND hwndDlg) { nShortestMatch = (int)nLen; nStortestIndex = nSubCur; - hStortest = (HANDLE)sItem.lParam; + hStortest = (HCONTACT)sItem.lParam; } } } @@ -551,7 +537,7 @@ void AutoFindeFileNames(HWND hwndDlg) if (sFileName.empty()) { sFileName = szDefaultFile; - ReplaceDefines( hStortest, sFileName); + ReplaceDefines(hStortest, sFileName); ReplaceTimeVariables( sFileName); } @@ -692,7 +678,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar { tstring sTmp; LVITEM sItem = { 0 }; - HANDLE hContact = db_find_first(); + HCONTACT hContact = db_find_first(); for (int nUser = 0; /*hContact*/ ; nUser++ ) { sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 64fbf69bb9..c7b03b5e3b 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -255,7 +255,7 @@ void DisplayLastError(const TCHAR *pszError) // Developer : KN ///////////////////////////////////////////////////////////////////// -const TCHAR* NickFromHandle(HANDLE hContact) +const TCHAR* NickFromHandle(HCONTACT hContact) { const TCHAR *psz = (const TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); if (psz ) @@ -279,7 +279,7 @@ const TCHAR* NickFromHandle(HANDLE hContact) // Developer : KN ///////////////////////////////////////////////////////////////////// -tstring _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting, const TCHAR *pszError ) +tstring _DBGetStringW(HCONTACT hContact,const char *szModule,const char *szSetting, const TCHAR *pszError ) { tstring ret; DBVARIANT dbv = {0}; @@ -302,7 +302,7 @@ tstring _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting return ret; } -string _DBGetStringA(HANDLE hContact,const char *szModule,const char *szSetting, const char *pszError ) +string _DBGetStringA(HCONTACT hContact,const char *szModule,const char *szSetting, const char *pszError ) { string ret; DBVARIANT dbv = {0}; @@ -596,7 +596,7 @@ void ReplaceDBPath( tstring &sRet ) // Developer : KN ///////////////////////////////////////////////////////////////////// -tstring GetFilePathFromUser( HANDLE hContact ) +tstring GetFilePathFromUser( HCONTACT hContact ) { tstring sFilePath = sExportDir + _DBGetString( hContact, MODULE, "FileName", sDefaultFile.c_str()); @@ -707,7 +707,7 @@ tstring GetFilePathFromUser( HANDLE hContact ) // Developer : KN ///////////////////////////////////////////////////////////////////// -tstring FileNickFromHandle( HANDLE hContact) +tstring FileNickFromHandle( HCONTACT hContact) { tstring ret = NickFromHandle( hContact); string::size_type nCur = 0; @@ -754,7 +754,7 @@ void ReplaceAllNoColon( tstring &sSrc, const TCHAR *pszReplace, tstring &sNew) // Developer : KN ///////////////////////////////////////////////////////////////////// -void ReplaceDefines( HANDLE hContact, tstring & sTarget ) +void ReplaceDefines( HCONTACT hContact, tstring & sTarget ) { if (sTarget.find( _T("%nick%")) != string::npos ) { @@ -899,7 +899,7 @@ void UpdateFileToColWidth() { clFileTo1ColWidth.clear(); - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { tstring sNick = NickFromHandle( hContact); string::size_type &rnValue = clFileTo1ColWidth[ GetFilePathFromUser( hContact) ]; if (rnValue < sNick.size()) @@ -997,7 +997,7 @@ void DisplayErrorDialog( const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO // Developer : KN ///////////////////////////////////////////////////////////////////// -void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei ) +void ExportDBEventInfo(HCONTACT hContact, DBEVENTINFO &dbei ) { TCHAR szTemp[500]; tstring sFilePath = GetFilePathFromUser( hContact); @@ -1410,7 +1410,8 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei ) int nExportEvent(WPARAM wparam,LPARAM lparam) { - HANDLE hContact = (HANDLE)wparam, hDbEvent = (HANDLE)lparam; + HCONTACT hContact = (HCONTACT)wparam; + HANDLE hDbEvent = (HANDLE)lparam; if ( !db_get_b(hContact,MODULE,"EnableLog",1)) return 0; @@ -1582,7 +1583,7 @@ SuperBreak: int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/) { - HANDLE hContact = (HANDLE)wparam; + HCONTACT hContact = (HCONTACT)wparam; HWND hInternalWindow = WindowList_Find(hInternalWindowList,hContact); if(hInternalWindow) @@ -1594,7 +1595,7 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/) tstring sFilePath = GetFilePathFromUser( hContact); // Test if there is another user using this file - for(HANDLE hOtherContact = db_find_first();hOtherContact;hOtherContact = db_find_next(hOtherContact)) + for(HCONTACT hOtherContact = db_find_first();hOtherContact;hOtherContact = db_find_next(hOtherContact)) if (hContact != hOtherContact && sFilePath == GetFilePathFromUser( hOtherContact)) return 0; // we found another contact abort mission :-) diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h index ffb67d2ea0..023e32cce4 100755 --- a/plugins/Msg_Export/src/utils.h +++ b/plugins/Msg_Export/src/utils.h @@ -57,10 +57,10 @@ void ShowDebugInfo(); int nExportEvent(WPARAM wparam,LPARAM lparam); int nContactDeleted(WPARAM wparam,LPARAM lparam); -const TCHAR *NickFromHandle(HANDLE hContact); +const TCHAR *NickFromHandle(HCONTACT hContact); -tstring __inline _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting, const TCHAR *pszError); -string __inline _DBGetStringA(HANDLE hContact,const char *szModule,const char *szSetting, const char *pszError); +tstring __inline _DBGetStringW(HCONTACT hContact,const char *szModule,const char *szSetting, const TCHAR *pszError); +string __inline _DBGetStringA(HCONTACT hContact,const char *szModule,const char *szSetting, const char *pszError); void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew); void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew); @@ -68,9 +68,9 @@ void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew); void UpdateFileToColWidth(); bool bReadMirandaDirAndPath(); -tstring GetFilePathFromUser( HANDLE hContact); +tstring GetFilePathFromUser( HCONTACT hContact); -void ReplaceDefines( HANDLE hContact, tstring & sTarget); +void ReplaceDefines( HCONTACT hContact, tstring & sTarget); void ReplaceTimeVariables( tstring &sRet); bool bCreatePathToFile( tstring sFilePath); -- cgit v1.2.3