From b8a02a2b98e7b0e6a8a54cb140a873039d9c6d3d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Jun 2012 13:33:28 +0000 Subject: - setting thread names; - warning fixes; - code cleaning; - option to disable sounds during idle git-svn-id: http://svn.miranda-ng.org/main/trunk@692 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/srfile/fileexistsdlg.cpp | 14 ++++---------- src/modules/srfile/filexferdlg.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'src/modules/srfile') diff --git a/src/modules/srfile/fileexistsdlg.cpp b/src/modules/srfile/fileexistsdlg.cpp index 1975226b90..70ad5613b0 100644 --- a/src/modules/srfile/fileexistsdlg.cpp +++ b/src/modules/srfile/fileexistsdlg.cpp @@ -139,6 +139,7 @@ struct loadiconsstartinfo { HWND hwndDlg; TCHAR *szFilename; }; + void __cdecl LoadIconsAndTypesThread(void* param) { loadiconsstartinfo *info = (loadiconsstartinfo*)param; @@ -167,9 +168,8 @@ void __cdecl LoadIconsAndTypesThread(void* param) SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName); SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0); szIconFile[0]='\0'; - if ( !lstrcmp(szExtension, _T("EXE"))) { + if ( !lstrcmp(szExtension, _T("EXE"))) SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("2"), szIconFile, SIZEOF(szIconFile)); - } else { TCHAR szTypeName[MAX_PATH]; if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, SIZEOF(szTypeName))) { @@ -181,15 +181,9 @@ void __cdecl LoadIconsAndTypesThread(void* param) } } } if (szIconFile[0]) { - int iconIndex; - HICON hIcon; TCHAR *pszComma = _tcsrchr(szIconFile, ','); - if (pszComma == NULL) - iconIndex=0; - else { - iconIndex = _ttoi(pszComma+1); *pszComma='\0'; - } - hIcon = ExtractIcon(hInst, szIconFile, iconIndex); + int iconIndex = (pszComma == NULL) ? 0 :_ttoi(pszComma+1); *pszComma='\0'; + HICON hIcon = ExtractIcon(hInst, szIconFile, iconIndex); if (hIcon) fileInfo.hIcon = hIcon; } diff --git a/src/modules/srfile/filexferdlg.cpp b/src/modules/srfile/filexferdlg.cpp index 3dc4e27bd5..99eed2c3d9 100644 --- a/src/modules/srfile/filexferdlg.cpp +++ b/src/modules/srfile/filexferdlg.cpp @@ -684,10 +684,11 @@ 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); - } else { - dat->fs=NULL; /* protocol will free structure */ - } + if (vstsi) + forkthread((void (*)(void*))RunVirusScannerThread, 0, vstsi); + } + else dat->fs=NULL; /* protocol will free structure */ + dat->transferStatus.currentFileNumber=dat->transferStatus.totalFiles; } // else dat->send -- cgit v1.2.3