summaryrefslogtreecommitdiff
path: root/src/modules/srfile
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/srfile')
-rw-r--r--src/modules/srfile/file.cpp24
-rw-r--r--src/modules/srfile/fileexistsdlg.cpp28
-rw-r--r--src/modules/srfile/fileopts.cpp22
-rw-r--r--src/modules/srfile/filerecvdlg.cpp38
-rw-r--r--src/modules/srfile/filesenddlg.cpp28
-rw-r--r--src/modules/srfile/filexferdlg.cpp66
-rw-r--r--src/modules/srfile/ftmanager.cpp2
7 files changed, 104 insertions, 104 deletions
diff --git a/src/modules/srfile/file.cpp b/src/modules/srfile/file.cpp
index bb0129dada..b5172ae9c4 100644
--- a/src/modules/srfile/file.cpp
+++ b/src/modules/srfile/file.cpp
@@ -145,14 +145,14 @@ int SRFile_GetRegValue(HKEY hKeyBase,const TCHAR *szSubKey,const TCHAR *szValue,
void GetSensiblyFormattedSize(__int64 size,TCHAR *szOut,int cchOut,int unitsOverride,int appendUnits,int *unitsUsed)
{
- if(!unitsOverride) {
- if(size<1000) unitsOverride=UNITS_BYTES;
- else if(size<100*1024) unitsOverride=UNITS_KBPOINT1;
- else if(size<1024*1024) unitsOverride=UNITS_KBPOINT0;
- else if(size<1024*1024*1024) unitsOverride=UNITS_MBPOINT2;
+ if (!unitsOverride) {
+ if (size<1000) unitsOverride=UNITS_BYTES;
+ else if (size<100*1024) unitsOverride=UNITS_KBPOINT1;
+ else if (size<1024*1024) unitsOverride=UNITS_KBPOINT0;
+ else if (size<1024*1024*1024) unitsOverride=UNITS_MBPOINT2;
else unitsOverride=UNITS_GBPOINT3;
}
- if(unitsUsed) *unitsUsed=unitsOverride;
+ if (unitsUsed) *unitsUsed=unitsOverride;
switch(unitsOverride) {
case UNITS_BYTES: mir_sntprintf(szOut,cchOut,_T("%u%s%s"),(int)size,appendUnits?_T(" "):_T(""),appendUnits?TranslateT("bytes"):_T("")); break;
case UNITS_KBPOINT1: mir_sntprintf(szOut,cchOut,_T("%.1lf%s"),size/1024.0,appendUnits?_T(" KB"):_T("")); break;
@@ -185,8 +185,8 @@ void FreeFilesMatrix(TCHAR ***files)
void FreeProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *fts)
{
mir_free(fts->tszCurrentFile);
- if(fts->ptszFiles) {
- for( int i=0;i<fts->totalFiles;i++) mir_free(fts->ptszFiles[i]);
+ if (fts->ptszFiles) {
+ for ( int i=0;i<fts->totalFiles;i++) mir_free(fts->ptszFiles[i]);
mir_free(fts->ptszFiles);
}
mir_free(fts->tszWorkingDir);
@@ -198,7 +198,7 @@ void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFE
if ( src->tszCurrentFile ) dest->tszCurrentFile = PFTS_StringToTchar(src->flags, src->tszCurrentFile);
if ( src->ptszFiles ) {
dest->ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*)*src->totalFiles);
- for( int i=0; i < src->totalFiles; i++ )
+ for ( int i=0; i < src->totalFiles; i++ )
dest->ptszFiles[i] = PFTS_StringToTchar(src->flags, src->ptszFiles[i] );
}
if ( src->tszWorkingDir ) dest->tszWorkingDir = PFTS_StringToTchar(src->flags, src->tszWorkingDir );
@@ -211,7 +211,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS
dest->hContact = src->hContact;
dest->flags = src->flags;
if ( dest->totalFiles != src->totalFiles ) {
- for( int i=0;i<dest->totalFiles;i++) mir_free(dest->ptszFiles[i]);
+ for ( int i=0;i<dest->totalFiles;i++) mir_free(dest->ptszFiles[i]);
mir_free(dest->ptszFiles);
dest->ptszFiles = NULL;
dest->totalFiles = src->totalFiles;
@@ -229,7 +229,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS
}
}
else if (dest->ptszFiles) {
- for( int i=0; i < dest->totalFiles; i++ )
+ for ( int i=0; i < dest->totalFiles; i++ )
mir_free(dest->ptszFiles[i]);
mir_free( dest->ptszFiles );
dest->ptszFiles = NULL;
@@ -272,7 +272,7 @@ static void RemoveUnreadFileEvents(void)
while(hDbEvent) {
dbei.cbBlob=0;
CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- if(!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_FILE)
+ if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_FILE)
CallService(MS_DB_EVENT_MARKREAD,(WPARAM)hContact,(LPARAM)hDbEvent);
hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
}
diff --git a/src/modules/srfile/fileexistsdlg.cpp b/src/modules/srfile/fileexistsdlg.cpp
index f5b28753dc..1ba90b11c0 100644
--- a/src/modules/srfile/fileexistsdlg.cpp
+++ b/src/modules/srfile/fileexistsdlg.cpp
@@ -52,7 +52,7 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime)
static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POINT *ptCursor)
{
IShellFolder *pDesktopFolder;
- if(SHGetDesktopFolder(&pDesktopFolder)==NOERROR) {
+ if (SHGetDesktopFolder(&pDesktopFolder)==NOERROR) {
ITEMIDLIST *pCurrentIdl;
#if defined( _UNICODE )
WCHAR* wszFilename = ( LPWSTR )szFilename;
@@ -60,14 +60,14 @@ static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POI
WCHAR wszFilename[MAX_PATH];
MultiByteToWideChar(CP_ACP,0,szFilename,-1,wszFilename,SIZEOF(wszFilename));
#endif
- if(pDesktopFolder->ParseDisplayName(NULL,NULL,wszFilename,NULL,&pCurrentIdl,NULL)==NOERROR) {
- if(pCurrentIdl->mkid.cb) {
+ if (pDesktopFolder->ParseDisplayName(NULL,NULL,wszFilename,NULL,&pCurrentIdl,NULL)==NOERROR) {
+ if (pCurrentIdl->mkid.cb) {
ITEMIDLIST *pidl,*pidlNext,*pidlFilename;
IShellFolder *pFileFolder;
- for(pidl=pCurrentIdl;;) {
+ for (pidl=pCurrentIdl;;) {
pidlNext=(ITEMIDLIST*)((PBYTE)pidl+pidl->mkid.cb);
- if(pidlNext->mkid.cb==0) {
+ if (pidlNext->mkid.cb==0) {
pidlFilename = (ITEMIDLIST*)CoTaskMemAlloc(pidl->mkid.cb+sizeof(pidl->mkid.cb));
CopyMemory(pidlFilename,pidl,pidl->mkid.cb+sizeof(pidl->mkid.cb));
pidl->mkid.cb=0;
@@ -75,9 +75,9 @@ static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POI
}
pidl=pidlNext;
}
- if(pDesktopFolder->BindToObject(pCurrentIdl,NULL,IID_IShellFolder,(void**)&pFileFolder)==NOERROR) {
+ if (pDesktopFolder->BindToObject(pCurrentIdl,NULL,IID_IShellFolder,(void**)&pFileFolder)==NOERROR) {
IContextMenu *pContextMenu;
- if(pFileFolder->GetUIObjectOf(NULL,1,(LPCITEMIDLIST*)&pidlFilename,IID_IContextMenu,NULL,(void**)&pContextMenu)==NOERROR) {
+ if (pFileFolder->GetUIObjectOf(NULL,1,(LPCITEMIDLIST*)&pidlFilename,IID_IContextMenu,NULL,(void**)&pContextMenu)==NOERROR) {
switch(cmd) {
case C_PROPERTIES:
{ CMINVOKECOMMANDINFO ici={0};
@@ -91,10 +91,10 @@ static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POI
case C_CONTEXTMENU:
{ HMENU hMenu;
hMenu=CreatePopupMenu();
- if(SUCCEEDED(pContextMenu->QueryContextMenu(hMenu,0,1000,65535,(GetKeyState(VK_SHIFT)&0x8000?CMF_EXTENDEDVERBS:0)|CMF_NORMAL))) {
+ if (SUCCEEDED(pContextMenu->QueryContextMenu(hMenu,0,1000,65535,(GetKeyState(VK_SHIFT)&0x8000?CMF_EXTENDEDVERBS:0)|CMF_NORMAL))) {
int cmd;
cmd=TrackPopupMenu(hMenu,TPM_RETURNCMD,ptCursor->x,ptCursor->y,0,hwnd,NULL);
- if(cmd) {
+ if (cmd) {
CMINVOKECOMMANDINFO ici={0};
ici.cbSize=sizeof(ici);
ici.hwnd=hwnd;
@@ -165,7 +165,7 @@ void __cdecl LoadIconsAndTypesThread(void* param)
szExtension[0]='\0';
}
CharUpper(szExtension);
- if ( fileInfo.szTypeName[0]=='\0' )
+ if ( fileInfo.szTypeName[0] == '\0' )
mir_sntprintf( fileInfo.szTypeName, SIZEOF(fileInfo.szTypeName), TranslateT("%s File"),szExtension);
SetDlgItemText(info->hwndDlg,IDC_EXISTINGTYPE,fileInfo.szTypeName);
SetDlgItemText(info->hwndDlg,IDC_NEWTYPE,fileInfo.szTypeName);
@@ -176,9 +176,9 @@ void __cdecl LoadIconsAndTypesThread(void* param)
}
else {
TCHAR szTypeName[MAX_PATH];
- if(SRFile_GetRegValue(HKEY_CLASSES_ROOT,pszExtension,NULL,szTypeName,SIZEOF(szTypeName))) {
+ if (SRFile_GetRegValue(HKEY_CLASSES_ROOT,pszExtension,NULL,szTypeName,SIZEOF(szTypeName))) {
lstrcat(szTypeName,_T("\\DefaultIcon"));
- if(SRFile_GetRegValue(HKEY_CLASSES_ROOT,szTypeName,NULL,szIconFile,SIZEOF(szIconFile))) {
+ if (SRFile_GetRegValue(HKEY_CLASSES_ROOT,szTypeName,NULL,szIconFile,SIZEOF(szIconFile))) {
if ( _tcsstr( szIconFile, _T("%1")))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"),_T("0"),szIconFile,SIZEOF(szIconFile));
else szIconFile[0]='\0';
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SetControlToUnixTime(hwndDlg,IDC_EXISTINGDATE,statbuf.st_mtime);
GetSensiblyFormattedSize(statbuf.st_size,szSize,SIZEOF(szSize),0,1,NULL);
SetDlgItemText(hwndDlg,IDC_EXISTINGSIZE,szSize);
- if(statbuf.st_size>(int)fts->currentFileSize) {
+ if (statbuf.st_size>(int)fts->currentFileSize) {
EnableWindow(GetDlgItem(hwndDlg,IDC_RESUME),FALSE);
hwndFocus=GetDlgItem(hwndDlg,IDC_OVERWRITE);
} }
@@ -307,7 +307,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ofn.lpstrFile = str;
ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
- if(!GetSaveFileName(&ofn))
+ if (!GetSaveFileName(&ofn))
return FALSE;
pfr.szFilename = mir_tstrdup(str);
diff --git a/src/modules/srfile/fileopts.cpp b/src/modules/srfile/fileopts.cpp
index 1449c4c38b..c1c0b23870 100644
--- a/src/modules/srfile/fileopts.cpp
+++ b/src/modules/srfile/fileopts.cpp
@@ -84,8 +84,8 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
{ TCHAR szScanExe[MAX_PATH];
int i,iItem;
- for( i=0; i < SIZEOF(virusScanners); i++ ) {
- if(SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[i].szExeRegPath,virusScanners[i].szExeRegValue,szScanExe,SIZEOF(szScanExe))) {
+ for ( i=0; i < SIZEOF(virusScanners); i++ ) {
+ if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[i].szExeRegPath,virusScanners[i].szExeRegValue,szScanExe,SIZEOF(szScanExe))) {
iItem=SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_ADDSTRING,0,(LPARAM)virusScanners[i].szProductName);
SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETITEMDATA,iItem,i);
}
@@ -98,12 +98,12 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
DBVARIANT dbv;
- if(DBGetContactSettingTString(NULL,"SRFile","ScanCmdLine",&dbv)==0) {
+ if (DBGetContactSettingTString(NULL,"SRFile","ScanCmdLine",&dbv)==0) {
SetDlgItemText(hwndDlg,IDC_SCANCMDLINE,dbv.ptszVal);
DBFreeVariant(&dbv);
}
else {
- if(SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETCOUNT,0,0)) {
+ if (SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETCOUNT,0,0)) {
SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETCURSEL,0,0);
PostMessage(hwndDlg,M_SCANCMDLINESELCHANGE,0,0);
}
@@ -130,9 +130,9 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
{ TCHAR str[512];
TCHAR szScanExe[MAX_PATH];
int iScanner=SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETCURSEL,0,0),0);
- if(iScanner >= SIZEOF(virusScanners) || iScanner<0) break;
+ if (iScanner >= SIZEOF(virusScanners) || iScanner<0) break;
str[0]='\0';
- if(SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[iScanner].szExeRegPath,virusScanners[iScanner].szExeRegValue,szScanExe,SIZEOF(szScanExe)))
+ if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[iScanner].szExeRegPath,virusScanners[iScanner].szExeRegValue,szScanExe,SIZEOF(szScanExe)))
mir_sntprintf(str, SIZEOF(str), virusScanners[iScanner].szCommandLine,szScanExe);
SetDlgItemText(hwndDlg,IDC_SCANCMDLINE,str);
break;
@@ -140,12 +140,12 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDC_FILEDIR:
- if((HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ if ((HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
break;
case IDC_FILEDIRBROWSE:
{ TCHAR str[MAX_PATH];
GetDlgItemText(hwndDlg,IDC_FILEDIR,str,SIZEOF(str));
- if(BrowseForFolder(hwndDlg,str))
+ if (BrowseForFolder(hwndDlg,str))
SetDlgItemText(hwndDlg,IDC_FILEDIR,str);
break;
}
@@ -156,8 +156,8 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendMessage(hwndDlg,M_UPDATEENABLING,0,0);
break;
case IDC_SCANCMDLINE:
- if(HIWORD(wParam)==CBN_SELCHANGE) PostMessage(hwndDlg,M_SCANCMDLINESELCHANGE,0,0);
- else if(HIWORD(wParam)!=CBN_EDITCHANGE) return 0;
+ if (HIWORD(wParam)==CBN_SELCHANGE) PostMessage(hwndDlg,M_SCANCMDLINESELCHANGE,0,0);
+ else if (HIWORD(wParam)!=CBN_EDITCHANGE) return 0;
break;
case IDC_SCANCMDLINEBROWSE:
{ TCHAR str[MAX_PATH+2];
@@ -182,7 +182,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
ofn.nMaxFile = SIZEOF(str)-2;
- if(str[0]=='"') {
+ if (str[0] == '"') {
TCHAR *pszQuote = _tcschr(str + 1, '"');
if (pszQuote) *pszQuote = 0;
MoveMemory(str, str + 1, _tcslen(str) * sizeof(TCHAR));
diff --git a/src/modules/srfile/filerecvdlg.cpp b/src/modules/srfile/filerecvdlg.cpp
index 83e6b0077e..1e399a83d7 100644
--- a/src/modules/srfile/filerecvdlg.cpp
+++ b/src/modules/srfile/filerecvdlg.cpp
@@ -39,10 +39,10 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir,TCHAR *szExistingDir
lstrcpyn(szExistingDir,szTestDir,cchExistingDir);
while((dwAttributes=GetFileAttributes(szExistingDir))!=INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
pszLastBackslash=_tcsrchr(szExistingDir,'\\');
- if(pszLastBackslash==NULL) {*szExistingDir='\0'; break;}
+ if (pszLastBackslash==NULL) {*szExistingDir='\0'; break;}
*pszLastBackslash='\0';
}
- if(szExistingDir[0]=='\0') GetCurrentDirectory(cchExistingDir,szExistingDir);
+ if (szExistingDir[0] == '\0') GetCurrentDirectory(cchExistingDir,szExistingDir);
}
static const TCHAR InvalidFilenameChars[] = _T("\\/:*?\"<>|");
@@ -50,8 +50,8 @@ void RemoveInvalidFilenameChars(TCHAR *tszString)
{
size_t i;
if (tszString) {
- for(i=_tcscspn(tszString,InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1,InvalidFilenameChars)+1)
- if(tszString[i] >= 0)
+ for (i=_tcscspn(tszString,InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1,InvalidFilenameChars)+1)
+ if (tszString[i] >= 0)
tszString[i] = _T('_');
}
}
@@ -61,8 +61,8 @@ void RemoveInvalidPathChars(TCHAR *tszString)
{
size_t i;
if (tszString) {
- for(i=_tcscspn(tszString,InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1,InvalidPathChars)+1)
- if(tszString[i] >= 0)
+ for (i=_tcscspn(tszString,InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1,InvalidPathChars)+1)
+ if (tszString[i] >= 0)
tszString[i] = _T('_');
}
}
@@ -95,7 +95,7 @@ int BrowseForFolder(HWND hwnd,TCHAR *szPath)
bi.lParam=(LPARAM)szPath;
pidlResult=SHBrowseForFolder(&bi);
- if(pidlResult) {
+ if (pidlResult) {
SHGetPathFromIDList(pidlResult,szPath);
lstrcat(szPath,_T("\\"));
CoTaskMemFree(pidlResult);
@@ -244,9 +244,9 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (shAutoComplete)
shAutoComplete(GetWindow(GetDlgItem(hwndDlg,IDC_FILEDIR),GW_CHILD),1);
- for(i=0;i<MAX_MRU_DIRS;i++) {
+ for (i=0;i<MAX_MRU_DIRS;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d",i);
- if(DBGetContactSettingTString(NULL,"SRFile",idstr,&dbv)) break;
+ if (DBGetContactSettingTString(NULL,"SRFile",idstr,&dbv)) break;
SendDlgItemMessage(hwndDlg,IDC_FILEDIR,CB_ADDSTRING,0,(LPARAM)dbv.ptszVal);
DBFreeVariant(&dbv);
}
@@ -306,18 +306,18 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
SetDlgItemText(hwndDlg, IDC_NAME, contactName);
} }
- if(DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) {
+ if (DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) {
RECT rcBtn1,rcBtn2,rcDateCtrl;
GetWindowRect(GetDlgItem(hwndDlg,IDC_ADD),&rcBtn1);
GetWindowRect(GetDlgItem(hwndDlg,IDC_USERMENU),&rcBtn2);
GetWindowRect(GetDlgItem(hwndDlg,IDC_DATE),&rcDateCtrl);
SetWindowPos(GetDlgItem(hwndDlg,IDC_DATE),0,0,0,rcDateCtrl.right-rcDateCtrl.left-(rcBtn2.left-rcBtn1.left),rcDateCtrl.bottom-rcDateCtrl.top,SWP_NOZORDER|SWP_NOMOVE);
}
- else if(DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0)) {
+ else if (DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0)) {
//don't check auto-min here to fix BUG#647620
PostMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(hwndDlg,IDOK));
}
- if(!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0))
+ if (!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD),SW_HIDE);
return TRUE;
}
@@ -327,7 +327,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_DRAWITEM:
{ LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
- if(dis->hwndItem==GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
+ if (dis->hwndItem==GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
@@ -352,7 +352,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
GetDlgItemText(hwndDlg,IDC_FILEDIR,szDirName,SIZEOF(szDirName));
GetLowestExistingDirName(szDirName,szExistingDirName,SIZEOF(szExistingDirName));
- if(BrowseForFolder(hwndDlg,szExistingDirName))
+ if (BrowseForFolder(hwndDlg,szExistingDirName))
SetDlgItemText(hwndDlg,IDC_FILEDIR,szExistingDirName);
}
break;
@@ -363,13 +363,13 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
GetDlgItemText(hwndDlg,IDC_FILEDIR,szRecvDir,SIZEOF(szRecvDir));
RemoveInvalidPathChars(szRecvDir);
GetContactReceivedFilesDir(NULL,szDefaultRecvDir,SIZEOF(szDefaultRecvDir),TRUE);
- if(_tcsnicmp(szRecvDir,szDefaultRecvDir,lstrlen(szDefaultRecvDir))) {
+ if (_tcsnicmp(szRecvDir,szDefaultRecvDir,lstrlen(szDefaultRecvDir))) {
char idstr[32];
int i;
DBVARIANT dbv;
- for(i=MAX_MRU_DIRS-2;i>=0;i--) {
+ for (i=MAX_MRU_DIRS-2;i>=0;i--) {
mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d",i);
- if(DBGetContactSettingTString(NULL,"SRFile",idstr,&dbv)) continue;
+ if (DBGetContactSettingTString(NULL,"SRFile",idstr,&dbv)) continue;
mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d",i+1);
DBWriteContactSettingTString(NULL,"SRFile",idstr,dbv.ptszVal);
DBFreeVariant(&dbv);
@@ -388,7 +388,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
dat->hwndTransfer = FtMgr_AddTransfer(dat);
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, 0);
//check for auto-minimize here to fix BUG#647620
- if(DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0) && DBGetContactSettingByte(NULL,"SRFile","AutoMin",0)) {
+ if (DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0) && DBGetContactSettingByte(NULL,"SRFile","AutoMin",0)) {
ShowWindow(hwndDlg,SW_HIDE);
ShowWindow(hwndDlg,SW_SHOWMINNOACTIVE);
}
@@ -408,7 +408,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
acs.handleType=HANDLE_CONTACT;
acs.szProto="";
CallService(MS_ADDCONTACT_SHOW,(WPARAM)hwndDlg,(LPARAM)&acs);
- if(!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0))
+ if (!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0))
ShowWindow(GetDlgItem(hwndDlg,IDC_ADD), SW_HIDE);
}
break;
diff --git a/src/modules/srfile/filesenddlg.cpp b/src/modules/srfile/filesenddlg.cpp
index ea29aa2b00..de07d65689 100644
--- a/src/modules/srfile/filesenddlg.cpp
+++ b/src/modules/srfile/filesenddlg.cpp
@@ -42,13 +42,13 @@ static void SetFileListAndSizeControls(HWND hwndDlg,struct FileDlgData *dat)
GetSensiblyFormattedSize(totalSize,str,SIZEOF(str),0,1,NULL);
SetDlgItemText(hwndDlg,IDC_TOTALSIZE,str);
- if(i>1) {
+ if (i>1) {
TCHAR szFormat[32];
- if(fileCount && dirCount) {
+ if (fileCount && dirCount) {
mir_sntprintf(szFormat,SIZEOF(szFormat),_T("%s, %s"),TranslateTS(fileCount==1?_T("%d file"):_T("%d files")),TranslateTS(dirCount==1?_T("%d directory"):_T("%d directories")));
mir_sntprintf(str,SIZEOF(str),szFormat,fileCount,dirCount);
}
- else if(fileCount) {
+ else if (fileCount) {
lstrcpy(szFormat,TranslateT("%d files"));
mir_sntprintf(str,SIZEOF(str),szFormat,fileCount);
}
@@ -112,11 +112,11 @@ static void FilenameToFileList(HWND hwndDlg, struct FileDlgData* dat, const TCHA
#if defined( _UNICODE )
CopyMemory(dat->files[nTemp], buf, (fileOffset-1)*sizeof( TCHAR ));
dat->files[nTemp][fileOffset-1] = '\\';
- _tcscpy(dat->files[nTemp] + fileOffset - (buf[fileOffset-2]=='\\'?1:0), pBuf);
+ _tcscpy(dat->files[nTemp] + fileOffset - (buf[fileOffset-2] == '\\'?1:0), pBuf);
#else
CopyMemory(dat->files[nTemp], buf, fileOffset-1 );
dat->files[nTemp][fileOffset-1] = '\\';
- strcpy(dat->files[nTemp] + fileOffset - (buf[fileOffset-2]=='\\'?1:0), pBuf);
+ strcpy(dat->files[nTemp] + fileOffset - (buf[fileOffset-2] == '\\'?1:0), pBuf);
#endif
// Move pointers to next file...
pBuf += cbFileNameLen + 1;
@@ -179,13 +179,13 @@ static LRESULT CALLBACK SendEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LP
{
switch(msg) {
case WM_CHAR:
- if(wParam=='\n' && GetKeyState(VK_CONTROL)&0x8000) {
+ if (wParam=='\n' && GetKeyState(VK_CONTROL)&0x8000) {
PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
return 0;
}
break;
case WM_SYSCHAR:
- if((wParam=='s' || wParam=='S') && GetKeyState(VK_MENU)&0x8000) {
+ if ((wParam=='s' || wParam=='S') && GetKeyState(VK_MENU)&0x8000) {
PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
return 0;
}
@@ -223,11 +223,11 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
- if(fsd->ppFiles!=NULL && fsd->ppFiles[0]!=NULL) {
+ if (fsd->ppFiles!=NULL && fsd->ppFiles[0]!=NULL) {
int totalCount,i;
- for(totalCount=0;fsd->ppFiles[totalCount];totalCount++);
+ for (totalCount=0;fsd->ppFiles[totalCount];totalCount++);
dat->files = ( TCHAR** )mir_alloc( sizeof(TCHAR*)*(totalCount+1)); // Leaks
- for(i=0;i<totalCount;i++)
+ for (i=0;i<totalCount;i++)
dat->files[i] = mir_tstrdup( fsd->ppFiles[i] );
dat->files[totalCount]=NULL;
SetFileListAndSizeControls(hwndDlg,dat);
@@ -281,7 +281,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
- if(dis->hwndItem==GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
+ if (dis->hwndItem==GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
@@ -294,17 +294,17 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
case M_FILECHOOSEDONE:
- if( lParam != 0 ) {
+ if ( lParam != 0 ) {
FilenameToFileList( hwndDlg, dat, ( TCHAR* )lParam );
mir_free(( TCHAR* )lParam );
dat->closeIfFileChooseCancelled = 0;
}
- else if(dat->closeIfFileChooseCancelled) DestroyWindow(hwndDlg);
+ else if (dat->closeIfFileChooseCancelled) DestroyWindow(hwndDlg);
EnableWindow(hwndDlg,TRUE);
break;
case WM_COMMAND:
- if(CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU),(LPARAM)dat->hContact))
+ if (CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU),(LPARAM)dat->hContact))
break;
switch (LOWORD(wParam))
{
diff --git a/src/modules/srfile/filexferdlg.cpp b/src/modules/srfile/filexferdlg.cpp
index c4a41e750f..fa72e91f10 100644
--- a/src/modules/srfile/filexferdlg.cpp
+++ b/src/modules/srfile/filexferdlg.cpp
@@ -28,10 +28,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static int CheckVirusScanned(HWND hwnd,struct FileDlgData *dat,int i)
{
- if(dat->send) return 1;
- if(dat->fileVirusScanned == NULL) return 0;
- if(dat->fileVirusScanned[i]) return 1;
- if(DBGetContactSettingByte(NULL,"SRFile","WarnBeforeOpening",1)==0) return 1;
+ if (dat->send) return 1;
+ if (dat->fileVirusScanned == NULL) return 0;
+ if (dat->fileVirusScanned[i]) return 1;
+ if (DBGetContactSettingByte(NULL,"SRFile","WarnBeforeOpening",1)==0) return 1;
return IDYES==MessageBox(hwnd,TranslateT("This file has not yet been scanned for viruses. Are you certain you want to open it?"),TranslateT("File Received"),MB_YESNO|MB_DEFBUTTON2);
}
@@ -127,7 +127,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
if (!DBGetContactSettingTString(NULL,"SRFile", "ScanCmdLine", &dbv))
{
- if(dbv.ptszVal[0])
+ if (dbv.ptszVal[0])
{
TCHAR *pszReplace;
si.cb=sizeof(si);
@@ -140,8 +140,8 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
mir_sntprintf(szCmdLine, SIZEOF(szCmdLine), _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace+2);
}
else lstrcpyn(szCmdLine, dbv.ptszVal, SIZEOF(szCmdLine));
- if(CreateProcess(NULL,szCmdLine,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi)) {
- if(WaitForSingleObject(pi.hProcess,3600*1000)==WAIT_OBJECT_0)
+ if (CreateProcess(NULL,szCmdLine,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi)) {
+ if (WaitForSingleObject(pi.hProcess,3600*1000)==WAIT_OBJECT_0)
PostMessage(info->hwndReply,M_VIRUSSCANDONE,info->returnCode,0);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
@@ -264,7 +264,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->hNotifyEvent=HookEventMessage(ME_PROTO_ACK,hwndDlg,HM_RECVEVENT);
dat->transferStatus.currentFileNumber = -1;
- if(dat->send) {
+ if (dat->send) {
dat->fs=(HANDLE)CallContactService(dat->hContact,PSS_FILET,(WPARAM)dat->szMsg,(LPARAM)dat->files);
SetFtStatus(hwndDlg, LPGENT("Request sent, waiting for acceptance..."), FTS_TEXT);
SetOpenFileButtonStyle(GetDlgItem(hwndDlg,IDC_OPENFILE),1);
@@ -277,7 +277,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
CreateDirectoryTreeT(dat->szSavePath);
dat->fs=(HANDLE)CallContactService(dat->hContact,PSS_FILEALLOWT,(WPARAM)dat->fs,(LPARAM)dat->szSavePath);
dat->transferStatus.tszWorkingDir = mir_tstrdup(dat->szSavePath);
- if(DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) dat->resumeBehaviour=FILERESUME_ASK;
+ if (DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) dat->resumeBehaviour=FILERESUME_ASK;
else dat->resumeBehaviour=DBGetContactSettingByte(NULL,"SRFile","IfExists",FILERESUME_ASK);
SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT);
}
@@ -320,7 +320,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetDlgItemText(hwndDlg, IDC_CONTACTNAME, cli.pfnGetContactDisplayName( dat->hContact, 0 ));
- if(!dat->waitingForAcceptance) SetTimer(hwndDlg,1,1000,NULL);
+ if (!dat->waitingForAcceptance) SetTimer(hwndDlg,1,1000,NULL);
return TRUE;
case WM_TIMER:
MoveMemory(dat->bytesRecvedHistory+1,dat->bytesRecvedHistory,sizeof(dat->bytesRecvedHistory)-sizeof(dat->bytesRecvedHistory[0]));
@@ -334,7 +334,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
FILETIME ft;
GetSensiblyFormattedSize((dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1])/dat->bytesRecvedHistorySize,szSpeed,SIZEOF(szSpeed),0,1,NULL);
- if(dat->bytesRecvedHistory[0]==dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1])
+ if (dat->bytesRecvedHistory[0]==dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1])
lstrcpy(szTime,_T("??:??:??"));
else {
li.QuadPart=BIGI(10000000)*(dat->transferStatus.currentFileSize-dat->transferStatus.currentFileProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]);
@@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
FileTimeToSystemTime(&ft,&st);
GetTimeFormat(LOCALE_USER_DEFAULT,TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER,&st,NULL,szTime,SIZEOF(szTime));
}
- if(dat->bytesRecvedHistory[0]!=dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]) {
+ if (dat->bytesRecvedHistory[0]!=dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]) {
li.QuadPart=BIGI(10000000)*(dat->transferStatus.totalBytes-dat->transferStatus.totalProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]);
ft.dwHighDateTime=li.HighPart; ft.dwLowDateTime=li.LowPart;
FileTimeToSystemTime(&ft,&st);
@@ -454,7 +454,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TCHAR *p = pszNewFileName;
for (size_t pszlen=0; pszlen < cbFileNameLen; pszlen++) {
*p++ = pszFilename[pszlen];
- if (pszFilename[pszlen]=='&')
+ if (pszFilename[pszlen] == '&')
*p++ = '&';
}
*p = '\0';
@@ -500,7 +500,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (dat->fs) CallContactService(dat->hContact,PSS_FILECANCEL,(WPARAM)dat->fs,0);
dat->fs=NULL;
mir_free(szOriginalFilename);
- if(pfr->szFilename) mir_free((char*)pfr->szFilename);
+ if (pfr->szFilename) mir_free((char*)pfr->szFilename);
mir_free(pfr);
return 0;
case FILERESUME_RESUMEALL:
@@ -512,13 +512,13 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
pfr->action=FILERESUME_RENAME;
{ TCHAR *pszExtension,*pszFilename;
int i;
- if((pszFilename = _tcsrchr(szOriginalFilename,'\\'))==NULL) pszFilename=szOriginalFilename;
- if((pszExtension = _tcsrchr(pszFilename+1,'.'))==NULL) pszExtension=pszFilename+lstrlen(pszFilename);
- if(pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
+ if ((pszFilename = _tcsrchr(szOriginalFilename,'\\'))==NULL) pszFilename=szOriginalFilename;
+ if ((pszExtension = _tcsrchr(pszFilename+1,'.'))==NULL) pszExtension=pszFilename+lstrlen(pszFilename);
+ if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*((pszExtension-szOriginalFilename)+21+lstrlen(pszExtension)));
- for(i=1;;i++) {
+ for (i=1;;i++) {
_stprintf((TCHAR*)pfr->szFilename,_T("%.*s (%u)%s"),pszExtension-szOriginalFilename,szOriginalFilename,i,pszExtension);
- if(_taccess(pfr->szFilename,0)!=0)
+ if (_taccess(pfr->szFilename,0)!=0)
break;
}
}
@@ -526,17 +526,17 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
mir_free(szOriginalFilename);
CallProtoService(szProto,PS_FILERESUMET,(WPARAM)dat->fs,(LPARAM)pfr);
- if(pfr->szFilename) mir_free((char*)pfr->szFilename);
+ if (pfr->szFilename) mir_free((char*)pfr->szFilename);
mir_free(pfr);
break;
}
case HM_RECVEVENT:
{ ACKDATA *ack=(ACKDATA*)lParam;
if (ack->hProcess!=dat->fs) break; /* icq abuses this sometimes */
- if(ack->hContact!=dat->hContact) break;
- if(ack->type!=ACKTYPE_FILE) break;
+ if (ack->hContact!=dat->hContact) break;
+ if (ack->type!=ACKTYPE_FILE) break;
- if(dat->waitingForAcceptance) {
+ if (dat->waitingForAcceptance) {
SetTimer(hwndDlg,1,1000,NULL);
dat->waitingForAcceptance=0;
}
@@ -550,10 +550,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case ACKRESULT_NEXTFILE:
SetFtStatus(hwndDlg, LPGENT("Moving to next file..."), FTS_TEXT);
SetDlgItemTextA(hwndDlg,IDC_FILENAME,"");
- if(dat->transferStatus.currentFileNumber==1 && dat->transferStatus.totalFiles>1 && !dat->send)
+ if (dat->transferStatus.currentFileNumber==1 && dat->transferStatus.totalFiles>1 && !dat->send)
SetOpenFileButtonStyle(GetDlgItem(hwndDlg,IDC_OPENFILE),1);
- if(dat->transferStatus.currentFileNumber!=-1 && dat->files && !dat->send && DBGetContactSettingByte(NULL,"SRFile","UseScanner",VIRUSSCAN_DISABLE)==VIRUSSCAN_DURINGDL) {
- if(GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY)
+ if (dat->transferStatus.currentFileNumber!=-1 && dat->files && !dat->send && DBGetContactSettingByte(NULL,"SRFile","UseScanner",VIRUSSCAN_DISABLE)==VIRUSSCAN_DURINGDL) {
+ if (GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY)
PostMessage(hwndDlg,M_VIRUSSCANDONE,dat->transferStatus.currentFileNumber,0);
else {
virusscanthreadstartinfo *vstsi;
@@ -576,7 +576,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
SetFtStatus(hwndDlg, LPGENT("File already exists"), FTS_TEXT);
- if(dat->resumeBehaviour==FILERESUME_ASK) {
+ if (dat->resumeBehaviour==FILERESUME_ASK) {
TDlgProcFileExistsParam param = { hwndDlg, fts };
ShowWindow(hwndDlg,SW_SHOWNORMAL);
CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_FILEEXISTS),hwndDlg,DlgProcFileExists,(LPARAM)&param);
@@ -693,7 +693,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
struct virusscanthreadstartinfo *vstsi;
vstsi=(struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo));
vstsi->hwndReply=hwndDlg;
- if(useScanner==VIRUSSCAN_DURINGDL) {
+ if (useScanner==VIRUSSCAN_DURINGDL) {
vstsi->returnCode=dat->transferStatus.currentFileNumber;
if ( GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY) {
PostMessage(hwndDlg,M_VIRUSSCANDONE,vstsi->returnCode,0);
@@ -707,7 +707,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
vstsi->returnCode = -1;
}
SetFtStatus(hwndDlg, LPGENT("Scanning for viruses..."), FTS_TEXT);
- if(vstsi) forkthread((void (*)(void*))RunVirusScannerThread,0,vstsi);
+ if (vstsi) forkthread((void (*)(void*))RunVirusScannerThread,0,vstsi);
} else {
dat->fs=NULL; /* protocol will free structure */
}
@@ -724,12 +724,12 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
} break; // case HM_RECVEVENT
case M_VIRUSSCANDONE:
{ int done=1,i;
- if((int)wParam==-1) {
- for(i=0;i<dat->transferStatus.totalFiles;i++) dat->fileVirusScanned[i]=1;
+ if ((int)wParam==-1) {
+ for (i=0;i<dat->transferStatus.totalFiles;i++) dat->fileVirusScanned[i]=1;
}
else {
dat->fileVirusScanned[wParam]=1;
- for(i=0;i<dat->transferStatus.totalFiles;i++) if(!dat->fileVirusScanned[i]) {done=0; break;}
+ for (i=0;i<dat->transferStatus.totalFiles;i++) if (!dat->fileVirusScanned[i]) {done=0; break;}
}
if (done)
{
@@ -772,7 +772,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
void FreeFileDlgData( FileDlgData* dat )
{
- if(dat->fs)
+ if (dat->fs)
CallContactService(dat->hContact,PSS_FILECANCEL,(WPARAM)dat->fs,0);
dat->fs = NULL;
diff --git a/src/modules/srfile/ftmanager.cpp b/src/modules/srfile/ftmanager.cpp
index b2c5dde516..4199c5b255 100644
--- a/src/modules/srfile/ftmanager.cpp
+++ b/src/modules/srfile/ftmanager.cpp
@@ -179,7 +179,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
if (i == dat->wnds->realCount)
PostMessage(GetParent(hwnd), WM_TIMER, 1, NULL);
- if(dat->runningCount == 0 && (int)wParam == ACKRESULT_SUCCESS && DBGetContactSettingByte(NULL,"SRFile","AutoClose",0))
+ if (dat->runningCount == 0 && (int)wParam == ACKRESULT_SUCCESS && DBGetContactSettingByte(NULL,"SRFile","AutoClose",0))
ShowWindow(hwndFtMgr, SW_HIDE);
break;
}