summaryrefslogtreecommitdiff
path: root/src/modules/srfile
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-30 13:33:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-30 13:33:28 +0000
commitb8a02a2b98e7b0e6a8a54cb140a873039d9c6d3d (patch)
tree8dd46393de0047d87492a37e4ab057f143153aa8 /src/modules/srfile
parentb0632a264c7ce0120af88e915a455c3167f1d5c5 (diff)
- 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
Diffstat (limited to 'src/modules/srfile')
-rw-r--r--src/modules/srfile/fileexistsdlg.cpp14
-rw-r--r--src/modules/srfile/filexferdlg.cpp9
2 files changed, 9 insertions, 14 deletions
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