diff options
Diffstat (limited to 'src/modules/srfile')
-rw-r--r-- | src/modules/srfile/file.cpp | 6 | ||||
-rw-r--r-- | src/modules/srfile/fileexistsdlg.cpp | 12 | ||||
-rw-r--r-- | src/modules/srfile/fileopts.cpp | 8 | ||||
-rw-r--r-- | src/modules/srfile/filerecvdlg.cpp | 6 | ||||
-rw-r--r-- | src/modules/srfile/filesenddlg.cpp | 12 | ||||
-rw-r--r-- | src/modules/srfile/filexferdlg.cpp | 34 |
6 files changed, 39 insertions, 39 deletions
diff --git a/src/modules/srfile/file.cpp b/src/modules/srfile/file.cpp index b5172ae9c4..6073dd7a8a 100644 --- a/src/modules/srfile/file.cpp +++ b/src/modules/srfile/file.cpp @@ -267,12 +267,12 @@ static void RemoveUnreadFileEvents(void) dbei.cbSize=sizeof(dbei);
hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
- while(hContact) {
+ while (hContact) {
hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD,(WPARAM)hContact,0);
- while(hDbEvent) {
+ 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 1ba90b11c0..23bc8b0877 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 (pDesktopFolder->ParseDisplayName(NULL,NULL,wszFilename,NULL,&pCurrentIdl,NULL) == NOERROR) {
if (pCurrentIdl->mkid.cb) {
ITEMIDLIST *pidl,*pidlNext,*pidlFilename;
IShellFolder *pFileFolder;
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};
@@ -231,7 +231,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM pfnIconWindowProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_EXISTINGICON),GWLP_WNDPROC,(LONG_PTR)IconCtrlSubclassProc);
hwndFocus=GetDlgItem(hwndDlg,IDC_RESUME);
- if ( _tstati64(fts->tszCurrentFile,&statbuf)==0) {
+ if ( _tstati64(fts->tszCurrentFile,&statbuf) == 0) {
SetControlToUnixTime(hwndDlg,IDC_EXISTINGDATE,statbuf.st_mtime);
GetSensiblyFormattedSize(statbuf.st_size,szSize,SIZEOF(szSize),0,1,NULL);
SetDlgItemText(hwndDlg,IDC_EXISTINGSIZE,szSize);
diff --git a/src/modules/srfile/fileopts.cpp b/src/modules/srfile/fileopts.cpp index c1c0b23870..ca22961ece 100644 --- a/src/modules/srfile/fileopts.cpp +++ b/src/modules/srfile/fileopts.cpp @@ -98,7 +98,7 @@ 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);
}
@@ -140,7 +140,7 @@ 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];
@@ -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];
diff --git a/src/modules/srfile/filerecvdlg.cpp b/src/modules/srfile/filerecvdlg.cpp index 1e399a83d7..4de076e0fe 100644 --- a/src/modules/srfile/filerecvdlg.cpp +++ b/src/modules/srfile/filerecvdlg.cpp @@ -37,9 +37,9 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir,TCHAR *szExistingDir TCHAR *pszLastBackslash;
lstrcpyn(szExistingDir,szTestDir,cchExistingDir);
- while((dwAttributes=GetFileAttributes(szExistingDir))!=INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
+ 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);
@@ -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);
diff --git a/src/modules/srfile/filesenddlg.cpp b/src/modules/srfile/filesenddlg.cpp index de07d65689..8567003f91 100644 --- a/src/modules/srfile/filesenddlg.cpp +++ b/src/modules/srfile/filesenddlg.cpp @@ -45,7 +45,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg,struct FileDlgData *dat) if (i>1) {
TCHAR szFormat[32];
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(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) {
@@ -102,7 +102,7 @@ static void FilenameToFileList(HWND hwndDlg, struct FileDlgData* dat, const TCHA // Fill the array
pBuf = buf + fileOffset;
nTemp = 0;
- while(*pBuf)
+ while (*pBuf)
{
// Allocate space for path+filename
int cbFileNameLen = lstrlen( pBuf );
@@ -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,7 +223,7 @@ 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++);
dat->files = ( TCHAR** )mir_alloc( sizeof(TCHAR*)*(totalCount+1)); // Leaks
@@ -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);
diff --git a/src/modules/srfile/filexferdlg.cpp b/src/modules/srfile/filexferdlg.cpp index cedc49638f..7c7adf8281 100644 --- a/src/modules/srfile/filexferdlg.cpp +++ b/src/modules/srfile/filexferdlg.cpp @@ -31,8 +31,8 @@ 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;
- 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);
+ 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);
}
#define M_VIRUSSCANDONE (WM_USER+100)
@@ -141,7 +141,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) }
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 (WaitForSingleObject(pi.hProcess,3600*1000) == WAIT_OBJECT_0)
PostMessage(info->hwndReply,M_VIRUSSCANDONE,info->returnCode,0);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
@@ -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);
@@ -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 ((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++) {
_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;
}
}
@@ -532,9 +532,9 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
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->hProcess != dat->fs) break; /* icq abuses this sometimes */
+ if (ack->hContact != dat->hContact) break;
+ if (ack->type != ACKTYPE_FILE) break;
if (dat->waitingForAcceptance) {
SetTimer(hwndDlg,1,1000,NULL);
@@ -550,9 +550,9 @@ 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 (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 {
@@ -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)¶m);
@@ -689,11 +689,11 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR FTS_OPEN);
int useScanner=DBGetContactSettingByte(NULL,"SRFile","UseScanner",VIRUSSCAN_DISABLE);
- if (useScanner!=VIRUSSCAN_DISABLE) {
+ if (useScanner != VIRUSSCAN_DISABLE) {
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);
@@ -724,7 +724,7 @@ 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) {
+ if ((int)wParam == -1) {
for (i=0;i<dat->transferStatus.totalFiles;i++) dat->fileVirusScanned[i]=1;
}
else {
|