From 427891e0d28becb428ae8435954399f2e4daa9fe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 1 Mar 2013 22:52:26 +0000 Subject: service call replaced with helper: MS_UTILS_PATHTOABSOLUTEW git-svn-id: http://svn.miranda-ng.org/main/trunk@3827 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcopts.cpp | 19 ++++++++----------- plugins/Clist_modern/src/modern_clui.cpp | 9 +++++---- plugins/Clist_modern/src/modern_skinengine.cpp | 10 +++++----- plugins/Clist_modern/src/modern_skinopt.cpp | 19 +++++++++---------- 4 files changed, 27 insertions(+), 30 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 107a46958f..4dd2d44ec8 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -587,15 +587,14 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR); SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR, 0, db_get_dw(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR)); { - DBVARIANT dbv = {0}; - if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) { + DBVARIANT dbv; + if ( !DBGetContactSettingString(NULL, "StatusBar", "BkBitmap", &dbv)) { SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal); - if ( ServiceExists(MS_UTILS_PATHTOABSOLUTE)) { - char szPath[MAX_PATH]; - if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szPath)) - SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath); - } + char szPath[MAX_PATH]; + if ( PathToAbsolute(dbv.pszVal, szPath)) + SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath); + db_free(&dbv); } } @@ -1497,7 +1496,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, DBVARIANT dbv; if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv)) { - int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename); + int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename); if ( !retval || retval == CALLSERVICE_NOTFOUND) lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH); mir_free(dbv.pszVal); @@ -1670,9 +1669,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_b(NULL, module, "UseWinColours", (BYTE)dat->item[indx].useWinColours); char str[MAX_PATH]; - int retval = CallService(MS_UTILS_PATHTOABSOLUTE, - (WPARAM)dat->item[indx].filename, - (LPARAM)str); + int retval = PathToAbsolute(dat->item[indx].filename, str); if ( !retval || retval == CALLSERVICE_NOTFOUND) db_set_s(NULL, module, "BkBitmap", dat->item[indx].filename); else diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 3fd7ed5423..b8fb2365c3 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -894,8 +894,9 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) char szRelativePath[MAX_PATH]; GetModuleFileNameA(GetModuleHandle(NULL), szRelativePath, MAX_PATH); char *str = strrchr( szRelativePath, '\\' ); - if ( str != NULL ) *str = 0; - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)szRelativePath, (LPARAM)szFolderPath); + if (str != NULL) + *str = 0; + PathToAbsolute(szRelativePath, szFolderPath); } if ( szAccoName ) { @@ -934,7 +935,7 @@ static HICON CLUI_ExtractIconFromPath(const char *path, BOOL * needFree) comma = strrchr(file,','); if (comma == NULL) n = 0; else {n = atoi(comma+1); *comma = 0;} - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)file, (LPARAM)fileFull); + PathToAbsolute(file, fileFull); hIcon = NULL; ExtractIconExA(fileFull,n,NULL,&hIcon,1); if (needFree) @@ -1648,7 +1649,7 @@ HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDes sid.ptszDefaultFile = fileFull; if (tszDefaultFile) { - CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)tszDefaultFile, (LPARAM)fileFull); + PathToAbsoluteT(tszDefaultFile, fileFull); if ( !FileExists(fileFull)) fileFull[0] = _T('\0'); } diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index d86d025d4a..1deee93360 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -1778,13 +1778,13 @@ int ske_GetFullFilename(char * buf, char *file, char * skinfolder,BOOL madeAbsol _snprintf(b2, MAX_PATH,"%s\\%s",(skinfolder == NULL)?SkinPlace:((INT_PTR)skinfolder != -1)?skinfolder:"",file); else _snprintf(b2, MAX_PATH,"%s",file); - if (madeAbsolute) + if (madeAbsolute) { if (b2[0] == '\\' && b2[1] != '\\') - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(b2+1), (LPARAM)buf); + PathToAbsolute(b2+1, buf); else - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(b2), (LPARAM)buf); - else - memcpy(buf,b2,MAX_PATH); + PathToAbsolute(b2, buf); + } + else memcpy(buf,b2,MAX_PATH); mir_free(SkinPlace); return 0; diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 522446fd62..0d804d46bc 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -345,7 +345,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), sd->File ); IniParser::GetSkinFolder( sd->File, skinfolder ); _sntprintf( prfn, SIZEOF( prfn ), _T("%s\\%s"), skinfolder, imfn ); - CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)prfn, (LPARAM) imfn ); + PathToAbsoluteT(prfn, imfn); char * imfn_ch = mir_t2a( imfn ); hPreviewBitmap = ske_LoadGlyphImage( imfn_ch ); mir_free( imfn_ch ); @@ -477,8 +477,8 @@ HTREEITEM FillAvailableSkinList( HWND hwndDlg ) TCHAR *SkinsFolder = DBGetStringT( NULL, "ModernData", "SkinsFolder"); if ( !SkinsFolder ) SkinsFolder = mir_tstrdup( _T("Skins")); - CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)SkinsFolder, (LPARAM)path ); - mir_free_and_nil( SkinsFolder ); + PathToAbsoluteT(SkinsFolder, path); + mir_free_and_nil(SkinsFolder); AddSkinToList( hwndDlg, TranslateT("Default Skin"), _T("%Default Skin%")); attrib = GetFileAttributes( path ); @@ -488,10 +488,9 @@ HTREEITEM FillAvailableSkinList( HWND hwndDlg ) TCHAR * skinfile; TCHAR skinfull[MAX_PATH]; skinfile = DBGetStringT( NULL, SKIN, "SkinFile"); - if ( skinfile ) - { - CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)skinfile, (LPARAM)skinfull ); - res = AddSkinToListFullName( hwndDlg, skinfull ); + if ( skinfile ) { + PathToAbsoluteT(skinfile, skinfull); + res = AddSkinToListFullName(hwndDlg, skinfull); mir_free( skinfile ); } @@ -668,7 +667,7 @@ INT_PTR SvcActiveSkin(WPARAM wParam, LPARAM lParam) TCHAR skinfull[MAX_PATH]; skinfile = DBGetStringT( NULL, SKIN, "SkinFile"); if ( skinfile ) { - CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)skinfile, (LPARAM)skinfull ); + PathToAbsoluteT(skinfile, skinfull); mir_free(skinfile); return (INT_PTR)mir_tstrdup(skinfull); } @@ -722,8 +721,8 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), (LPCTSTR)lParam ); IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder ); _sntprintf( prfn, SIZEOF( prfn ), _T("%s\\%s"), skinfolder, imfn ); - CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)prfn, (LPARAM) imfn ); - char * imfn_ch = mir_t2a( imfn ); + PathToAbsoluteT(prfn, imfn); + char * imfn_ch = mir_t2a(imfn); hPreviewBitmap = ske_LoadGlyphImage( imfn_ch ); mir_free( imfn_ch ); -- cgit v1.2.3