Index: src/ch/AboutDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -58,11 +58,11 @@ return; // Readable version - pCtl->SetWindowText(GetApp()->GetAppNameVer()); + pCtl->SetWindowText(GetApp().GetAppNameVer()); // full version CString strText; - strText.Format(_T("%s: %ld.%ld.%ld.%ld"), GetResManager()->LoadString(IDS_ABOUTVERSION_STRING), + strText.Format(_T("%s: %ld.%ld.%ld.%ld"), GetResManager().LoadString(IDS_ABOUTVERSION_STRING), PRODUCT_VERSION1, PRODUCT_VERSION2, PRODUCT_VERSION3, PRODUCT_VERSION4); pCtl2->SetWindowText(strText); // Copyright information @@ -73,18 +73,15 @@ pctlContact->SetWindowText(_T(CONTACT_INFO) _T("|mailto:") _T(CONTACT_INFO)); // language information - ictranslate::CResourceManager* pResManager = GetResManager(); - if(pResManager) + ictranslate::CResourceManager& rResManager = GetResManager(); + const ictranslate::CLangData* pLangData = rResManager.GetLanguageData(); + if(pLangData) { - const ictranslate::CLangData* pLangData = pResManager->GetLanguageData(); - if(pLangData) - { - ictranslate::CFormat fmt(pResManager->LoadString(IDS_ABOUT_LANGUAGE_STRING)); - fmt.SetParam(_t("%langname"), pLangData->GetLangName()); - fmt.SetParam(_t("%authors"), pLangData->GetAuthor()); + ictranslate::CFormat fmt(rResManager.LoadString(IDS_ABOUT_LANGUAGE_STRING)); + fmt.SetParam(_t("%langname"), pLangData->GetLangName()); + fmt.SetParam(_t("%authors"), pLangData->GetAuthor()); - pctlLanguage->SetWindowText(fmt); - } + pctlLanguage->SetWindowText(fmt); } } Index: src/ch/AppHelper.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -151,56 +151,64 @@ if (_tcsnicmp(pszString, _T(""), 9) == 0) { // get windows path - _tcscpy(szStr, m_pszProgramPath ? m_pszProgramPath : _t("")); - _tcscat(szStr, pszString+9); + _tcsncpy(szStr, m_pszProgramPath ? m_pszProgramPath : _t(""), _MAX_PATH); + szStr[_MAX_PATH - 1] = _T('\0'); + _tcsncat(szStr, pszString+9, _MAX_PATH - _tcslen(szStr)); + szStr[_MAX_PATH - 1] = _T('\0'); } else if (_tcsnicmp(pszString, _T(""), 9) == 0) { // get windows path UINT uiSize=GetWindowsDirectory(szStr, _MAX_PATH); if (szStr[uiSize-1] == _T('\\')) szStr[uiSize-1]=_T('\0'); - _tcscat(szStr, pszString+9); + _tcsncat(szStr, pszString+9, _MAX_PATH - uiSize); + szStr[_MAX_PATH - 1] = _T('\0'); } else if (_tcsnicmp(pszString, _T(""), 6) == 0) // temp dir { // get windows path UINT uiSize=GetTempPath(_MAX_PATH, szStr); if (szStr[uiSize-1] == _T('\\')) szStr[uiSize-1]=_T('\0'); - _tcscat(szStr, pszString+6); + _tcsncat(szStr, pszString+6, _MAX_PATH - uiSize); + szStr[_MAX_PATH - 1] = _T('\0'); } else if (_tcsnicmp(pszString, _T(""), 8) == 0) // system { // get windows path UINT uiSize=GetSystemDirectory(szStr, _MAX_PATH); if (szStr[uiSize-1] == _T('\\')) szStr[uiSize-1]=_T('\0'); - _tcscat(szStr, pszString+8); + _tcsncat(szStr, pszString+8, _MAX_PATH - uiSize); + szStr[_MAX_PATH - 1] = _T('\0'); } else if (_tcsnicmp(pszString, _T(""), 9) == 0) // app data { // get windows path UINT uiSize=GetFolderLocation(CSIDL_LOCAL_APPDATA, szStr); if (szStr[uiSize-1] == _T('\\')) szStr[uiSize-1]=_T('\0'); - _tcscat(szStr, pszString+9); + _tcsncat(szStr, pszString+9, _MAX_PATH - uiSize); + szStr[_MAX_PATH - 1] = _T('\0'); } else if (_tcsnicmp(pszString, _T(""), 9) == 0) // desktop { // get windows path UINT uiSize=GetFolderLocation(CSIDL_DESKTOPDIRECTORY, szStr); if (szStr[uiSize-1] == _T('\\')) szStr[uiSize-1]=_T('\0'); - _tcscat(szStr, pszString+9); + _tcsncat(szStr, pszString+9, _MAX_PATH - uiSize); + szStr[_MAX_PATH - 1] = _T('\0'); } else if (_tcsnicmp(pszString, _T(""), 10) == 0) // personal... { // get windows path UINT uiSize=GetFolderLocation(CSIDL_PERSONAL, szStr); if (szStr[uiSize-1] == _T('\\')) szStr[uiSize-1]=_T('\0'); - _tcscat(szStr, pszString+10); + _tcsncat(szStr, pszString+10, _MAX_PATH - uiSize); + szStr[_MAX_PATH - 1] = _T('\0'); } // copy to src string Index: src/ch/BufferSizeDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/BufferSizeDlg.cpp (.../BufferSizeDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/BufferSizeDlg.cpp (.../BufferSizeDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -76,25 +76,25 @@ CLanguageDialog::OnInitDialog(); // set all the combos - m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); - m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); - m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); - m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); - m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); // fill edit controls and set multipliers SetDefaultSize(m_bsSizes.m_uiDefaultSize); @@ -143,37 +143,37 @@ // set all the combos int iSel=m_ctlDefaultMulti.GetCurSel(); m_ctlDefaultMulti.ResetContent(); - m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); m_ctlDefaultMulti.SetCurSel(iSel); iSel=m_ctlOneDiskMulti.GetCurSel(); m_ctlOneDiskMulti.ResetContent(); - m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); m_ctlOneDiskMulti.SetCurSel(iSel); iSel=m_ctlTwoDisksMulti.GetCurSel(); m_ctlTwoDisksMulti.ResetContent(); - m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); m_ctlTwoDisksMulti.SetCurSel(iSel); iSel=m_ctlCDROMMulti.GetCurSel(); m_ctlCDROMMulti.ResetContent(); - m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); m_ctlCDROMMulti.SetCurSel(iSel); iSel=m_ctlLANMulti.GetCurSel(); m_ctlLANMulti.ResetContent(); - m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); - m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); - m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager().LoadString(IDS_BYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager().LoadString(IDS_KBYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager().LoadString(IDS_MBYTE_STRING)); m_ctlLANMulti.SetCurSel(iSel); UpdateData(FALSE); Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -171,16 +171,16 @@ // m_strDest=m_ccData.m_strDestPath; //** // operation type - m_ctlOperation.AddString(GetResManager()->LoadString(IDS_CCDCOPY_STRING)); - m_ctlOperation.AddString(GetResManager()->LoadString(IDS_CCDMOVE_STRING)); + m_ctlOperation.AddString(GetResManager().LoadString(IDS_CCDCOPY_STRING)); + m_ctlOperation.AddString(GetResManager().LoadString(IDS_CCDMOVE_STRING)); // copying/moving m_ctlOperation.SetCurSel(m_ccData.m_iOperation); // fill priority combo for (int i=0;i<7;i++) { - m_ctlPriority.AddString(GetResManager()->LoadString(IDS_PRIORITY0_STRING+i)); + m_ctlPriority.AddString(GetResManager().LoadString(IDS_PRIORITY0_STRING+i)); } m_ctlPriority.SetCurSel(PriorityToIndex(m_ccData.m_iPriority)); @@ -202,42 +202,42 @@ // mask lvc.iSubItem=-1; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRMASK_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.15*rc.Width()); m_ctlFilters.InsertColumn(1, &lvc); // exclude mask lvc.iSubItem=0; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEMASK_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.15*rc.Width()); m_ctlFilters.InsertColumn(2, &lvc); // size lvc.iSubItem=1; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRSIZE_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRSIZE_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.3*rc.Width()); m_ctlFilters.InsertColumn(3, &lvc); // time lvc.iSubItem=2; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRDATE_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRDATE_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.3*rc.Width()); m_ctlFilters.InsertColumn(4, &lvc); // attributes lvc.iSubItem=3; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRATTRIB_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRATTRIB_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.1*rc.Width()); m_ctlFilters.InsertColumn(5, &lvc); // -attributes lvc.iSubItem=4; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEATTRIB_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEATTRIB_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.1*rc.Width()); m_ctlFilters.InsertColumn(6, &lvc); @@ -275,16 +275,16 @@ // operation int iPos=m_ctlOperation.GetCurSel(); m_ctlOperation.ResetContent(); - m_ctlOperation.AddString(GetResManager()->LoadString(IDS_CCDCOPY_STRING)); - m_ctlOperation.AddString(GetResManager()->LoadString(IDS_CCDMOVE_STRING)); + m_ctlOperation.AddString(GetResManager().LoadString(IDS_CCDCOPY_STRING)); + m_ctlOperation.AddString(GetResManager().LoadString(IDS_CCDMOVE_STRING)); m_ctlOperation.SetCurSel(iPos); // priority combo iPos=m_ctlPriority.GetCurSel(); m_ctlPriority.ResetContent(); for (int i=0;i<7;i++) { - m_ctlPriority.AddString(GetResManager()->LoadString(IDS_PRIORITY0_STRING+i)); + m_ctlPriority.AddString(GetResManager().LoadString(IDS_PRIORITY0_STRING+i)); } m_ctlPriority.SetCurSel(iPos); @@ -299,42 +299,42 @@ // mask lvc.iSubItem=-1; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRMASK_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.15*rc.Width()); m_ctlFilters.InsertColumn(1, &lvc); // exclude mask lvc.iSubItem=0; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEMASK_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.15*rc.Width()); m_ctlFilters.InsertColumn(2, &lvc); // size lvc.iSubItem=1; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRSIZE_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRSIZE_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.3*rc.Width()); m_ctlFilters.InsertColumn(3, &lvc); // time lvc.iSubItem=2; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRDATE_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRDATE_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.3*rc.Width()); m_ctlFilters.InsertColumn(4, &lvc); // attributes lvc.iSubItem=3; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRATTRIB_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRATTRIB_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.1*rc.Width()); m_ctlFilters.InsertColumn(5, &lvc); // -attributes lvc.iSubItem=4; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEATTRIB_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEATTRIB_STRING); lvc.cchTextMax=lstrlen(lvc.pszText); lvc.cx=static_cast(0.1*rc.Width()); m_ctlFilters.InsertColumn(6, &lvc); @@ -352,13 +352,13 @@ void CCustomCopyDlg::OnAddDirectoryButton() { CString strPath; - if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + if (BrowseForFolder(GetResManager().LoadString(IDS_BROWSE_STRING), &strPath)) AddPath(strPath); } void CCustomCopyDlg::OnAddFilesButton() { - CFileDialog dlg(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NODEREFERENCELINKS | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager()->LoadString(IDS_FILEDLGALLFILTER_STRING), this); + CFileDialog dlg(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NODEREFERENCELINKS | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FILEDLGALLFILTER_STRING), this); TCHAR *pszBuffer=new TCHAR[65535]; memset(pszBuffer, 0, 65535*sizeof(TCHAR)); @@ -411,7 +411,7 @@ void CCustomCopyDlg::OnBrowseButton() { CString strPath; - if (BrowseForFolder(GetResManager()->LoadString(IDS_DSTFOLDERBROWSE_STRING), &strPath)) + if (BrowseForFolder(GetResManager().LoadString(IDS_DSTFOLDERBROWSE_STRING), &strPath)) { SetComboPath(strPath); // m_strDest=strPath; //** @@ -470,25 +470,25 @@ TCHAR szSize[64]; ictranslate::CFormat fmt; - fmt.SetFormat(GetResManager()->LoadString(IDS_BSEDEFAULT_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_BSEDEFAULT_STRING)); fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiDefaultSize, szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); if (!m_ccData.m_bsSizes.m_bOnlyDefault) { - fmt.SetFormat(GetResManager()->LoadString(IDS_BSEONEDISK_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_BSEONEDISK_STRING)); fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiOneDiskSize, szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); - fmt.SetFormat(GetResManager()->LoadString(IDS_BSETWODISKS_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_BSETWODISKS_STRING)); fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiTwoDisksSize, szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); - fmt.SetFormat(GetResManager()->LoadString(IDS_BSECD_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_BSECD_STRING)); fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiCDSize, szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); - fmt.SetFormat(GetResManager()->LoadString(IDS_BSELAN_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_BSELAN_STRING)); fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiLANSize, szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); } @@ -575,7 +575,7 @@ _tcscpy(szLoaded, strData); } else - _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERMASKEMPTY_STRING)); + _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERMASKEMPTY_STRING)); lvi.pszText=szLoaded; lvi.cchTextMax=lstrlen(lvi.pszText); @@ -591,7 +591,7 @@ _tcscpy(szLoaded, strData); } else - _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERMASKEMPTY_STRING)); + _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERMASKEMPTY_STRING)); lvi.pszText=szLoaded; lvi.cchTextMax=lstrlen(lvi.pszText); @@ -602,18 +602,18 @@ if (rFilter.m_bUseSize) { - _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(rFilter.m_ullSize1, szData, 64, true)); + _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(rFilter.m_ullSize1, szData, 64, true)); szLoaded[1023] = _T('\0'); if (rFilter.m_bUseSize2) { - _tcscat(szLoaded, GetResManager()->LoadString(IDS_AND_STRING)); + _tcscat(szLoaded, GetResManager().LoadString(IDS_AND_STRING)); CString strLoaded2; - strLoaded2.Format(_T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType2), GetSizeString(rFilter.m_ullSize2, szData, 64, true)); + strLoaded2.Format(_T("%s %s"), GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iSizeType2), GetSizeString(rFilter.m_ullSize2, szData, 64, true)); _tcscat(szLoaded, strLoaded2); } } else - _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERSIZE_STRING)); + _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERSIZE_STRING)); lvi.pszText=szLoaded; lvi.cchTextMax=lstrlen(lvi.pszText); @@ -624,7 +624,7 @@ if (rFilter.m_bUseDate) { - _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_DATECREATED_STRING+rFilter.m_iDateType), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iDateType1)); + _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager().LoadString(IDS_DATECREATED_STRING+rFilter.m_iDateType), GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iDateType1)); szLoaded[1023] = _T('\0'); if (rFilter.m_bDate1) _tcscat(szLoaded, rFilter.m_tDate1.Format(_T(" %x"))); @@ -633,16 +633,16 @@ if (rFilter.m_bUseDate2) { - _tcscat(szLoaded, GetResManager()->LoadString(IDS_AND_STRING)); - _tcscat(szLoaded, GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iDateType2)); + _tcscat(szLoaded, GetResManager().LoadString(IDS_AND_STRING)); + _tcscat(szLoaded, GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iDateType2)); if (rFilter.m_bDate2) _tcscat(szLoaded, rFilter.m_tDate2.Format(_T(" %x"))); if (rFilter.m_bTime2) _tcscat(szLoaded, rFilter.m_tTime2.Format(_T(" %X"))); } } else - _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERDATE_STRING)); + _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERDATE_STRING)); lvi.pszText=szLoaded; lvi.cchTextMax=lstrlen(lvi.pszText); @@ -666,7 +666,7 @@ } if (!rFilter.m_bUseAttributes || szLoaded[0] == _T('\0')) - _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERATTRIB_STRING)); + _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERATTRIB_STRING)); lvi.pszText=szLoaded; lvi.cchTextMax=lstrlen(lvi.pszText); @@ -690,7 +690,7 @@ } if (!rFilter.m_bUseAttributes || szLoaded[0] == _T('0')) - _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERATTRIB_STRING)); + _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERATTRIB_STRING)); lvi.pszText=szLoaded; lvi.cchTextMax=lstrlen(lvi.pszText); @@ -886,7 +886,7 @@ void CCustomCopyDlg::OnImportButton() { - CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager()->LoadString(IDS_FLTALLFILTER_STRING)); + CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FLTALLFILTER_STRING)); if (dlg.DoModal() == IDOK) { UINT uiCount=0; @@ -913,7 +913,7 @@ } // report - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_IMPORTREPORT_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_IMPORTREPORT_STRING)); fmt.SetParam(_t("%count"), uiCount); AfxMessageBox(fmt); } Index: src/ch/Device IO.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/Device IO.h (.../Device IO.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/Device IO.h (.../Device IO.h) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -83,15 +83,17 @@ // only NT bool GetSignature(LPCTSTR lpszDrive, LPTSTR lpszBuffer, int iSize) { - TCHAR szMapping[1024], szQuery[16384], szSymbolic[1024]; - + std::auto_ptr szMapping(new TCHAR[1024]); + std::auto_ptr szQuery(new TCHAR[16384]); + std::auto_ptr szSymbolic(new TCHAR[1024]); + // read mappings - if (QueryDosDevice(lpszDrive, szMapping, 1024) == 0) + if (QueryDosDevice(lpszDrive, szMapping.get(), 1024) == 0) return false; // search for all, to find out in which string is the signature int iCount, iCount2; - if ((iCount=QueryDosDevice(NULL, szQuery, 16384)) == 0) + if ((iCount=QueryDosDevice(NULL, szQuery.get(), 16384)) == 0) { TRACE("Encountered error #%lu @QueryDosDevice\n", GetLastError()); return false; @@ -102,22 +104,22 @@ TCHAR* pszOffset = NULL; while(iOffset < iCount) { - if(_tcsncmp(szQuery+iOffset, _T("STORAGE#Volume#"), _tcslen(_T("STORAGE#Volume#"))) == 0) + if(_tcsncmp(szQuery.get() + iOffset, _T("STORAGE#Volume#"), _tcslen(_T("STORAGE#Volume#"))) == 0) { - if((iCount2 = QueryDosDevice(szQuery+iOffset, szSymbolic, 1024)) == 0) + if((iCount2 = QueryDosDevice(szQuery.get() + iOffset, szSymbolic.get(), 1024)) == 0) return false; // now search for 'Signature' and extract (from szQuery+iOffset) - pszSignature=_tcsstr(szQuery+iOffset, _T("Signature")); + pszSignature=_tcsstr(szQuery.get() + iOffset, _T("Signature")); if (pszSignature == NULL) { - iOffset+=_tcslen(szQuery+iOffset)+1; + iOffset+=_tcslen(szQuery.get() + iOffset)+1; continue; } pszOffset=_tcsstr(pszSignature, _T("Offset")); if (pszOffset == NULL) { - iOffset+=_tcslen(szQuery+iOffset)+1; + iOffset+=_tcslen(szQuery.get() + iOffset)+1; continue; } @@ -129,19 +131,19 @@ while (iOffset2 < iCount2) { // compare szSymbolic+iOffset2 with szMapping - if (_tcscmp(szMapping, szSymbolic+iOffset2) == 0) + if (_tcscmp(szMapping.get(), szSymbolic.get() + iOffset2) == 0) { // found Signature & Offset - copy int iCnt=reinterpret_cast(pszOffset)-reinterpret_cast(pszSignature)+1; _tcsncpy(lpszBuffer, pszSignature, (iCnt > iSize) ? iSize : iCnt); return true; } - iOffset2+=_tcslen(szSymbolic)+1; + iOffset2+=_tcslen(szSymbolic.get())+1; } } - iOffset+=_tcslen(szQuery+iOffset)+1; + iOffset+=_tcslen(szQuery.get() + iOffset)+1; } return false; Index: src/ch/FeedbackFileErrorDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/FeedbackFileErrorDlg.cpp (.../FeedbackFileErrorDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/FeedbackFileErrorDlg.cpp (.../FeedbackFileErrorDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -44,30 +44,26 @@ { CLanguageDialog::OnInitDialog(); - ictranslate::CResourceManager* pResManager = GetResManager(); - BOOST_ASSERT(pResManager); - if(pResManager) - { - CString strFmt; - strFmt = pResManager->LoadString(IDS_INFO_FILE_STRING); - strFmt += _T("\r\n"); - strFmt += pResManager->LoadString(IDS_INFO_REASON_STRING); + ictranslate::CResourceManager& rResManager = GetResManager(); + CString strFmt; + strFmt = rResManager.LoadString(IDS_INFO_FILE_STRING); + strFmt += _T("\r\n"); + strFmt += rResManager.LoadString(IDS_INFO_REASON_STRING); - // get system error string - TCHAR szSystem[1024]; - DWORD dwPos=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, m_ulSysError, 0, szSystem, 1023, NULL); - szSystem[1023] = _T('\0'); + // get system error string + TCHAR szSystem[1024]; + DWORD dwPos=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, m_ulSysError, 0, szSystem, 1023, NULL); + szSystem[1023] = _T('\0'); - // get rid of \r\n at the end of szSystem - while(--dwPos && (szSystem[dwPos] == 0x0a || szSystem[dwPos] == 0x0d)) - szSystem[dwPos]=_T('\0'); + // get rid of \r\n at the end of szSystem + while(--dwPos && (szSystem[dwPos] == 0x0a || szSystem[dwPos] == 0x0d)) + szSystem[dwPos]=_T('\0'); - ictranslate::CFormat fmt(strFmt); - fmt.SetParam(_t("%filename"), m_strPath); - fmt.SetParam(_t("%reason"), szSystem); + ictranslate::CFormat fmt(strFmt); + fmt.SetParam(_t("%filename"), m_strPath); + fmt.SetParam(_t("%reason"), szSystem); - m_ctlErrorInfo.SetWindowText(fmt); - } + m_ctlErrorInfo.SetWindowText(fmt); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE Index: src/ch/FeedbackNotEnoughSpaceDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -67,7 +67,7 @@ void CFeedbackNotEnoughSpaceDlg::UpdateDialog() { // format needed text - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_NERPATH_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_NERPATH_STRING)); fmt.SetParam(_t("%path"), m_strDisk); CWnd* pWnd=GetDlgItem(IDC_HEADER_STATIC); Index: src/ch/FeedbackReplaceDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -66,17 +66,14 @@ return; // load template - ictranslate::CResourceManager* pManager = GetResManager(); - BOOST_ASSERT(pManager); - if(!pManager) - return; + ictranslate::CResourceManager& rManager = GetResManager(); CString strTemplate; - strTemplate += pManager->LoadString(IDS_INFO_FILE_STRING); + strTemplate += rManager.LoadString(IDS_INFO_FILE_STRING); strTemplate += _T("\r\n"); - strTemplate += pManager->LoadString(IDS_INFO_SIZE_STRING); + strTemplate += rManager.LoadString(IDS_INFO_SIZE_STRING); strTemplate += _T("\r\n"); - strTemplate += pManager->LoadString(IDS_INFO_MODIFIED_STRING); + strTemplate += rManager.LoadString(IDS_INFO_MODIFIED_STRING); ictranslate::CFormat fmt(strTemplate); fmt.SetParam(_T("%filename"), m_pfiSrcFile->GetFullFilePath()); Index: src/ch/FileInfo.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -62,15 +62,15 @@ // set the dest path CString strCheckPath; - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_FIRSTCOPY_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_FIRSTCOPY_STRING)); fmt.SetParam(_t("%name"), strFolderName); strCheckPath = fmt; if (strCheckPath.GetLength() > _MAX_PATH) strCheckPath=strCheckPath.Left(_MAX_PATH); // max - 260 chars // when adding to strDstPath check if the path already exists - if so - try again int iCounter=1; - CString strFmt = GetResManager()->LoadString(IDS_NEXTCOPY_STRING); + CString strFmt = GetResManager().LoadString(IDS_NEXTCOPY_STRING); while (CFileInfo::Exist(strDstPath+strCheckPath)) { fmt.SetFormat(strFmt); @@ -83,22 +83,22 @@ } //////////////////////////////////////////////////////////////////////////// -CFileInfo::CFileInfo() +CFileInfo::CFileInfo() : + m_pClipboard(NULL) { } -CFileInfo::CFileInfo(const CFileInfo& finf) +CFileInfo::CFileInfo(const CFileInfo& finf) : + m_strFilePath(finf.m_strFilePath), + m_iSrcIndex(finf.m_iSrcIndex), + m_dwAttributes(finf.m_dwAttributes), + m_uhFileSize(finf.m_uhFileSize), + m_timCreation(finf.m_timCreation), + m_timLastAccess(finf.m_timLastAccess), + m_timLastWrite(finf.m_timLastWrite), + m_uiFlags(finf.m_uiFlags), + m_pClipboard(finf.m_pClipboard) { - m_strFilePath = finf.m_strFilePath; - m_iSrcIndex=finf.m_iSrcIndex; - m_dwAttributes = finf.m_dwAttributes; - m_uhFileSize = finf.m_uhFileSize; - m_timCreation = finf.m_timCreation; - m_timLastAccess = finf.m_timLastAccess; - m_timLastWrite = finf.m_timLastWrite; - m_uiFlags = finf.m_uiFlags; - - m_pClipboard=finf.m_pClipboard; } CFileInfo::~CFileInfo() @@ -169,7 +169,7 @@ } else { - m_strFilePath=GetResManager()->LoadString(IDS_NOTFOUND_STRING); + m_strFilePath=GetResManager().LoadString(IDS_NOTFOUND_STRING); m_iSrcIndex=-1; m_dwAttributes = (DWORD)-1; m_uhFileSize = (unsigned __int64)-1; @@ -391,7 +391,7 @@ // init CFileInfo CFileInfo finf; - finf.SetClipboard(m_pClipboard); // this is the link table (CClipboardArray) + finf.SetClipboard(&m_rClipboard); // this is the link table (CClipboardArray) // append '\\' at the end of path if needed if (strDirName.Right(1) != _T("\\")) Index: src/ch/FileInfo.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/FileInfo.h (.../FileInfo.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/FileInfo.h (.../FileInfo.h) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -192,7 +192,7 @@ uint_t m_uiFlags; // ptrs to elements providing data - CClipboardArray *m_pClipboard; + CClipboardArray* m_pClipboard; }; /** @@ -206,9 +206,13 @@ /** * @cmember Default constructor */ - CFileInfoArray() { m_pClipboard=NULL; SetSize(0, 5000); }; - void Init(CClipboardArray* pClipboard) { m_pClipboard=pClipboard; }; - + CFileInfoArray(CClipboardArray& A_rClipboardArray) : + m_rClipboard(A_rClipboardArray) + { + + SetSize(0, 5000); + } + /** * @cmember Adds a file or all contained in a directory to the CFileInfoArray * Only "static" data for CFileInfo is filled (by default CRC and checksum are NOT @@ -259,7 +263,7 @@ ar>>iSize; SetSize(iSize, 5000); CFileInfo fi; - fi.SetClipboard(m_pClipboard); + fi.SetClipboard(&m_rClipboard); uint_t uiFlags = 0; for (INT_PTR i=0;iLoadString(IDS_BYTE_STRING+i); + pszData=GetResManager().LoadString(IDS_BYTE_STRING+i); m_ctlSize1Multi.AddString(pszData); m_ctlSize2Multi.AddString(pszData); } // strings <, <=, ... for (int i=0;i<5;i++) { - pszData=GetResManager()->LoadString(IDS_LT_STRING+i); + pszData=GetResManager().LoadString(IDS_LT_STRING+i); m_ctlSizeType1.AddString(pszData); m_ctlSizeType2.AddString(pszData); m_ctlDateType1.AddString(pszData); @@ -130,7 +130,7 @@ for (int i=0;i<3;i++) { - m_ctlDateType.AddString(GetResManager()->LoadString(IDS_DATECREATED_STRING+i)); + m_ctlDateType.AddString(GetResManager().LoadString(IDS_DATECREATED_STRING+i)); } // copy data from CFileFilter to a dialog - mask @@ -206,7 +206,7 @@ const TCHAR *pszData; for (int i=0;i<3;i++) { - pszData=GetResManager()->LoadString(IDS_BYTE_STRING+i); + pszData=GetResManager().LoadString(IDS_BYTE_STRING+i); m_ctlSize1Multi.AddString(pszData); m_ctlSize2Multi.AddString(pszData); } @@ -228,7 +228,7 @@ // strings <, <=, ... for (int i=0;i<5;i++) { - pszData=GetResManager()->LoadString(IDS_LT_STRING+i); + pszData=GetResManager().LoadString(IDS_LT_STRING+i); m_ctlSizeType1.AddString(pszData); m_ctlSizeType2.AddString(pszData); m_ctlDateType1.AddString(pszData); @@ -244,7 +244,7 @@ m_ctlDateType.ResetContent(); for (int i=0;i<3;i++) { - m_ctlDateType.AddString(GetResManager()->LoadString(IDS_DATECREATED_STRING+i)); + m_ctlDateType.AddString(GetResManager().LoadString(IDS_DATECREATED_STRING+i)); } m_ctlDateType.SetCurSel(iPos[0]); } Index: src/ch/FolderDialog.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -327,25 +327,25 @@ { m_ilList.Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1); - HICON hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_LARGEICONS_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + HICON hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDI_LARGEICONS_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); m_ilList.Add(hIcon); - hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_SMALLICONS_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDI_SMALLICONS_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); m_ilList.Add(hIcon); - hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_LIST_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDI_LIST_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); m_ilList.Add(hIcon); - hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_REPORT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDI_REPORT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); m_ilList.Add(hIcon); - hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_NEWFOLDER_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDI_NEWFOLDER_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); m_ilList.Add(hIcon); - hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_ADDSHORTCUT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDI_ADDSHORTCUT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); m_ilList.Add(hIcon); - hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_DELETESHORTCUT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDI_DELETESHORTCUT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); m_ilList.Add(hIcon); } @@ -354,7 +354,7 @@ void CFolderDialog::ApplyExpandState(bool bExpand) { // change button text and hide/show needed elements - m_ctlToggle.SetWindowText(GetResManager()->LoadString(bExpand ? IDS_BDRIGHT_STRING : IDS_BDLEFT_STRING)); + m_ctlToggle.SetWindowText(GetResManager().LoadString(bExpand ? IDS_BDRIGHT_STRING : IDS_BDLEFT_STRING)); m_ctlShortcuts.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); m_ctlLargeIcons.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); m_ctlSmallIcons.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); @@ -405,8 +405,8 @@ m_ctlTree.PostMessage(WM_SETPATH, 0, (LPARAM)((LPCTSTR)m_bdData.strInitialDir)); // buttons text - m_ctlOk.SetWindowText(GetResManager()->LoadString(IDS_BDOK_STRING)); - m_ctlCancel.SetWindowText(GetResManager()->LoadString(IDS_BDCANCEL_STRING)); + m_ctlOk.SetWindowText(GetResManager().LoadString(IDS_BDOK_STRING)); + m_ctlCancel.SetWindowText(GetResManager().LoadString(IDS_BDCANCEL_STRING)); ApplyExpandState(m_bdData.bExtended); // sys img list @@ -441,11 +441,11 @@ lvc.mask=LVCF_SUBITEM | LVCF_WIDTH | LVCF_TEXT; lvc.iSubItem=-1; lvc.cx=80; - lvc.pszText=(LPTSTR)GetResManager()->LoadString(IDS_BDNAME_STRING); + lvc.pszText=(LPTSTR)GetResManager().LoadString(IDS_BDNAME_STRING); m_ctlShortcuts.InsertColumn(0, &lvc); lvc.iSubItem=0; lvc.cx=110; - lvc.pszText=(LPTSTR)GetResManager()->LoadString(IDS_BDPATH_STRING); + lvc.pszText=(LPTSTR)GetResManager().LoadString(IDS_BDPATH_STRING); m_ctlShortcuts.InsertColumn(1, &lvc); // select view-style button @@ -482,28 +482,28 @@ switch (uiID) { case IDC_NEWFOLDER_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDNEWFOLDER_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDNEWFOLDER_STRING); break; case IDC_LARGEICONS_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDLARGEICONS_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDLARGEICONS_STRING); break; case IDC_SMALLICONS_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDSMALLICONS_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDSMALLICONS_STRING); break; case IDC_LIST_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDLIST_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDLIST_STRING); break; case IDC_REPORT_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDREPORT_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDREPORT_STRING); break; case IDC_TOGGLE_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDDETAILS_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDDETAILS_STRING); break; case IDC_ADDSHORTCUT_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDADDSHORTCUT_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDADDSHORTCUT_STRING); break; case IDC_REMOVESHORTCUT_BUTTON: - pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDREMOVESHORTCUT_STRING); + pTip->lpszText=(LPTSTR)GetResManager().LoadString(IDS_BDREMOVESHORTCUT_STRING); break; default: return FALSE; @@ -638,15 +638,15 @@ if ( (bNet=m_ctlTree.GetItemShellData(pit->hItem, SHGDFIL_NETRESOURCE, pnet, 2048)) == true) { if (pnet->lpRemoteName && _tcscmp(pnet->lpRemoteName, _T("")) != 0) - m_strTip+=GetResManager()->LoadString(IDS_BDREMOTENAME_STRING)+CString(pnet->lpRemoteName)+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDREMOTENAME_STRING)+CString(pnet->lpRemoteName)+_T("\n"); if ( pnet->lpLocalName && _tcscmp(pnet->lpLocalName, _T("")) != 0) - m_strTip+=GetResManager()->LoadString(IDS_BDLOCALNAME_STRING)+CString(pnet->lpLocalName)+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDLOCALNAME_STRING)+CString(pnet->lpLocalName)+_T("\n"); if ( pnet->dwDisplayType != 0) - m_strTip+=GetResManager()->LoadString(IDS_BDTYPE_STRING)+CString(GetResManager()->LoadString(IDS_BDDOMAIN_STRING+pnet->dwDisplayType))+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDTYPE_STRING)+CString(GetResManager().LoadString(IDS_BDDOMAIN_STRING+pnet->dwDisplayType))+_T("\n"); if ( pnet->lpProvider && _tcscmp(pnet->lpProvider, _T("")) != 0) - m_strTip+=GetResManager()->LoadString(IDS_BDNETTYPE_STRING)+CString(pnet->lpProvider)+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDNETTYPE_STRING)+CString(pnet->lpProvider)+_T("\n"); if ( pnet->lpComment && _tcscmp(pnet->lpComment, _T("")) != 0) - m_strTip+=GetResManager()->LoadString(IDS_BDDESCRIPTION_STRING)+CString(pnet->lpComment)+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDDESCRIPTION_STRING)+CString(pnet->lpComment)+_T("\n"); } // try to get path @@ -665,8 +665,8 @@ ull_t ullFree, ullTotal; if (GetDynamicFreeSpace(strPath, &ullFree, &ullTotal)) { - m_strTip+=GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, szSizeFree, 32, false))+_T("\n"); - m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(ullTotal, szSizeTotal, 32, false))+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, szSizeFree, 32, false))+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(ullTotal, szSizeTotal, 32, false))+_T("\n"); } } } @@ -698,14 +698,14 @@ return; // out of range CShortcut sc=CString(m_bdData.cvShortcuts.at(pit->iItem)); - m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager()->LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; + m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager().LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; // get disk free space ull_t ullFree, ullTotal; if (GetDynamicFreeSpace(sc.m_strPath, &ullFree, &ullTotal)) { - m_strTip+=CString(_T("\r\n"))+GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, m_szBuffer, 2048, false))+_T("\n"); - m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(ullTotal, m_szBuffer, 2048, false)); + m_strTip+=CString(_T("\r\n"))+GetResManager().LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, m_szBuffer, 2048, false))+_T("\n"); + m_strTip+=GetResManager().LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(ullTotal, m_szBuffer, 2048, false)); } pit->pszText=(LPTSTR)(LPCTSTR)m_strTip; Index: src/ch/MainWnd.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -106,8 +106,8 @@ int CMainWnd::ShowTrayIcon() { // create system tray icon - HICON hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR | LR_VGACOLOR); - PCTSTR pszAppVer = GetApp()->GetAppNameVer(); + HICON hIcon=(HICON)GetResManager().LoadImage(MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR | LR_VGACOLOR); + PCTSTR pszAppVer = GetApp().GetAppNameVer(); bool bRes=m_ctlTray.CreateIcon(m_hWnd, WM_TRAYNOTIFY, pszAppVer, hIcon, 0); if (!bRes) { @@ -225,7 +225,7 @@ TRACE("Searching for files...\n"); // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFSEARCHINGFORFILES_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFSEARCHINGFORFILES_STRING)); // update status pTask->SetStatus(ST_SEARCHING, ST_STEP_MASK); @@ -251,15 +251,15 @@ if (!fi.Create(pTask->GetClipboardData(i)->GetPath(), i)) { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFMISSINGCLIPBOARDINPUT_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFMISSINGCLIPBOARDINPUT_STRING)); fmt.SetParam(_t("%path"), pTask->GetClipboardData(i)->GetPath()); pTask->m_log.logw(fmt); continue; } else { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFADDINGCLIPBOARDFILE_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFADDINGCLIPBOARDFILE_STRING)); fmt.SetParam(_t("%path"), pTask->GetClipboardData(i)->GetPath()); pTask->m_log.logi(fmt); } @@ -287,7 +287,7 @@ pTask->FilesAdd(fi); // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFADDEDFOLDER_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFADDEDFOLDER_STRING)); fmt.SetParam(_t("%path"), fi.GetFullFilePath()); pTask->m_log.logi(fmt); } @@ -297,7 +297,7 @@ || iDestDrvNumber != fi.GetDriveNumber() || CFileInfo::Exist(fi.GetDestinationPath(pTask->GetDestPath().GetPath(), 0, ((int)bForceDirectories) << 1)) ) { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFRECURSINGFOLDER_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFRECURSINGFOLDER_STRING)); fmt.SetParam(_t("%path"), fi.GetFullFilePath()); pTask->m_log.logi(fmt); @@ -311,7 +311,7 @@ if (pTask->GetKillFlag()) { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFADDINGKILLREQEST_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFADDINGKILLREQEST_STRING)); throw new CProcessingException(E_KILL_REQUEST, pTask); } } @@ -330,7 +330,7 @@ pTask->FilesAdd(fi); // file - add // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFADDEDFILE_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFADDEDFILE_STRING)); fmt.SetParam(_t("%path"), fi.GetFullFilePath()); pTask->m_log.logi(fmt); } @@ -350,14 +350,14 @@ pTask->Store(false); // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFSEARCHINGFINISHED_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFSEARCHINGFINISHED_STRING)); } // delete files - after copying void DeleteFiles(CTask* pTask) { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFDELETINGFILES_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFDELETINGFILES_STRING)); // current processed path BOOL bSuccess; @@ -374,7 +374,7 @@ if (pTask->GetKillFlag()) { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFDELETINGKILLREQUEST_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFDELETINGKILLREQUEST_STRING)); throw new CProcessingException(E_KILL_REQUEST, pTask); } @@ -386,14 +386,14 @@ // delete data if (fi.IsDirectory()) { - if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) + if (!GetConfig().get_bool(PP_CMPROTECTROFILES)) SetFileAttributes(fi.GetFullFilePath(), FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY); bSuccess=RemoveDirectory(fi.GetFullFilePath()); } else { // set files attributes to normal - it'd slow processing a bit, but it's better. - if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) + if (!GetConfig().get_bool(PP_CMPROTECTROFILES)) SetFileAttributes(fi.GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); bSuccess=DeleteFile(fi.GetFullFilePath()); } @@ -403,7 +403,7 @@ if (!bSuccess && dwLastError != ERROR_PATH_NOT_FOUND && dwLastError != ERROR_FILE_NOT_FOUND) { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDELETINGERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFDELETINGERROR_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), fi.GetFullFilePath()); pTask->m_log.loge(fmt); @@ -418,7 +418,7 @@ pTask->IncreaseCurrentIndex(); // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFDELETINGFINISHED_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFDELETINGFINISHED_STRING)); } void CustomCopyFile(PCUSTOM_COPY_PARAMS pData) @@ -428,8 +428,7 @@ try { // do we copy rest or recopy ? - bool bCopyRest=GetConfig()->get_bool(PP_CMUSEAUTOCOMPLETEFILES); -// UINT uiNotificationType=(UINT)GetConfig()->get_signed_num(PP_CMSHOWVISUALFEEDBACK); + bool bCopyRest=GetConfig().get_bool(PP_CMUSEAUTOCOMPLETEFILES); // Data regarding dest file CFileInfo fiDest; @@ -438,11 +437,6 @@ chcore::IFeedbackHandler* piFeedbackHandler = pData->pTask->GetFeedbackHandler(); BOOST_ASSERT(piFeedbackHandler); -// int iDlgCode=-1; -// int *piLastDlgDesc=NULL; // ptr to int describing last used dialog - - // don't ask for copy rest -// bool bDontAsk=(pData->pTask->GetCurrentIndex() == pData->pTask->GetLastProcessedIndex()); pData->pTask->SetLastProcessedIndex(-1); // if dest file size >0 - we can do somethng more than usual @@ -474,9 +468,9 @@ case CFeedbackHandler::eResult_Cancel: { // log - if (GetConfig()->get_bool(PP_CMCREATELOG)) + if (GetConfig().get_bool(PP_CMCREATELOG)) { - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFPRECHECKCANCELREQUEST_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFPRECHECKCANCELREQUEST_STRING)); fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); pData->pTask->m_log.logi(fmt); } @@ -498,15 +492,15 @@ }// bExist // change attributes of a dest file - if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) + if (!GetConfig().get_bool(PP_CMPROTECTROFILES)) SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); // first or second pass ? only for FFNB bool bFirstPass=true; // check size of src file to know whether use flag FILE_FLAG_NOBUFFERING l_start: - bool bNoBuffer=(bFirstPass && GetConfig()->get_bool(PP_BFUSENOBUFFERING) && pData->pfiSrcFile->GetLength64() >= (unsigned long long)GetConfig()->get_signed_num(PP_BFBOUNDARYLIMIT)); + bool bNoBuffer=(bFirstPass && GetConfig().get_bool(PP_BFUSENOBUFFERING) && pData->pfiSrcFile->GetLength64() >= (unsigned long long)GetConfig().get_signed_num(PP_BFBOUNDARYLIMIT)); // refresh data about file if (!bFirstPass) @@ -532,7 +526,7 @@ break; case CFeedbackHandler::eResult_Cancel: // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGCANCELREQUEST_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFOPENINGCANCELREQUEST_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); pData->pTask->m_log.loge(fmt); @@ -543,7 +537,7 @@ break; case CFeedbackHandler::eResult_Retry: // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGRETRY_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFOPENINGRETRY_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); pData->pTask->m_log.loge(fmt); @@ -572,19 +566,19 @@ { case CFeedbackHandler::eResult_Retry: // change attributes - if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) + if (!GetConfig().get_bool(PP_CMPROTECTROFILES)) SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGRETRY_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFDESTOPENINGRETRY_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), pData->strDstFile); pData->pTask->m_log.loge(fmt); goto l_openingdst; break; case CFeedbackHandler::eResult_Cancel: // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGCANCELREQUEST_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFDESTOPENINGCANCELREQUEST_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), pData->strDstFile); pData->pTask->m_log.loge(fmt); @@ -621,7 +615,7 @@ if (SetFilePointer64(hSrc, ullMove, FILE_BEGIN) == -1 || SetFilePointer64(hDst, ullMove, FILE_BEGIN) == -1) { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFMOVINGPOINTERSERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFMOVINGPOINTERSERROR_STRING)); fmt.SetParam(_t("%errno"), GetLastError()); fmt.SetParam(_t("%srcpath"), pData->pfiSrcFile->GetFullFilePath()); fmt.SetParam(_t("%dstpath"), pData->strDstFile); @@ -633,7 +627,7 @@ { // log dwLastError=GetLastError(); - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFRESTORINGPOINTERSERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFRESTORINGPOINTERSERROR_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%srcpath"), pData->pfiSrcFile->GetFullFilePath()); fmt.SetParam(_t("%dstpath"), pData->strDstFile); @@ -666,7 +660,7 @@ { // log dwLastError=GetLastError(); - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFSETTINGZEROSIZEERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFSETTINGZEROSIZEERROR_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), pData->strDstFile); pData->pTask->m_log.loge(fmt); @@ -682,7 +676,7 @@ if (pData->pTask->GetKillFlag()) { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCOPYINGKILLREQUEST_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFCOPYINGKILLREQUEST_STRING)); fmt.SetParam(_t("%srcpath"), pData->pfiSrcFile->GetFullFilePath()); fmt.SetParam(_t("%dstpath"), pData->strDstFile); pData->pTask->m_log.logi(fmt); @@ -695,7 +689,7 @@ // log const BUFFERSIZES *pbs1=pData->dbBuffer.GetSizes(), *pbs2=pData->pTask->GetBufferSizes(); - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCHANGINGBUFFERSIZE_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFCHANGINGBUFFERSIZE_STRING)); fmt.SetParam(_t("%defsize"), pbs1->m_uiDefaultSize); fmt.SetParam(_t("%onesize"), pbs1->m_uiOneDiskSize); @@ -723,7 +717,7 @@ { // log dwLastError=GetLastError(); - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFREADINGERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFREADINGERROR_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%count"), tord); fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); @@ -751,7 +745,7 @@ { // log dwLastError=GetLastError(); - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFWRITINGERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFWRITINGERROR_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%count"), rd); fmt.SetParam(_t("%path"), pData->strDstFile); @@ -782,7 +776,7 @@ catch(...) { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCAUGHTEXCEPTIONCCF_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFCAUGHTEXCEPTIONCCF_STRING)); fmt.SetParam(_t("%errno"), GetLastError()); fmt.SetParam(_t("%timestamp"), GetTickCount()); pData->pTask->m_log.loge(fmt); @@ -801,7 +795,7 @@ void ProcessFiles(CTask* pTask) { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFPROCESSINGFILES_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFPROCESSINGFILES_STRING)); // count how much has been done (updates also a member in CTaskArray) pTask->CalcProcessedSize(); @@ -828,7 +822,7 @@ const BUFFERSIZES* pbs=ccp.dbBuffer.GetSizes(); ictranslate::CFormat fmt; - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFPROCESSINGFILESDATA_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFPROCESSINGFILESDATA_STRING)); fmt.SetParam(_t("%create"), ccp.bOnlyCreate); fmt.SetParam(_t("%defsize"), pbs->m_uiDefaultSize); fmt.SetParam(_t("%onesize"), pbs->m_uiOneDiskSize); @@ -857,7 +851,7 @@ if (pTask->GetKillFlag()) { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFPROCESSINGKILLREQUEST_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFPROCESSINGKILLREQUEST_STRING)); throw new CProcessingException(E_KILL_REQUEST, pTask); } @@ -872,7 +866,7 @@ { dwLastError=GetLastError(); //log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFMOVEFILEERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFMOVEFILEERROR_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%srcpath"), fi.GetFullFilePath()); fmt.SetParam(_t("%dstpath"), ccp.strDstFile); @@ -890,7 +884,7 @@ if (!CreateDirectory(ccp.strDstFile, NULL) && (dwLastError=GetLastError()) != ERROR_ALREADY_EXISTS ) { // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCREATEDIRECTORYERROR_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFCREATEDIRECTORYERROR_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), ccp.strDstFile); pTask->m_log.loge(fmt); @@ -912,21 +906,21 @@ fi.SetFlags(ccp.bProcessed ? FIF_PROCESSED : 0, FIF_PROCESSED); // if moving - delete file (only if config flag is set) - if (bMove && fi.GetFlags() & FIF_PROCESSED && !GetConfig()->get_bool(PP_CMDELETEAFTERFINISHED) && j == iCopiesCount-1) + if (bMove && fi.GetFlags() & FIF_PROCESSED && !GetConfig().get_bool(PP_CMDELETEAFTERFINISHED) && j == iCopiesCount-1) { - if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) + if (!GetConfig().get_bool(PP_CMPROTECTROFILES)) SetFileAttributes(fi.GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); DeleteFile(fi.GetFullFilePath()); // there will be another try later, so I don't check // if succeeded } } // set a time - if (GetConfig()->get_bool(PP_CMSETDESTDATE)) + if (GetConfig().get_bool(PP_CMSETDESTDATE)) SetFileDirectoryTime(ccp.strDstFile, &fi); // no error check - ma�o istotne // attributes - if (GetConfig()->get_bool(PP_CMSETDESTATTRIBUTES)) + if (GetConfig().get_bool(PP_CMSETDESTATTRIBUTES)) SetFileAttributes(ccp.strDstFile, fi.GetAttributes()); // j.w. } } @@ -953,7 +947,7 @@ pTask->SetCurrentIndex(nSize); } // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFPROCESSINGFINISHED_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFPROCESSINGFINISHED_STRING)); } void CheckForWaitState(CTask* pTask) @@ -969,7 +963,7 @@ pTask->SetStatus(0, ST_WAITING); bContinue=true; - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFWAITINGFINISHED_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFWAITINGFINISHED_STRING)); // return; // skips sleep and kill flag checking } @@ -979,7 +973,7 @@ if (pTask->GetKillFlag()) { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFWAITINGKILLREQUEST_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFWAITINGKILLREQUEST_STRING)); throw new CProcessingException(E_KILL_REQUEST, pTask); } } @@ -999,12 +993,12 @@ // set thread boost HANDLE hThread=GetCurrentThread(); - ::SetThreadPriorityBoost(hThread, GetConfig()->get_bool(PP_CMDISABLEPRIORITYBOOST)); + ::SetThreadPriorityBoost(hThread, GetConfig().get_bool(PP_CMDISABLEPRIORITYBOOST)); CTime tm=CTime::GetCurrentTime(); ictranslate::CFormat fmt; - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFTHREADSTART_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFTHREADSTART_STRING)); fmt.SetParam(_t("%year"), tm.GetYear()); fmt.SetParam(_t("%month"), tm.GetMonth()); fmt.SetParam(_t("%day"), tm.GetDay()); @@ -1016,7 +1010,7 @@ try { // to make the value stable - bool bReadTasksSize=GetConfig()->get_bool(PP_CMREADSIZEBEFOREBLOCKING); + bool bReadTasksSize=GetConfig().get_bool(PP_CMREADSIZEBEFOREBLOCKING); if (!bReadTasksSize) CheckForWaitState(pTask); // operation limiting @@ -1041,11 +1035,11 @@ // check for free space ull_t ullNeededSize = 0, ullAvailableSize = 0; l_showfeedback: - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFCHECKINGSPACE_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFCHECKINGSPACE_STRING)); if (!pTask->GetRequiredFreeSpace(&ullNeededSize, &ullAvailableSize)) { - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFNOTENOUGHFREESPACE_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFNOTENOUGHFREESPACE_STRING)); fmt.SetParam(_t("%needsize"), ullNeededSize); fmt.SetParam(_t("%availablesize"), ullAvailableSize); pTask->m_log.logw(fmt); @@ -1065,16 +1059,16 @@ { case CFeedbackHandler::eResult_Cancel: { - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACECANCELREQUEST_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFFREESPACECANCELREQUEST_STRING)); throw new CProcessingException(E_CANCEL, pTask); break; } case CFeedbackHandler::eResult_Retry: - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACERETRYING_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFFREESPACERETRYING_STRING)); goto l_showfeedback; break; case CFeedbackHandler::eResult_Skip: - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACEIGNORE_STRING)); + pTask->m_log.logi(GetResManager().LoadString(IDS_OTFFREESPACEIGNORE_STRING)); break; default: BOOST_ASSERT(FALSE); // unknown result @@ -1116,15 +1110,15 @@ pTask->DecreaseOperationsPending(); // play sound - if (GetConfig()->get_bool(PP_SNDPLAYSOUNDS)) + if (GetConfig().get_bool(PP_SNDPLAYSOUNDS)) { - GetConfig()->get_string(PP_SNDFINISHEDSOUNDPATH, szPath, _MAX_PATH); - GetApp()->ExpandPath(szPath); + GetConfig().get_string(PP_SNDFINISHEDSOUNDPATH, szPath, _MAX_PATH); + GetApp().ExpandPath(szPath); PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); } tm=CTime::GetCurrentTime(); - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFTHREADFINISHED_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFTHREADFINISHED_STRING)); fmt.SetParam(_t("%year"), tm.GetYear()); fmt.SetParam(_t("%month"), tm.GetMonth()); fmt.SetParam(_t("%day"), tm.GetDay()); @@ -1147,15 +1141,15 @@ pTask->UpdateTime(); // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCAUGHTEXCEPTIONMAIN_STRING)); + fmt.SetFormat(GetResManager().LoadString(IDS_OTFCAUGHTEXCEPTIONMAIN_STRING)); fmt.SetParam(_t("%errno"), e->m_dwError); fmt.SetParam(_t("%type"), e->m_iType); pTask->m_log.loge(fmt); - if (e->m_iType == E_ERROR && GetConfig()->get_bool(PP_SNDPLAYSOUNDS)) + if (e->m_iType == E_ERROR && GetConfig().get_bool(PP_SNDPLAYSOUNDS)) { - GetConfig()->get_string(PP_SNDERRORSOUNDPATH, szPath, _MAX_PATH); - GetApp()->ExpandPath(szPath); + GetConfig().get_string(PP_SNDERRORSOUNDPATH, szPath, _MAX_PATH); + GetApp().ExpandPath(szPath); PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); } @@ -1198,13 +1192,10 @@ LONG lFinished=0; bool bEnd=false; - icpf::config* pConfig = GetConfig(); - BOOST_ASSERT(pConfig); - if(!pConfig) - return 1; + icpf::config& rConfig = GetConfig(); while (!pData->bKill) { - if (uiCounter == 0 && pConfig->get_bool(PP_PCLIPBOARDMONITORING) && IsClipboardFormatAvailable(CF_HDROP)) + if (uiCounter == 0 && rConfig.get_bool(PP_PCLIPBOARDMONITORING) && IsClipboardFormatAvailable(CF_HDROP)) { // get data from clipboard OpenClipboard(pData->m_hwnd); @@ -1242,52 +1233,52 @@ CloseClipboard(); BUFFERSIZES bs; - bs.m_bOnlyDefault=pConfig->get_bool(PP_BFUSEONLYDEFAULT); - bs.m_uiDefaultSize=(UINT)pConfig->get_signed_num(PP_BFDEFAULT); - bs.m_uiOneDiskSize=(UINT)pConfig->get_signed_num(PP_BFONEDISK); - bs.m_uiTwoDisksSize=(UINT)pConfig->get_signed_num(PP_BFTWODISKS); - bs.m_uiCDSize=(UINT)pConfig->get_signed_num(PP_BFCD); - bs.m_uiLANSize=(UINT)pConfig->get_signed_num(PP_BFLAN); + bs.m_bOnlyDefault=rConfig.get_bool(PP_BFUSEONLYDEFAULT); + bs.m_uiDefaultSize=(UINT)rConfig.get_signed_num(PP_BFDEFAULT); + bs.m_uiOneDiskSize=(UINT)rConfig.get_signed_num(PP_BFONEDISK); + bs.m_uiTwoDisksSize=(UINT)rConfig.get_signed_num(PP_BFTWODISKS); + bs.m_uiCDSize=(UINT)rConfig.get_signed_num(PP_BFCD); + bs.m_uiLANSize=(UINT)rConfig.get_signed_num(PP_BFLAN); pTask->SetBufferSizes(&bs); - pTask->SetPriority((int)pConfig->get_signed_num(PP_CMDEFAULTPRIORITY)); + pTask->SetPriority((int)rConfig.get_signed_num(PP_CMDEFAULTPRIORITY)); // get dest folder CFolderDialog dlg; const tchar_t* pszPath = NULL; dlg.m_bdData.cvShortcuts.clear(true); - size_t stCount = pConfig->get_value_count(PP_SHORTCUTS); + size_t stCount = rConfig.get_value_count(PP_SHORTCUTS); for(size_t stIndex = 0; stIndex < stCount; stIndex++) { - pszPath = pConfig->get_string(PP_SHORTCUTS, stIndex); + pszPath = rConfig.get_string(PP_SHORTCUTS, stIndex); dlg.m_bdData.cvShortcuts.push_back(pszPath); } dlg.m_bdData.cvRecent.clear(true); - stCount = pConfig->get_value_count(PP_RECENTPATHS); + stCount = rConfig.get_value_count(PP_RECENTPATHS); for(size_t stIndex = 0; stIndex < stCount; stIndex++) { - pszPath = pConfig->get_string(PP_RECENTPATHS, stIndex); + pszPath = rConfig.get_string(PP_RECENTPATHS, stIndex); dlg.m_bdData.cvRecent.push_back(pszPath); } - dlg.m_bdData.bExtended=pConfig->get_bool(PP_FDEXTENDEDVIEW); - dlg.m_bdData.cx=(int)pConfig->get_signed_num(PP_FDWIDTH); - dlg.m_bdData.cy=(int)pConfig->get_signed_num(PP_FDHEIGHT); - dlg.m_bdData.iView=(int)pConfig->get_signed_num(PP_FDSHORTCUTLISTSTYLE); - dlg.m_bdData.bIgnoreDialogs=pConfig->get_bool(PP_FDIGNORESHELLDIALOGS); + dlg.m_bdData.bExtended=rConfig.get_bool(PP_FDEXTENDEDVIEW); + dlg.m_bdData.cx=(int)rConfig.get_signed_num(PP_FDWIDTH); + dlg.m_bdData.cy=(int)rConfig.get_signed_num(PP_FDHEIGHT); + dlg.m_bdData.iView=(int)rConfig.get_signed_num(PP_FDSHORTCUTLISTSTYLE); + dlg.m_bdData.bIgnoreDialogs=rConfig.get_bool(PP_FDIGNORESHELLDIALOGS); dlg.m_bdData.strInitialDir=(dlg.m_bdData.cvRecent.size() > 0) ? dlg.m_bdData.cvRecent.at(0) : _T(""); int iStatus=pTask->GetStatus(ST_OPERATION_MASK); if (iStatus == ST_COPY) - dlg.m_bdData.strCaption=GetResManager()->LoadString(IDS_TITLECOPY_STRING); + dlg.m_bdData.strCaption=GetResManager().LoadString(IDS_TITLECOPY_STRING); else if (iStatus == ST_MOVE) - dlg.m_bdData.strCaption=GetResManager()->LoadString(IDS_TITLEMOVE_STRING); + dlg.m_bdData.strCaption=GetResManager().LoadString(IDS_TITLEMOVE_STRING); else - dlg.m_bdData.strCaption=GetResManager()->LoadString(IDS_TITLEUNKNOWNOPERATION_STRING); - dlg.m_bdData.strText=GetResManager()->LoadString(IDS_MAINBROWSETEXT_STRING); + dlg.m_bdData.strCaption=GetResManager().LoadString(IDS_TITLEUNKNOWNOPERATION_STRING); + dlg.m_bdData.strText=GetResManager().LoadString(IDS_MAINBROWSETEXT_STRING); // set count of data to display int iClipboardSize=pTask->GetClipboardDataSize(); @@ -1303,24 +1294,24 @@ int iResult=dlg.DoModal(); // set data to config - pConfig->clear_array_values(PP_SHORTCUTS); + rConfig.clear_array_values(PP_SHORTCUTS); for(char_vector::iterator it = dlg.m_bdData.cvShortcuts.begin(); it != dlg.m_bdData.cvShortcuts.end(); it++) { - pConfig->set_string(PP_SHORTCUTS, (*it), icpf::property::action_add); + rConfig.set_string(PP_SHORTCUTS, (*it), icpf::property::action_add); } - pConfig->clear_array_values(PP_RECENTPATHS); + rConfig.clear_array_values(PP_RECENTPATHS); for(char_vector::iterator it = dlg.m_bdData.cvRecent.begin(); it != dlg.m_bdData.cvRecent.end(); it++) { - pConfig->set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); + rConfig.set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); } - pConfig->set_bool(PP_FDEXTENDEDVIEW, dlg.m_bdData.bExtended); - pConfig->set_signed_num(PP_FDWIDTH, dlg.m_bdData.cx); - pConfig->set_signed_num(PP_FDHEIGHT, dlg.m_bdData.cy); - pConfig->set_signed_num(PP_FDSHORTCUTLISTSTYLE, dlg.m_bdData.iView); - pConfig->set_bool(PP_FDIGNORESHELLDIALOGS, dlg.m_bdData.bIgnoreDialogs); - pConfig->write(NULL); + rConfig.set_bool(PP_FDEXTENDEDVIEW, dlg.m_bdData.bExtended); + rConfig.set_signed_num(PP_FDWIDTH, dlg.m_bdData.cx); + rConfig.set_signed_num(PP_FDHEIGHT, dlg.m_bdData.cy); + rConfig.set_signed_num(PP_FDSHORTCUTLISTSTYLE, dlg.m_bdData.iView); + rConfig.set_bool(PP_FDIGNORESHELLDIALOGS, dlg.m_bdData.bIgnoreDialogs); + rConfig.write(NULL); if ( iResult != IDOK ) delete pTask; @@ -1348,7 +1339,7 @@ } // do we need to check for turning computer off - if (GetConfig()->get_bool(PP_PSHUTDOWNAFTREFINISHED)) + if (GetConfig().get_bool(PP_PSHUTDOWNAFTREFINISHED)) { if (uiShutCounter == 0) { @@ -1362,17 +1353,17 @@ { TRACE("Shut down windows\n"); bool bShutdown=true; - if (GetConfig()->get_signed_num(PP_PTIMEBEFORESHUTDOWN) != 0) + if (GetConfig().get_signed_num(PP_PTIMEBEFORESHUTDOWN) != 0) { CShutdownDlg dlg; - dlg.m_iOverallTime=(int)GetConfig()->get_signed_num(PP_PTIMEBEFORESHUTDOWN); + dlg.m_iOverallTime=(int)GetConfig().get_signed_num(PP_PTIMEBEFORESHUTDOWN); if (dlg.m_iOverallTime < 0) dlg.m_iOverallTime=-dlg.m_iOverallTime; bShutdown=(dlg.DoModal() != IDCANCEL); } - GetConfig()->set_bool(PP_PSHUTDOWNAFTREFINISHED, false); - GetConfig()->write(NULL); + GetConfig().set_bool(PP_PSHUTDOWNAFTREFINISHED, false); + GetConfig().write(NULL); if (bShutdown) { // we're killed @@ -1390,15 +1381,15 @@ AdjustTokenPrivileges(hToken, FALSE, &tp, NULL, NULL, NULL); } - BOOL bExit=ExitWindowsEx(EWX_POWEROFF | EWX_SHUTDOWN | (GetConfig()->get_bool(PP_PFORCESHUTDOWN) ? EWX_FORCE : 0), 0); + BOOL bExit=ExitWindowsEx(EWX_POWEROFF | EWX_SHUTDOWN | (GetConfig().get_bool(PP_PFORCESHUTDOWN) ? EWX_FORCE : 0), 0); if (bExit) return 1; else { pData->bKilled=false; // some kind of error - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_SHUTDOWNERROR_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHUTDOWNERROR_STRING)); fmt.SetParam(_t("%errno"), GetLastError()); AfxMessageBox(fmt, MB_ICONERROR | MB_OK | MB_SYSTEMMODAL); } @@ -1417,7 +1408,7 @@ Sleep(iSleepCount); uiCounter+=iSleepCount; uiShutCounter+=iSleepCount; - if (uiCounter >= (UINT)GetConfig()->get_signed_num(PP_PMONITORSCANINTERVAL)) + if (uiCounter >= (UINT)GetConfig().get_signed_num(PP_PMONITORSCANINTERVAL)) uiCounter=0; if (uiShutCounter >= 800) uiShutCounter=0; @@ -1449,7 +1440,7 @@ // load last state CString strPath; - GetApp()->GetProgramDataPath(strPath); + GetApp().GetProgramDataPath(strPath); strPath += _T("\\tasks"); m_tasks.SetTasksDir(strPath); m_tasks.LoadDataProgress(); @@ -1464,13 +1455,13 @@ AfxBeginThread(&ClipboardMonitorProc, static_cast(&cmd), THREAD_PRIORITY_IDLE); // start saving timer - SetTimer(1023, (UINT)GetConfig()->get_signed_num(PP_PAUTOSAVEINTERVAL), NULL); + SetTimer(1023, (UINT)GetConfig().get_signed_num(PP_PAUTOSAVEINTERVAL), NULL); - SetTimer(7834, TM_AUTORESUME/*GetConfig()->GetAutoRetryInterval()*/, NULL); + SetTimer(7834, TM_AUTORESUME, NULL); SetTimer(3245, TM_AUTOREMOVE, NULL); SetTimer(8743, TM_ACCEPTING, NULL); // ends wait state in tasks - if (GetConfig()->get_bool(PP_MVAUTOSHOWWHENRUN)) + if (GetConfig().get_bool(PP_MVAUTOSHOWWHENRUN)) PostMessage(WM_SHOWMINIVIEW); return 0; @@ -1492,7 +1483,7 @@ case WM_LBUTTONDBLCLK: { CMenu mMenu, *pSubMenu; - HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_POPUP_MENU)); + HMENU hMenu=GetResManager().LoadMenu(MAKEINTRESOURCE(IDR_POPUP_MENU)); if (!mMenu.Attach(hMenu)) return (LRESULT)FALSE; @@ -1510,7 +1501,7 @@ case WM_RBUTTONUP: { // load main menu - HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_POPUP_MENU)); + HMENU hMenu=GetResManager().LoadMenu(MAKEINTRESOURCE(IDR_POPUP_MENU)); CMenu mMenu, *pSubMenu; if (!mMenu.Attach(hMenu)) return (LRESULT)FALSE; @@ -1528,8 +1519,8 @@ POINT pt; GetCursorPos(&pt); - pSubMenu->CheckMenuItem(ID_POPUP_MONITORING, MF_BYCOMMAND | (GetConfig()->get_bool(PP_PCLIPBOARDMONITORING) ? MF_CHECKED : MF_UNCHECKED)); - pSubMenu->CheckMenuItem(ID_POPUP_SHUTAFTERFINISHED, MF_BYCOMMAND | (GetConfig()->get_bool(PP_PSHUTDOWNAFTREFINISHED) ? MF_CHECKED : MF_UNCHECKED)); + pSubMenu->CheckMenuItem(ID_POPUP_MONITORING, MF_BYCOMMAND | (GetConfig().get_bool(PP_PCLIPBOARDMONITORING) ? MF_CHECKED : MF_UNCHECKED)); + pSubMenu->CheckMenuItem(ID_POPUP_SHUTAFTERFINISHED, MF_BYCOMMAND | (GetConfig().get_bool(PP_PSHUTDOWNAFTREFINISHED) ? MF_CHECKED : MF_UNCHECKED)); // track the menu pSubMenu->TrackPopupMenu(TPM_LEFTBUTTON, pt.x, pt.y, this); @@ -1544,11 +1535,11 @@ { if (m_tasks.GetSize() != 0) { - _sntprintf(text, _MAX_PATH, _T("%s - %d %%"), GetApp()->GetAppName(), m_tasks.GetPercent()); + _sntprintf(text, _MAX_PATH, _T("%s - %d %%"), GetApp().GetAppName(), m_tasks.GetPercent()); m_ctlTray.SetTooltipText(text); } else - m_ctlTray.SetTooltipText(GetApp()->GetAppNameVer()); + m_ctlTray.SetTooltipText(GetApp().GetAppNameVer()); break; } } @@ -1594,7 +1585,7 @@ // autosave timer KillTimer(1023); m_tasks.SaveProgress(); - SetTimer(1023, (UINT)GetConfig()->get_signed_num(PP_PAUTOSAVEINTERVAL), NULL); + SetTimer(1023, (UINT)GetConfig().get_signed_num(PP_PAUTOSAVEINTERVAL), NULL); break; case 7834: { @@ -1604,18 +1595,18 @@ DWORD dwInterval=(m_dwLastTime == 0) ? TM_AUTORESUME : dwTime-m_dwLastTime; m_dwLastTime=dwTime; - if (GetConfig()->get_bool(PP_CMAUTORETRYONERROR)) + if (GetConfig().get_bool(PP_CMAUTORETRYONERROR)) { if (m_tasks.TasksRetryProcessing(true, dwInterval) && m_pdlgStatus && m_pdlgStatus->m_bLock && IsWindow(m_pdlgStatus->m_hWnd)) m_pdlgStatus->SendMessage(WM_UPDATESTATUS); } - SetTimer(7834, TM_AUTORESUME/*GetConfig()->GetAutoRetryInterval()*/, NULL); + SetTimer(7834, TM_AUTORESUME, NULL); } break; case 3245: // auto-delete finished tasks timer KillTimer(3245); - if (GetConfig()->get_bool(PP_STATUSAUTOREMOVEFINISHED)) + if (GetConfig().get_bool(PP_STATUSAUTOREMOVEFINISHED)) { int iSize=m_tasks.GetSize(); m_tasks.RemoveAllFinished(); @@ -1629,13 +1620,13 @@ { // wait state handling section CTask* pTask; - if (GetConfig()->get_signed_num(PP_CMLIMITMAXOPERATIONS) == 0 || m_tasks.GetOperationsPending() < (UINT)GetConfig()->get_signed_num(PP_CMLIMITMAXOPERATIONS)) + if (GetConfig().get_signed_num(PP_CMLIMITMAXOPERATIONS) == 0 || m_tasks.GetOperationsPending() < (UINT)GetConfig().get_signed_num(PP_CMLIMITMAXOPERATIONS)) { for (int i=0;iGetStatus(ST_WAITING_MASK) & ST_WAITING && (GetConfig()->get_signed_num(PP_CMLIMITMAXOPERATIONS) == 0 || m_tasks.GetOperationsPending() < (UINT)GetConfig()->get_signed_num(PP_CMLIMITMAXOPERATIONS))) + if (pTask->GetStatus(ST_WAITING_MASK) & ST_WAITING && (GetConfig().get_signed_num(PP_CMLIMITMAXOPERATIONS) == 0 || m_tasks.GetOperationsPending() < (UINT)GetConfig().get_signed_num(PP_CMLIMITMAXOPERATIONS))) { TRACE("Enabling task %ld\n", i); pTask->SetContinueFlag(true); @@ -1661,7 +1652,7 @@ BOOL CMainWnd::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) { - if(!GetApp()->IsShellExtEnabled()) + if(!GetApp().IsShellExtEnabled()) return FALSE; // copying or moving ? @@ -1698,19 +1689,18 @@ } while (iOffset < ulLen); - icpf::config* pConfig = GetConfig(); - assert(pConfig); + icpf::config& rConfig = GetConfig(); // special operation - modify stuff CFiltersArray ffFilters; - int iPriority=(int)GetConfig()->get_signed_num(PP_CMDEFAULTPRIORITY); + int iPriority=(int)GetConfig().get_signed_num(PP_CMDEFAULTPRIORITY); BUFFERSIZES bsSizes; - bsSizes.m_bOnlyDefault=GetConfig()->get_bool(PP_BFUSEONLYDEFAULT); - bsSizes.m_uiDefaultSize=(UINT)GetConfig()->get_signed_num(PP_BFDEFAULT); - bsSizes.m_uiOneDiskSize=(UINT)GetConfig()->get_signed_num(PP_BFONEDISK); - bsSizes.m_uiTwoDisksSize=(UINT)GetConfig()->get_signed_num(PP_BFTWODISKS); - bsSizes.m_uiCDSize=(UINT)GetConfig()->get_signed_num(PP_BFCD); - bsSizes.m_uiLANSize=(UINT)GetConfig()->get_signed_num(PP_BFLAN); + bsSizes.m_bOnlyDefault=GetConfig().get_bool(PP_BFUSEONLYDEFAULT); + bsSizes.m_uiDefaultSize=(UINT)GetConfig().get_signed_num(PP_BFDEFAULT); + bsSizes.m_uiOneDiskSize=(UINT)GetConfig().get_signed_num(PP_BFONEDISK); + bsSizes.m_uiTwoDisksSize=(UINT)GetConfig().get_signed_num(PP_BFTWODISKS); + bsSizes.m_uiCDSize=(UINT)GetConfig().get_signed_num(PP_BFCD); + bsSizes.m_uiLANSize=(UINT)GetConfig().get_signed_num(PP_BFLAN); BOOL bOnlyCreate=FALSE; BOOL bIgnoreDirs=FALSE; @@ -1734,10 +1724,10 @@ dlg.m_ccData.m_vRecent.clear(true); const tchar_t* pszPath = NULL; - size_t stCount = pConfig->get_value_count(PP_RECENTPATHS); + size_t stCount = rConfig.get_value_count(PP_RECENTPATHS); for(size_t stIndex = 0; stIndex < stCount; stIndex++) { - pszPath = pConfig->get_string(PP_RECENTPATHS, stIndex); + pszPath = rConfig.get_string(PP_RECENTPATHS, stIndex); if(pszPath) dlg.m_ccData.m_vRecent.push_back(pszPath); } @@ -1760,10 +1750,10 @@ ucCopies=dlg.m_ccData.m_ucCount; dlg.m_ccData.m_vRecent.insert(dlg.m_ccData.m_vRecent.begin(), (const PTSTR)(LPCTSTR)strDstPath, true); - pConfig->clear_array_values(PP_RECENTPATHS); + rConfig.clear_array_values(PP_RECENTPATHS); for(char_vector::iterator it = dlg.m_ccData.m_vRecent.begin(); it != dlg.m_ccData.m_vRecent.end(); it++) { - pConfig->set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); + rConfig.set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); } } @@ -1814,20 +1804,17 @@ void CMainWnd::OnPopupCustomCopy() { - icpf::config* pConfig = GetConfig(); - assert(pConfig); - if(!pConfig) - return; + icpf::config& rConfig = GetConfig(); CCustomCopyDlg dlg; dlg.m_ccData.m_iOperation=0; - dlg.m_ccData.m_iPriority=(int)pConfig->get_signed_num(PP_CMDEFAULTPRIORITY); - dlg.m_ccData.m_bsSizes.m_bOnlyDefault=pConfig->get_bool(PP_BFUSEONLYDEFAULT); - dlg.m_ccData.m_bsSizes.m_uiDefaultSize=(UINT)pConfig->get_signed_num(PP_BFDEFAULT); - dlg.m_ccData.m_bsSizes.m_uiOneDiskSize=(UINT)pConfig->get_signed_num(PP_BFONEDISK); - dlg.m_ccData.m_bsSizes.m_uiTwoDisksSize=(UINT)pConfig->get_signed_num(PP_BFTWODISKS); - dlg.m_ccData.m_bsSizes.m_uiCDSize=(UINT)pConfig->get_signed_num(PP_BFCD); - dlg.m_ccData.m_bsSizes.m_uiLANSize=(UINT)pConfig->get_signed_num(PP_BFLAN); + dlg.m_ccData.m_iPriority=(int)rConfig.get_signed_num(PP_CMDEFAULTPRIORITY); + dlg.m_ccData.m_bsSizes.m_bOnlyDefault=rConfig.get_bool(PP_BFUSEONLYDEFAULT); + dlg.m_ccData.m_bsSizes.m_uiDefaultSize=(UINT)rConfig.get_signed_num(PP_BFDEFAULT); + dlg.m_ccData.m_bsSizes.m_uiOneDiskSize=(UINT)rConfig.get_signed_num(PP_BFONEDISK); + dlg.m_ccData.m_bsSizes.m_uiTwoDisksSize=(UINT)rConfig.get_signed_num(PP_BFTWODISKS); + dlg.m_ccData.m_bsSizes.m_uiCDSize=(UINT)rConfig.get_signed_num(PP_BFCD); + dlg.m_ccData.m_bsSizes.m_uiLANSize=(UINT)rConfig.get_signed_num(PP_BFLAN); dlg.m_ccData.m_bCreateStructure=false; dlg.m_ccData.m_bForceDirectories=false; @@ -1836,10 +1823,10 @@ dlg.m_ccData.m_vRecent.clear(true); const tchar_t* pszPath = NULL; - size_t stCount = pConfig->get_value_count(PP_RECENTPATHS); + size_t stCount = rConfig.get_value_count(PP_RECENTPATHS); for(size_t stIndex = 0; stIndex < stCount; stIndex++) { - pszPath = pConfig->get_string(PP_RECENTPATHS, stIndex); + pszPath = rConfig.get_string(PP_RECENTPATHS, stIndex); if(pszPath) dlg.m_ccData.m_vRecent.push_back(pszPath); } @@ -1849,10 +1836,10 @@ // save recent paths dlg.m_ccData.m_vRecent.push_back((PCTSTR)dlg.m_ccData.m_strDestPath); - pConfig->clear_array_values(PP_RECENTPATHS); + rConfig.clear_array_values(PP_RECENTPATHS); for(char_vector::iterator it = dlg.m_ccData.m_vRecent.begin(); it != dlg.m_ccData.m_vRecent.end(); it++) { - pConfig->set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); + rConfig.set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); } // new task @@ -1906,31 +1893,30 @@ case WM_CONFIGNOTIFY: { - GetApp()->SetAutorun(GetConfig()->get_bool(PP_PRELOADAFTERRESTART)); + GetApp().SetAutorun(GetConfig().get_bool(PP_PRELOADAFTERRESTART)); // set this process class HANDLE hProcess=GetCurrentProcess(); - ::SetPriorityClass(hProcess, (DWORD)GetConfig()->get_signed_num(PP_PPROCESSPRIORITYCLASS)); + ::SetPriorityClass(hProcess, (DWORD)GetConfig().get_signed_num(PP_PPROCESSPRIORITYCLASS)); break; } case WM_GETCONFIG: { - icpf::config* pConfig = GetConfig(); - assert(pConfig); + icpf::config& rConfig = GetConfig(); // std config values - g_pscsShared->bShowFreeSpace=pConfig->get_bool(PP_SHSHOWFREESPACE); + g_pscsShared->bShowFreeSpace=rConfig.get_bool(PP_SHSHOWFREESPACE); // experimental - doesn't work on all systems - g_pscsShared->bShowShortcutIcons=pConfig->get_bool(PP_SHSHOWSHELLICONS); - g_pscsShared->bOverrideDefault=pConfig->get_bool(PP_SHUSEDRAGDROP); // only for d&d - g_pscsShared->uiDefaultAction=(UINT)pConfig->get_signed_num(PP_SHDEFAULTACTION); + g_pscsShared->bShowShortcutIcons=rConfig.get_bool(PP_SHSHOWSHELLICONS); + g_pscsShared->bOverrideDefault=rConfig.get_bool(PP_SHUSEDRAGDROP); // only for d&d + g_pscsShared->uiDefaultAction=(UINT)rConfig.get_signed_num(PP_SHDEFAULTACTION); // sizes for (int i=0;i<6;i++) - _tcscpy(g_pscsShared->szSizes[i], GetResManager()->LoadString(IDS_BYTE_STRING+i)); + _tcscpy(g_pscsShared->szSizes[i], GetResManager().LoadString(IDS_BYTE_STRING+i)); // convert to list of _COMMAND's _COMMAND *pCommand = g_pscsShared->GetCommandsPtr(); @@ -1942,55 +1928,55 @@ { g_pscsShared->iCommandCount=3; g_pscsShared->iShortcutsCount=0; - g_pscsShared->uiFlags=(pConfig->get_bool(PP_SHSHOWCOPY) ? DD_COPY_FLAG : 0) - | (pConfig->get_bool(PP_SHSHOWMOVE) ? DD_MOVE_FLAG : 0) - | (pConfig->get_bool(PP_SHSHOWCOPYMOVE) ? DD_COPYMOVESPECIAL_FLAG : 0); + g_pscsShared->uiFlags=(rConfig.get_bool(PP_SHSHOWCOPY) ? DD_COPY_FLAG : 0) + | (rConfig.get_bool(PP_SHSHOWMOVE) ? DD_MOVE_FLAG : 0) + | (rConfig.get_bool(PP_SHSHOWCOPYMOVE) ? DD_COPYMOVESPECIAL_FLAG : 0); pCommand[0].uiCommandID=DD_COPY_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUCOPY_STRING, pCommand[0].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPCOPY_STRING, pCommand[0].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUCOPY_STRING, pCommand[0].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPCOPY_STRING, pCommand[0].szDesc, 128); pCommand[1].uiCommandID=DD_MOVE_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUMOVE_STRING, pCommand[1].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPMOVE_STRING, pCommand[1].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUMOVE_STRING, pCommand[1].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPMOVE_STRING, pCommand[1].szDesc, 128); pCommand[2].uiCommandID=DD_COPYMOVESPECIAL_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUCOPYMOVESPECIAL_STRING, pCommand[2].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPCOPYMOVESPECIAL_STRING, pCommand[2].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUCOPYMOVESPECIAL_STRING, pCommand[2].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPCOPYMOVESPECIAL_STRING, pCommand[2].szDesc, 128); } break; case GC_EXPLORER: { g_pscsShared->iCommandCount=5; - g_pscsShared->uiFlags=(pConfig->get_bool(PP_SHSHOWPASTE) ? EC_PASTE_FLAG : 0) - | (pConfig->get_bool(PP_SHSHOWPASTESPECIAL) ? EC_PASTESPECIAL_FLAG : 0) - | (pConfig->get_bool(PP_SHSHOWCOPYTO) ? EC_COPYTO_FLAG : 0) - | (pConfig->get_bool(PP_SHSHOWMOVETO) ? EC_MOVETO_FLAG : 0) - | (pConfig->get_bool(PP_SHSHOWCOPYMOVETO) ? EC_COPYMOVETOSPECIAL_FLAG : 0); + g_pscsShared->uiFlags=(rConfig.get_bool(PP_SHSHOWPASTE) ? EC_PASTE_FLAG : 0) + | (rConfig.get_bool(PP_SHSHOWPASTESPECIAL) ? EC_PASTESPECIAL_FLAG : 0) + | (rConfig.get_bool(PP_SHSHOWCOPYTO) ? EC_COPYTO_FLAG : 0) + | (rConfig.get_bool(PP_SHSHOWMOVETO) ? EC_MOVETO_FLAG : 0) + | (rConfig.get_bool(PP_SHSHOWCOPYMOVETO) ? EC_COPYMOVETOSPECIAL_FLAG : 0); pCommand[0].uiCommandID=EC_PASTE_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUPASTE_STRING, pCommand[0].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPPASTE_STRING, pCommand[0].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUPASTE_STRING, pCommand[0].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPPASTE_STRING, pCommand[0].szDesc, 128); pCommand[1].uiCommandID=EC_PASTESPECIAL_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUPASTESPECIAL_STRING, pCommand[1].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPPASTESPECIAL_STRING, pCommand[1].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUPASTESPECIAL_STRING, pCommand[1].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPPASTESPECIAL_STRING, pCommand[1].szDesc, 128); pCommand[2].uiCommandID=EC_COPYTO_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUCOPYTO_STRING, pCommand[2].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPCOPYTO_STRING, pCommand[2].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUCOPYTO_STRING, pCommand[2].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPCOPYTO_STRING, pCommand[2].szDesc, 128); pCommand[3].uiCommandID=EC_MOVETO_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUMOVETO_STRING, pCommand[3].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPMOVETO_STRING, pCommand[3].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUMOVETO_STRING, pCommand[3].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPMOVETO_STRING, pCommand[3].szDesc, 128); pCommand[4].uiCommandID=EC_COPYMOVETOSPECIAL_FLAG; - GetResManager()->LoadStringCopy(IDS_MENUCOPYMOVETOSPECIAL_STRING, pCommand[4].szCommand, 128); - GetResManager()->LoadStringCopy(IDS_MENUTIPCOPYMOVETOSPECIAL_STRING, pCommand[4].szDesc, 128); + GetResManager().LoadStringCopy(IDS_MENUCOPYMOVETOSPECIAL_STRING, pCommand[4].szCommand, 128); + GetResManager().LoadStringCopy(IDS_MENUTIPCOPYMOVETOSPECIAL_STRING, pCommand[4].szDesc, 128); // prepare shortcuts char_vector cvShortcuts; const tchar_t* pszPath = NULL; - size_t stCount = pConfig->get_value_count(PP_SHORTCUTS); + size_t stCount = rConfig.get_value_count(PP_SHORTCUTS); for(size_t stIndex = 0; stIndex < stCount; stIndex++) { - pszPath = pConfig->get_string(PP_SHORTCUTS, stIndex); + pszPath = rConfig.get_string(PP_SHORTCUTS, stIndex); if(pszPath) cvShortcuts.push_back(pszPath); } @@ -2077,23 +2063,23 @@ void CMainWnd::OnPopupMonitoring() { // change flag in config - GetConfig()->set_bool(PP_PCLIPBOARDMONITORING, !GetConfig()->get_bool(PP_PCLIPBOARDMONITORING)); - GetConfig()->write(NULL); + GetConfig().set_bool(PP_PCLIPBOARDMONITORING, !GetConfig().get_bool(PP_PCLIPBOARDMONITORING)); + GetConfig().write(NULL); } void CMainWnd::OnPopupShutafterfinished() { - GetConfig()->set_bool(PP_PSHUTDOWNAFTREFINISHED, !GetConfig()->get_bool(PP_PSHUTDOWNAFTREFINISHED)); - GetConfig()->write(NULL); + GetConfig().set_bool(PP_PSHUTDOWNAFTREFINISHED, !GetConfig().get_bool(PP_PSHUTDOWNAFTREFINISHED)); + GetConfig().write(NULL); } void CMainWnd::OnPopupRegisterdll() { CString strPath; - CCopyHandlerApp* pApp = GetApp(); - if(pApp) + CCopyHandlerApp& rApp = GetApp(); + if(rApp) { - strPath = pApp->GetProgramPath(); + strPath = rApp.GetProgramPath(); strPath += _T("\\"); } @@ -2110,7 +2096,7 @@ while (szStr[_tcslen(szStr)-1] == _T('\n') || szStr[_tcslen(szStr)-1] == _T('\r') || szStr[_tcslen(szStr)-1] == _T('.')) szStr[_tcslen(szStr)-1]=_T('\0'); - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_REGISTERERR_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_REGISTERERR_STRING)); fmt.SetParam(_T("%errno"), (ulong_t)hResult); fmt.SetParam(_T("%errdesc"), szStr); AfxMessageBox(fmt, MB_ICONERROR | MB_OK); @@ -2122,12 +2108,9 @@ void CMainWnd::OnPopupUnregisterdll() { CString strPath; - CCopyHandlerApp* pApp = GetApp(); - if(pApp) - { - strPath = pApp->GetProgramPath(); - strPath += _T("\\"); - } + CCopyHandlerApp& rApp = GetApp(); + strPath = rApp.GetProgramPath(); + strPath += _T("\\"); #ifdef _WIN64 strPath += _T("chext64.dll"); @@ -2143,7 +2126,7 @@ while (szStr[_tcslen(szStr)-1] == _T('\n') || szStr[_tcslen(szStr)-1] == _T('\r') || szStr[_tcslen(szStr)-1] == _T('.')) szStr[_tcslen(szStr)-1]=_T('\0'); - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_UNREGISTERERR_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_UNREGISTERERR_STRING)); fmt.SetParam(_T("%errno"), (ulong_t)hResult); fmt.SetParam(_T("%errdesc"), szStr); @@ -2190,7 +2173,7 @@ void CMainWnd::OnPopupHelp() { - GetApp()->HtmlHelp(HH_DISPLAY_TOPIC, NULL); + GetApp().HtmlHelp(HH_DISPLAY_TOPIC, NULL); } void CMainWnd::OnPopupCheckForUpdates() Index: src/ch/MiniViewDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -130,7 +130,7 @@ RefreshStatus(); - SetTimer(9843, GetConfig()->get_signed_num(PP_MVREFRESHINTERVAL), NULL); + SetTimer(9843, GetConfig().get_signed_num(PP_MVREFRESHINTERVAL), NULL); } CLanguageDialog::OnTimer(nIDEvent); @@ -178,7 +178,7 @@ int index=0; _PROGRESSITEM_* pItem=NULL; - if (GetConfig()->get_bool(PP_MVSHOWSINGLETASKS)) + if (GetConfig().get_bool(PP_MVSHOWSINGLETASKS)) { for (int i=0;iGetSize();i++) { @@ -212,10 +212,10 @@ { if (m_bShown) { - if (GetConfig()->get_bool(PP_MVAUTOHIDEWHENEMPTY) || *m_pbHide) + if (GetConfig().get_bool(PP_MVAUTOHIDEWHENEMPTY) || *m_pbHide) HideWindow(); } - else if (!GetConfig()->get_bool(PP_MVAUTOHIDEWHENEMPTY) && !(*m_pbHide)) + else if (!GetConfig().get_bool(PP_MVAUTOHIDEWHENEMPTY) && !(*m_pbHide)) { // need to be visible ShowWindow(); @@ -242,15 +242,15 @@ // add all state pItem=m_ctlStatus.GetItemAddress(index++); pItem->m_crColor=GetSysColor(COLOR_HIGHLIGHT); - pItem->m_strText=GetResManager()->LoadString(IDS_MINIVIEWALL_STRING); + pItem->m_strText=GetResManager().LoadString(IDS_MINIVIEWALL_STRING); pItem->m_uiPos=m_pTasks->GetPercent(); pItem->m_pTask=NULL; // get rid of the rest - m_ctlStatus.SetSmoothProgress(GetConfig()->get_bool(PP_MVUSESMOOTHPROGRESS)); + m_ctlStatus.SetSmoothProgress(GetConfig().get_bool(PP_MVUSESMOOTHPROGRESS)); m_ctlStatus.UpdateItems(index, true); - m_ctlStatus.SetShowCaptions(GetConfig()->get_bool(PP_MVSHOWFILENAMES)); + m_ctlStatus.SetShowCaptions(GetConfig().get_bool(PP_MVSHOWFILENAMES)); // calc size RecalcSize(0, bInitial); @@ -267,7 +267,7 @@ RefreshStatus(); // set refresh timer - SetTimer(9843, GetConfig()->get_signed_num(PP_MVREFRESHINTERVAL), NULL); + SetTimer(9843, GetConfig().get_signed_num(PP_MVREFRESHINTERVAL), NULL); return static_cast(0); } Index: src/ch/OptionsDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -75,10 +75,10 @@ m_ctlProperties.AddString(text, ID_PROPERTY_COMBO_LIST, prop_text, (int)((value))); #define PROP_DIR(text, prop_text, value)\ - m_ctlProperties.AddString(text, ID_PROPERTY_DIR, (value)+CString(GetResManager()->LoadString(prop_text)), 0); + m_ctlProperties.AddString(text, ID_PROPERTY_DIR, (value)+CString(GetResManager().LoadString(prop_text)), 0); #define PROP_PATH(text, prop_text, value)\ - m_ctlProperties.AddString(text, ID_PROPERTY_PATH, (value)+CString(GetResManager()->LoadString(prop_text)), 0); + m_ctlProperties.AddString(text, ID_PROPERTY_PATH, (value)+CString(GetResManager().LoadString(prop_text)), 0); #define PROP_CUSTOM_UINT(text, value, callback, param)\ m_ctlProperties.AddString(text, ID_PROPERTY_CUSTOM, CString(_itot((int)(value), m_szBuffer, 10)), callback, this, param, 0); @@ -93,34 +93,31 @@ m_ctlProperties.Init(); // copy shortcut and recent paths - icpf::config* pConfig = GetConfig(); - assert(pConfig); - if(!pConfig) - return FALSE; + icpf::config& rConfig = GetConfig(); m_cvRecent.clear(true); - size_t stSize = pConfig->get_value_count(PP_RECENTPATHS); + size_t stSize = rConfig.get_value_count(PP_RECENTPATHS); const tchar_t* pszPath = NULL; for(size_t stIndex = 0; stIndex < stSize; stIndex++) { - pszPath = pConfig->get_string(PP_RECENTPATHS, stIndex); + pszPath = rConfig.get_string(PP_RECENTPATHS, stIndex); if(pszPath) m_cvRecent.push_back(pszPath); } m_cvShortcuts.clear(true); - stSize = pConfig->get_value_count(PP_SHORTCUTS); + stSize = rConfig.get_value_count(PP_SHORTCUTS); for(size_t stIndex = 0; stIndex < stSize; stIndex++) { - pszPath = pConfig->get_string(PP_SHORTCUTS, stIndex); + pszPath = rConfig.get_string(PP_SHORTCUTS, stIndex); if(pszPath) m_cvShortcuts.push_back(pszPath); } _tcscpy(m_szLangPath, _T("\\Langs\\")); - GetApp()->ExpandPath(m_szLangPath); + GetApp().ExpandPath(m_szLangPath); - GetResManager()->Scan(m_szLangPath, &m_vld); + GetResManager().Scan(m_szLangPath, &m_vld); // some attributes m_ctlProperties.SetBkColor(RGB(255, 255, 255)); @@ -227,14 +224,14 @@ // load settings PROP_SEPARATOR(IDS_PROGRAM_STRING) - PROP_BOOL(IDS_CLIPBOARDMONITORING_STRING, GetConfig()->get_bool(PP_PCLIPBOARDMONITORING)) - PROP_UINT(IDS_CLIPBOARDINTERVAL_STRING, GetConfig()->get_signed_num(PP_PMONITORSCANINTERVAL)) - PROP_BOOL(IDS_AUTORUNPROGRAM_STRING, GetConfig()->get_bool(PP_PRELOADAFTERRESTART)) - PROP_BOOL(IDS_AUTOSHUTDOWN_STRING, GetConfig()->get_bool(PP_PSHUTDOWNAFTREFINISHED)) - PROP_UINT(IDS_SHUTDOWNTIME_STRING, GetConfig()->get_signed_num(PP_PTIMEBEFORESHUTDOWN)) - PROP_COMBO(IDS_FORCESHUTDOWN_STRING, IDS_FORCESHUTDOWNVALUES_STRING, GetConfig()->get_bool(PP_PFORCESHUTDOWN)) - PROP_UINT(IDS_AUTOSAVEINTERVAL_STRING, GetConfig()->get_signed_num(PP_PAUTOSAVEINTERVAL)) - PROP_COMBO(IDS_CFGPRIORITYCLASS_STRING, IDS_CFGPRIORITYCLASSITEMS_STRING, PriorityClassToIndex(GetConfig()->get_signed_num(PP_PPROCESSPRIORITYCLASS))) + PROP_BOOL(IDS_CLIPBOARDMONITORING_STRING, GetConfig().get_bool(PP_PCLIPBOARDMONITORING)) + PROP_UINT(IDS_CLIPBOARDINTERVAL_STRING, GetConfig().get_signed_num(PP_PMONITORSCANINTERVAL)) + PROP_BOOL(IDS_AUTORUNPROGRAM_STRING, GetConfig().get_bool(PP_PRELOADAFTERRESTART)) + PROP_BOOL(IDS_AUTOSHUTDOWN_STRING, GetConfig().get_bool(PP_PSHUTDOWNAFTREFINISHED)) + PROP_UINT(IDS_SHUTDOWNTIME_STRING, GetConfig().get_signed_num(PP_PTIMEBEFORESHUTDOWN)) + PROP_COMBO(IDS_FORCESHUTDOWN_STRING, IDS_FORCESHUTDOWNVALUES_STRING, GetConfig().get_bool(PP_PFORCESHUTDOWN)) + PROP_UINT(IDS_AUTOSAVEINTERVAL_STRING, GetConfig().get_signed_num(PP_PAUTOSAVEINTERVAL)) + PROP_COMBO(IDS_CFGPRIORITYCLASS_STRING, IDS_CFGPRIORITYCLASSITEMS_STRING, PriorityClassToIndex(GetConfig().get_signed_num(PP_PPROCESSPRIORITYCLASS))) PROP_DIR(IDS_TEMPFOLDER_STRING, IDS_TEMPFOLDERCHOOSE_STRING, strPath) // lang @@ -244,7 +241,7 @@ { strLangs+=(*it).GetLangName(); strLangs+=_T("!"); - if (_tcsicmp((*it).GetFilename(true), GetResManager()->m_ld.GetFilename(true)) == 0) + if (_tcsicmp((*it).GetFilename(true), GetResManager().m_ld.GetFilename(true)) == 0) uiIndex=it-m_vld.begin(); } strLangs.TrimRight(_T('!')); @@ -253,75 +250,75 @@ ///////////////// PROP_SEPARATOR(IDS_STATUSWINDOW_STRING); - PROP_UINT(IDS_REFRESHSTATUSINTERVAL_STRING, GetConfig()->get_signed_num(PP_STATUSREFRESHINTERVAL)) - PROP_BOOL(IDS_STATUSSHOWDETAILS_STRING, GetConfig()->get_bool(PP_STATUSSHOWDETAILS)) - PROP_BOOL(IDS_STATUSAUTOREMOVE_STRING, GetConfig()->get_bool(PP_STATUSAUTOREMOVEFINISHED)) + PROP_UINT(IDS_REFRESHSTATUSINTERVAL_STRING, GetConfig().get_signed_num(PP_STATUSREFRESHINTERVAL)) + PROP_BOOL(IDS_STATUSSHOWDETAILS_STRING, GetConfig().get_bool(PP_STATUSSHOWDETAILS)) + PROP_BOOL(IDS_STATUSAUTOREMOVE_STRING, GetConfig().get_bool(PP_STATUSAUTOREMOVEFINISHED)) PROP_SEPARATOR(IDS_MINIVIEW_STRING) - PROP_BOOL(IDS_SHOWFILENAMES_STRING, GetConfig()->get_bool(PP_MVSHOWFILENAMES)) - PROP_BOOL(IDS_SHOWSINGLETASKS_STRING, GetConfig()->get_bool(PP_MVSHOWSINGLETASKS)) - PROP_UINT(IDS_MINIVIEWREFRESHINTERVAL_STRING, GetConfig()->get_signed_num(PP_MVREFRESHINTERVAL)) - PROP_BOOL(IDS_MINIVIEWSHOWAFTERSTART_STRING, GetConfig()->get_bool(PP_MVAUTOSHOWWHENRUN)) - PROP_BOOL(IDS_MINIVIEWAUTOHIDE_STRING, GetConfig()->get_bool(PP_MVAUTOHIDEWHENEMPTY)) - PROP_BOOL(IDS_MINIVIEWSMOOTHPROGRESS_STRING, GetConfig()->get_bool(PP_MVUSESMOOTHPROGRESS)) + PROP_BOOL(IDS_SHOWFILENAMES_STRING, GetConfig().get_bool(PP_MVSHOWFILENAMES)) + PROP_BOOL(IDS_SHOWSINGLETASKS_STRING, GetConfig().get_bool(PP_MVSHOWSINGLETASKS)) + PROP_UINT(IDS_MINIVIEWREFRESHINTERVAL_STRING, GetConfig().get_signed_num(PP_MVREFRESHINTERVAL)) + PROP_BOOL(IDS_MINIVIEWSHOWAFTERSTART_STRING, GetConfig().get_bool(PP_MVAUTOSHOWWHENRUN)) + PROP_BOOL(IDS_MINIVIEWAUTOHIDE_STRING, GetConfig().get_bool(PP_MVAUTOHIDEWHENEMPTY)) + PROP_BOOL(IDS_MINIVIEWSMOOTHPROGRESS_STRING, GetConfig().get_bool(PP_MVUSESMOOTHPROGRESS)) PROP_SEPARATOR(IDS_CFGFOLDERDIALOG_STRING) - PROP_BOOL(IDS_CFGFDEXTVIEW_STRING, GetConfig()->get_bool(PP_FDEXTENDEDVIEW)) - PROP_UINT(IDS_CFGFDWIDTH_STRING, GetConfig()->get_signed_num(PP_FDWIDTH)) - PROP_UINT(IDS_CFGFDHEIGHT_STRING, GetConfig()->get_signed_num(PP_FDHEIGHT)) - PROP_COMBO(IDS_CFGFDSHORTCUTS_STRING, IDS_CFGFDSHORTCUTSSTYLES_STRING, GetConfig()->get_signed_num(PP_FDSHORTCUTLISTSTYLE)) - PROP_BOOL(IDS_CFGFDIGNOREDIALOGS_STRING, GetConfig()->get_bool(PP_FDIGNORESHELLDIALOGS)) + PROP_BOOL(IDS_CFGFDEXTVIEW_STRING, GetConfig().get_bool(PP_FDEXTENDEDVIEW)) + PROP_UINT(IDS_CFGFDWIDTH_STRING, GetConfig().get_signed_num(PP_FDWIDTH)) + PROP_UINT(IDS_CFGFDHEIGHT_STRING, GetConfig().get_signed_num(PP_FDHEIGHT)) + PROP_COMBO(IDS_CFGFDSHORTCUTS_STRING, IDS_CFGFDSHORTCUTSSTYLES_STRING, GetConfig().get_signed_num(PP_FDSHORTCUTLISTSTYLE)) + PROP_BOOL(IDS_CFGFDIGNOREDIALOGS_STRING, GetConfig().get_bool(PP_FDIGNORESHELLDIALOGS)) PROP_SEPARATOR(IDS_CFGSHELL_STRING) - PROP_BOOL(IDS_CFGSHCOPY_STRING, GetConfig()->get_bool(PP_SHSHOWCOPY)) - PROP_BOOL(IDS_CFGSHMOVE_STRING, GetConfig()->get_bool(PP_SHSHOWMOVE)) - PROP_BOOL(IDS_CFGSHCMSPECIAL_STRING, GetConfig()->get_bool(PP_SHSHOWCOPYMOVE)) - PROP_BOOL(IDS_CFGSHPASTE_STRING, GetConfig()->get_bool(PP_SHSHOWPASTE)) - PROP_BOOL(IDS_CFGSHPASTESPECIAL_STRING, GetConfig()->get_bool(PP_SHSHOWPASTESPECIAL)) - PROP_BOOL(IDS_CFGSHCOPYTO_STRING, GetConfig()->get_bool(PP_SHSHOWCOPYTO)) - PROP_BOOL(IDS_CFGSHMOVETO_STRING, GetConfig()->get_bool(PP_SHSHOWMOVETO)) - PROP_BOOL(IDS_CFGSHCMTOSPECIAL_STRING, GetConfig()->get_bool(PP_SHSHOWCOPYMOVETO)) - PROP_BOOL(IDS_CFGSHSHOWFREESPACE_STRING, GetConfig()->get_bool(PP_SHSHOWFREESPACE)) - PROP_BOOL(IDS_CFGSHSHOWICONS_STRING, GetConfig()->get_bool(PP_SHSHOWSHELLICONS)) - PROP_BOOL(IDS_CFGSHOVERRIDEDRAG_STRING, GetConfig()->get_bool(PP_SHUSEDRAGDROP)) - PROP_COMBO(IDS_CFGOVERRIDEDEFACTION_STRING, IDS_CFGACTIONS_STRING, GetConfig()->get_signed_num(PP_SHDEFAULTACTION)); + PROP_BOOL(IDS_CFGSHCOPY_STRING, GetConfig().get_bool(PP_SHSHOWCOPY)) + PROP_BOOL(IDS_CFGSHMOVE_STRING, GetConfig().get_bool(PP_SHSHOWMOVE)) + PROP_BOOL(IDS_CFGSHCMSPECIAL_STRING, GetConfig().get_bool(PP_SHSHOWCOPYMOVE)) + PROP_BOOL(IDS_CFGSHPASTE_STRING, GetConfig().get_bool(PP_SHSHOWPASTE)) + PROP_BOOL(IDS_CFGSHPASTESPECIAL_STRING, GetConfig().get_bool(PP_SHSHOWPASTESPECIAL)) + PROP_BOOL(IDS_CFGSHCOPYTO_STRING, GetConfig().get_bool(PP_SHSHOWCOPYTO)) + PROP_BOOL(IDS_CFGSHMOVETO_STRING, GetConfig().get_bool(PP_SHSHOWMOVETO)) + PROP_BOOL(IDS_CFGSHCMTOSPECIAL_STRING, GetConfig().get_bool(PP_SHSHOWCOPYMOVETO)) + PROP_BOOL(IDS_CFGSHSHOWFREESPACE_STRING, GetConfig().get_bool(PP_SHSHOWFREESPACE)) + PROP_BOOL(IDS_CFGSHSHOWICONS_STRING, GetConfig().get_bool(PP_SHSHOWSHELLICONS)) + PROP_BOOL(IDS_CFGSHOVERRIDEDRAG_STRING, GetConfig().get_bool(PP_SHUSEDRAGDROP)) + PROP_COMBO(IDS_CFGOVERRIDEDEFACTION_STRING, IDS_CFGACTIONS_STRING, GetConfig().get_signed_num(PP_SHDEFAULTACTION)); PROP_SEPARATOR(IDS_PROCESSINGTHREAD_STRING) - PROP_BOOL(IDS_AUTOCOPYREST_STRING, GetConfig()->get_bool(PP_CMUSEAUTOCOMPLETEFILES)) - PROP_BOOL(IDS_SETDESTATTRIB_STRING, GetConfig()->get_bool(PP_CMSETDESTATTRIBUTES)) - PROP_BOOL(IDS_SETDESTTIME_STRING, GetConfig()->get_bool(PP_CMSETDESTDATE)) - PROP_BOOL(IDS_PROTECTROFILES_STRING, GetConfig()->get_bool(PP_CMPROTECTROFILES)) - PROP_UINT(IDS_LIMITOPERATIONS_STRING, GetConfig()->get_signed_num(PP_CMLIMITMAXOPERATIONS)) - PROP_BOOL(IDS_READSIZEBEFOREBLOCK_STRING, GetConfig()->get_bool(PP_CMREADSIZEBEFOREBLOCKING)) - PROP_COMBO(IDS_SHOWVISUALFEEDBACK_STRING, IDS_FEEDBACKTYPE_STRING, GetConfig()->get_signed_num(PP_CMSHOWVISUALFEEDBACK)) - PROP_BOOL(IDS_USETIMEDDIALOGS_STRING, GetConfig()->get_bool(PP_CMUSETIMEDFEEDBACK)) - PROP_UINT(IDS_TIMEDDIALOGINTERVAL_STRING, GetConfig()->get_signed_num(PP_CMFEEDBACKTIME)) - PROP_BOOL(IDS_AUTORETRYONERROR_STRING, GetConfig()->get_bool(PP_CMAUTORETRYONERROR)) - PROP_UINT(IDS_AUTORETRYINTERVAL_STRING, GetConfig()->get_signed_num(PP_CMAUTORETRYINTERVAL)) - PROP_COMBO(IDS_DEFAULTPRIORITY_STRING, MakeCompoundString(IDS_PRIORITY0_STRING, 7, _T("!")), PriorityToIndex(GetConfig()->get_signed_num(PP_CMDEFAULTPRIORITY))) - PROP_BOOL(IDS_CFGDISABLEPRIORITYBOOST_STRING, GetConfig()->get_bool(PP_CMDISABLEPRIORITYBOOST)) - PROP_BOOL(IDS_DELETEAFTERFINISHED_STRING, GetConfig()->get_bool(PP_CMDELETEAFTERFINISHED)) - PROP_BOOL(IDS_CREATELOGFILES_STRING, GetConfig()->get_bool(PP_CMCREATELOG)) + PROP_BOOL(IDS_AUTOCOPYREST_STRING, GetConfig().get_bool(PP_CMUSEAUTOCOMPLETEFILES)) + PROP_BOOL(IDS_SETDESTATTRIB_STRING, GetConfig().get_bool(PP_CMSETDESTATTRIBUTES)) + PROP_BOOL(IDS_SETDESTTIME_STRING, GetConfig().get_bool(PP_CMSETDESTDATE)) + PROP_BOOL(IDS_PROTECTROFILES_STRING, GetConfig().get_bool(PP_CMPROTECTROFILES)) + PROP_UINT(IDS_LIMITOPERATIONS_STRING, GetConfig().get_signed_num(PP_CMLIMITMAXOPERATIONS)) + PROP_BOOL(IDS_READSIZEBEFOREBLOCK_STRING, GetConfig().get_bool(PP_CMREADSIZEBEFOREBLOCKING)) + PROP_COMBO(IDS_SHOWVISUALFEEDBACK_STRING, IDS_FEEDBACKTYPE_STRING, GetConfig().get_signed_num(PP_CMSHOWVISUALFEEDBACK)) + PROP_BOOL(IDS_USETIMEDDIALOGS_STRING, GetConfig().get_bool(PP_CMUSETIMEDFEEDBACK)) + PROP_UINT(IDS_TIMEDDIALOGINTERVAL_STRING, GetConfig().get_signed_num(PP_CMFEEDBACKTIME)) + PROP_BOOL(IDS_AUTORETRYONERROR_STRING, GetConfig().get_bool(PP_CMAUTORETRYONERROR)) + PROP_UINT(IDS_AUTORETRYINTERVAL_STRING, GetConfig().get_signed_num(PP_CMAUTORETRYINTERVAL)) + PROP_COMBO(IDS_DEFAULTPRIORITY_STRING, MakeCompoundString(IDS_PRIORITY0_STRING, 7, _T("!")), PriorityToIndex(GetConfig().get_signed_num(PP_CMDEFAULTPRIORITY))) + PROP_BOOL(IDS_CFGDISABLEPRIORITYBOOST_STRING, GetConfig().get_bool(PP_CMDISABLEPRIORITYBOOST)) + PROP_BOOL(IDS_DELETEAFTERFINISHED_STRING, GetConfig().get_bool(PP_CMDELETEAFTERFINISHED)) + PROP_BOOL(IDS_CREATELOGFILES_STRING, GetConfig().get_bool(PP_CMCREATELOG)) // Buffer PROP_SEPARATOR(IDS_OPTIONSBUFFER_STRING) - PROP_BOOL(IDS_AUTODETECTBUFFERSIZE_STRING, GetConfig()->get_bool(PP_BFUSEONLYDEFAULT)) - PROP_CUSTOM_UINT(IDS_DEFAULTBUFFERSIZE_STRING, GetConfig()->get_signed_num(PP_BFDEFAULT), &CustomPropertyCallbackProc, 0) - PROP_CUSTOM_UINT(IDS_ONEDISKBUFFERSIZE_STRING, GetConfig()->get_signed_num(PP_BFONEDISK), &CustomPropertyCallbackProc, 1) - PROP_CUSTOM_UINT(IDS_TWODISKSBUFFERSIZE_STRING, GetConfig()->get_signed_num(PP_BFTWODISKS), &CustomPropertyCallbackProc, 2) - PROP_CUSTOM_UINT(IDS_CDBUFFERSIZE_STRING, GetConfig()->get_signed_num(PP_BFCD), &CustomPropertyCallbackProc, 3) - PROP_CUSTOM_UINT(IDS_LANBUFFERSIZE_STRING, GetConfig()->get_signed_num(PP_BFLAN), &CustomPropertyCallbackProc, 4) - PROP_BOOL(IDS_USENOBUFFERING_STRING, GetConfig()->get_bool(PP_BFUSENOBUFFERING)) - PROP_UINT(IDS_LARGEFILESMINSIZE_STRING, GetConfig()->get_signed_num(PP_BFBOUNDARYLIMIT)) + PROP_BOOL(IDS_AUTODETECTBUFFERSIZE_STRING, GetConfig().get_bool(PP_BFUSEONLYDEFAULT)) + PROP_CUSTOM_UINT(IDS_DEFAULTBUFFERSIZE_STRING, GetConfig().get_signed_num(PP_BFDEFAULT), &CustomPropertyCallbackProc, 0) + PROP_CUSTOM_UINT(IDS_ONEDISKBUFFERSIZE_STRING, GetConfig().get_signed_num(PP_BFONEDISK), &CustomPropertyCallbackProc, 1) + PROP_CUSTOM_UINT(IDS_TWODISKSBUFFERSIZE_STRING, GetConfig().get_signed_num(PP_BFTWODISKS), &CustomPropertyCallbackProc, 2) + PROP_CUSTOM_UINT(IDS_CDBUFFERSIZE_STRING, GetConfig().get_signed_num(PP_BFCD), &CustomPropertyCallbackProc, 3) + PROP_CUSTOM_UINT(IDS_LANBUFFERSIZE_STRING, GetConfig().get_signed_num(PP_BFLAN), &CustomPropertyCallbackProc, 4) + PROP_BOOL(IDS_USENOBUFFERING_STRING, GetConfig().get_bool(PP_BFUSENOBUFFERING)) + PROP_UINT(IDS_LARGEFILESMINSIZE_STRING, GetConfig().get_signed_num(PP_BFBOUNDARYLIMIT)) // Sounds PROP_SEPARATOR(IDS_SOUNDS_STRING) - PROP_BOOL(IDS_PLAYSOUNDS_STRING, GetConfig()->get_bool(PP_SNDPLAYSOUNDS)) - GetConfig()->get_string(PP_SNDERRORSOUNDPATH, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + PROP_BOOL(IDS_PLAYSOUNDS_STRING, GetConfig().get_bool(PP_SNDPLAYSOUNDS)) + GetConfig().get_string(PP_SNDERRORSOUNDPATH, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); strPath.ReleaseBuffer(); PROP_PATH(IDS_SOUNDONERROR_STRING, IDS_SOUNDSWAVFILTER_STRING, strPath) - GetConfig()->get_string(PP_SNDFINISHEDSOUNDPATH, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + GetConfig().get_string(PP_SNDFINISHEDSOUNDPATH, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); strPath.ReleaseBuffer(); PROP_PATH(IDS_SOUNDONFINISH_STRING, IDS_SOUNDSWAVFILTER_STRING, strPath) @@ -332,105 +329,102 @@ PROP_CUSTOM_UINT(IDS_CFGRPCOUNT_STRING, m_cvRecent.size(), &RecentPropertyCallbackProc, 0) /* PROP_SEPARATOR(IDS_CFGLOGFILE_STRING) - PROP_BOOL(IDS_CFGENABLELOGGING_STRING, GetConfig()->get_bool(PP_LOGENABLELOGGING)) - PROP_BOOL(IDS_CFGLIMITATION_STRING, GetConfig()->get_bool(PP_LOGLIMITATION)) - PROP_UINT(IDS_CFGMAXLIMIT_STRING, GetConfig()->get_signed_num(PP_LOGMAXLIMIT)) - PROP_BOOL(IDS_CFGLOGPRECISELIMITING_STRING, GetConfig()->get_bool(PP_LOGPRECISELIMITING)) - PROP_UINT(IDS_CFGTRUNCBUFFERSIZE_STRING, GetConfig()->get_signed_num(PP_LOGTRUNCBUFFERSIZE))*/ + PROP_BOOL(IDS_CFGENABLELOGGING_STRING, GetConfig().get_bool(PP_LOGENABLELOGGING)) + PROP_BOOL(IDS_CFGLIMITATION_STRING, GetConfig().get_bool(PP_LOGLIMITATION)) + PROP_UINT(IDS_CFGMAXLIMIT_STRING, GetConfig().get_signed_num(PP_LOGMAXLIMIT)) + PROP_BOOL(IDS_CFGLOGPRECISELIMITING_STRING, GetConfig().get_bool(PP_LOGPRECISELIMITING)) + PROP_UINT(IDS_CFGTRUNCBUFFERSIZE_STRING, GetConfig().get_signed_num(PP_LOGTRUNCBUFFERSIZE))*/ } void COptionsDlg::ApplyProperties() { // counter int iPosition=0; - icpf::config* pConfig = GetConfig(); - assert(pConfig); - if(!pConfig) - return; + icpf::config& rConfig = GetConfig(); SKIP_SEPARATOR(iPosition) - pConfig->set_bool(PP_PCLIPBOARDMONITORING, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_PMONITORSCANINTERVAL, GetUintProp(iPosition++)); - pConfig->set_bool(PP_PRELOADAFTERRESTART, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_PSHUTDOWNAFTREFINISHED, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_PTIMEBEFORESHUTDOWN, GetUintProp(iPosition++)); - pConfig->set_bool(PP_PFORCESHUTDOWN, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_PAUTOSAVEINTERVAL, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_PPROCESSPRIORITYCLASS, IndexToPriorityClass(GetIndexProp(iPosition++))); + rConfig.set_bool(PP_PCLIPBOARDMONITORING, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_PMONITORSCANINTERVAL, GetUintProp(iPosition++)); + rConfig.set_bool(PP_PRELOADAFTERRESTART, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_PSHUTDOWNAFTREFINISHED, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_PTIMEBEFORESHUTDOWN, GetUintProp(iPosition++)); + rConfig.set_bool(PP_PFORCESHUTDOWN, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_PAUTOSAVEINTERVAL, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_PPROCESSPRIORITYCLASS, IndexToPriorityClass(GetIndexProp(iPosition++))); // language PCTSTR pszSrc=m_vld.at(GetIndexProp(iPosition++)).GetFilename(true); - if (_tcsnicmp(pszSrc, GetApp()->GetProgramPath(), _tcslen(GetApp()->GetProgramPath())) == 0) + if (_tcsnicmp(pszSrc, GetApp().GetProgramPath(), _tcslen(GetApp().GetProgramPath())) == 0) { // replace the first part of path with TCHAR szData[_MAX_PATH]; - _sntprintf(szData, _MAX_PATH, _T("%s"), pszSrc+_tcslen(GetApp()->GetProgramPath())); - pConfig->set_string(PP_PLANGUAGE, szData); + _sntprintf(szData, _MAX_PATH, _T("%s"), pszSrc+_tcslen(GetApp().GetProgramPath())); + rConfig.set_string(PP_PLANGUAGE, szData); } else - pConfig->set_string(PP_PLANGUAGE, pszSrc); + rConfig.set_string(PP_PLANGUAGE, pszSrc); SKIP_SEPARATOR(iPosition) - pConfig->set_signed_num(PP_STATUSREFRESHINTERVAL, GetUintProp(iPosition++)); - pConfig->set_bool(PP_STATUSSHOWDETAILS, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_STATUSAUTOREMOVEFINISHED, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_STATUSREFRESHINTERVAL, GetUintProp(iPosition++)); + rConfig.set_bool(PP_STATUSSHOWDETAILS, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_STATUSAUTOREMOVEFINISHED, GetBoolProp(iPosition++)); SKIP_SEPARATOR(iPosition) - pConfig->set_bool(PP_MVSHOWFILENAMES, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_MVSHOWSINGLETASKS, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_MVREFRESHINTERVAL, GetUintProp(iPosition++)); - pConfig->set_bool(PP_MVAUTOSHOWWHENRUN, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_MVAUTOHIDEWHENEMPTY, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_MVUSESMOOTHPROGRESS, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_MVSHOWFILENAMES, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_MVSHOWSINGLETASKS, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_MVREFRESHINTERVAL, GetUintProp(iPosition++)); + rConfig.set_bool(PP_MVAUTOSHOWWHENRUN, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_MVAUTOHIDEWHENEMPTY, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_MVUSESMOOTHPROGRESS, GetBoolProp(iPosition++)); SKIP_SEPARATOR(iPosition) - pConfig->set_bool(PP_FDEXTENDEDVIEW, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_FDWIDTH, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_FDHEIGHT, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_FDSHORTCUTLISTSTYLE, GetIndexProp(iPosition++)); - pConfig->set_bool(PP_FDIGNORESHELLDIALOGS, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_FDEXTENDEDVIEW, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_FDWIDTH, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_FDHEIGHT, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_FDSHORTCUTLISTSTYLE, GetIndexProp(iPosition++)); + rConfig.set_bool(PP_FDIGNORESHELLDIALOGS, GetBoolProp(iPosition++)); SKIP_SEPARATOR(iPosition) - pConfig->set_bool(PP_SHSHOWCOPY, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWMOVE, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWCOPYMOVE, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWPASTE, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWPASTESPECIAL, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWCOPYTO, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWMOVETO, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWCOPYMOVETO, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWFREESPACE, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHSHOWSHELLICONS, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_SHUSEDRAGDROP, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_SHDEFAULTACTION, GetIndexProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWCOPY, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWMOVE, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWCOPYMOVE, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWPASTE, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWPASTESPECIAL, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWCOPYTO, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWMOVETO, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWCOPYMOVETO, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWFREESPACE, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHSHOWSHELLICONS, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_SHUSEDRAGDROP, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_SHDEFAULTACTION, GetIndexProp(iPosition++)); SKIP_SEPARATOR(iPosition) - pConfig->set_bool(PP_CMUSEAUTOCOMPLETEFILES, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_CMSETDESTATTRIBUTES, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_CMSETDESTDATE, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_CMPROTECTROFILES, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_CMLIMITMAXOPERATIONS, GetUintProp(iPosition++)); - pConfig->set_bool(PP_CMREADSIZEBEFOREBLOCKING, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_CMSHOWVISUALFEEDBACK, GetIndexProp(iPosition++)); - pConfig->set_bool(PP_CMUSETIMEDFEEDBACK, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_CMFEEDBACKTIME, GetUintProp(iPosition++)); - pConfig->set_bool(PP_CMAUTORETRYONERROR, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_CMAUTORETRYINTERVAL, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_CMDEFAULTPRIORITY, IndexToPriority(GetIndexProp(iPosition++))); - pConfig->set_bool(PP_CMDISABLEPRIORITYBOOST, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_CMDELETEAFTERFINISHED, GetBoolProp(iPosition++)); - pConfig->set_bool(PP_CMCREATELOG, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_CMUSEAUTOCOMPLETEFILES, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_CMSETDESTATTRIBUTES, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_CMSETDESTDATE, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_CMPROTECTROFILES, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_CMLIMITMAXOPERATIONS, GetUintProp(iPosition++)); + rConfig.set_bool(PP_CMREADSIZEBEFOREBLOCKING, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_CMSHOWVISUALFEEDBACK, GetIndexProp(iPosition++)); + rConfig.set_bool(PP_CMUSETIMEDFEEDBACK, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_CMFEEDBACKTIME, GetUintProp(iPosition++)); + rConfig.set_bool(PP_CMAUTORETRYONERROR, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_CMAUTORETRYINTERVAL, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_CMDEFAULTPRIORITY, IndexToPriority(GetIndexProp(iPosition++))); + rConfig.set_bool(PP_CMDISABLEPRIORITYBOOST, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_CMDELETEAFTERFINISHED, GetBoolProp(iPosition++)); + rConfig.set_bool(PP_CMCREATELOG, GetBoolProp(iPosition++)); // Buffer SKIP_SEPARATOR(iPosition) - pConfig->set_bool(PP_BFUSEONLYDEFAULT, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_BFDEFAULT, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_BFONEDISK, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_BFTWODISKS, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_BFCD, GetUintProp(iPosition++)); - pConfig->set_signed_num(PP_BFLAN, GetUintProp(iPosition++)); - pConfig->set_bool(PP_BFUSENOBUFFERING, GetBoolProp(iPosition++)); - pConfig->set_signed_num(PP_BFBOUNDARYLIMIT, GetUintProp(iPosition++)); + rConfig.set_bool(PP_BFUSEONLYDEFAULT, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_BFDEFAULT, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_BFONEDISK, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_BFTWODISKS, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_BFCD, GetUintProp(iPosition++)); + rConfig.set_signed_num(PP_BFLAN, GetUintProp(iPosition++)); + rConfig.set_bool(PP_BFUSENOBUFFERING, GetBoolProp(iPosition++)); + rConfig.set_signed_num(PP_BFBOUNDARYLIMIT, GetUintProp(iPosition++)); // log file /* SKIP_SEPARATOR(iPosition) @@ -442,26 +436,26 @@ // Sounds SKIP_SEPARATOR(iPosition) - pConfig->set_bool(PP_SNDPLAYSOUNDS, GetBoolProp(iPosition++)); - pConfig->set_string(PP_SNDERRORSOUNDPATH, GetStringProp(iPosition++)); - pConfig->set_string(PP_SNDFINISHEDSOUNDPATH, GetStringProp(iPosition++)); + rConfig.set_bool(PP_SNDPLAYSOUNDS, GetBoolProp(iPosition++)); + rConfig.set_string(PP_SNDERRORSOUNDPATH, GetStringProp(iPosition++)); + rConfig.set_string(PP_SNDFINISHEDSOUNDPATH, GetStringProp(iPosition++)); // shortcuts & recent paths SKIP_SEPARATOR(iPosition) - pConfig->clear_array_values(PP_SHORTCUTS); + rConfig.clear_array_values(PP_SHORTCUTS); for(char_vector::iterator it = m_cvShortcuts.begin(); it != m_cvShortcuts.end(); it++) { - pConfig->set_string(PP_SHORTCUTS, (*it), icpf::property::action_add); + rConfig.set_string(PP_SHORTCUTS, (*it), icpf::property::action_add); } SKIP_SEPARATOR(iPosition) - pConfig->clear_array_values(PP_RECENTPATHS); + rConfig.clear_array_values(PP_RECENTPATHS); for(char_vector::iterator it = m_cvRecent.begin(); it != m_cvRecent.end(); it++) { - pConfig->set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); + rConfig.set_string(PP_RECENTPATHS, (*it), icpf::property::action_add); } - pConfig->write(NULL); + rConfig.write(NULL); } void COptionsDlg::OnCancel() @@ -480,11 +474,11 @@ assert(lpszSeparator); if(!lpszSeparator) return _T(""); - _tcscpy(m_szBuffer, GetResManager()->LoadString(uiBase+0)); + _tcscpy(m_szBuffer, GetResManager().LoadString(uiBase+0)); for (int i=1;iLoadString(uiBase+i)); + _tcscat(m_szBuffer, GetResManager().LoadString(uiBase+i)); } return CString((PCTSTR)m_szBuffer); Index: src/ch/PropertyListCtrl.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -756,7 +756,7 @@ BOOL CPropertyListCtrl::AddString(UINT nIDString) { - return AddString(GetResManager()->LoadString(nIDString)); + return AddString(GetResManager().LoadString(nIDString)); } BOOL CPropertyListCtrl::AddString(UINT nIDString, int nType, CString csData, void (*pfnCallback)(LPVOID, int, CPtrList*, int), LPVOID lpParam, int iParam, int nPropertySelected, int nAlignment, BOOL bComboEditable) @@ -766,7 +766,7 @@ return FALSE; // load string - const TCHAR *pszText=GetResManager()->LoadString(nIDString); + const TCHAR *pszText=GetResManager().LoadString(nIDString); // Create a new Structure to hold it PROPERTYITEM* pNewItem = new PROPERTYITEM; @@ -863,12 +863,12 @@ BOOL CPropertyListCtrl::AddString(UINT nIDString, int nType, UINT nIDData, int nPropertySelected, int nAlignment, BOOL bComboEditable) { - return AddString(GetResManager()->LoadString(nIDString), nType, GetResManager()->LoadString(nIDData), nPropertySelected, nAlignment, bComboEditable); + return AddString(GetResManager().LoadString(nIDString), nType, GetResManager().LoadString(nIDData), nPropertySelected, nAlignment, bComboEditable); } BOOL CPropertyListCtrl::AddString(UINT nIDString, int nType, CString csData, int nPropertySelected, int nAlignment, BOOL bComboEditable) { - return AddString(GetResManager()->LoadString(nIDString), nType, csData, nPropertySelected, nAlignment, bComboEditable); + return AddString(GetResManager().LoadString(nIDString), nType, csData, nPropertySelected, nAlignment, bComboEditable); } BOOL CPropertyListCtrl::AddString(CString csText, COLORREF crColor, int nAlignment) @@ -882,7 +882,7 @@ BOOL CPropertyListCtrl::AddString(UINT nIDString, COLORREF crColor, int nAlignment) { - return AddString(GetResManager()->LoadString(nIDString), crColor, nAlignment); + return AddString(GetResManager().LoadString(nIDString), crColor, nAlignment); } BOOL CPropertyListCtrl::AddString(CString csText, CFont* pFont, int nAlignment) @@ -896,7 +896,7 @@ BOOL CPropertyListCtrl::AddString(UINT nIDString, CFont* pFont, int nAlignment) { - return AddString(GetResManager()->LoadString(nIDString), pFont, nAlignment); + return AddString(GetResManager().LoadString(nIDString), pFont, nAlignment); } ///////////////////////////////////////////////////////////////////////////// Index: src/ch/RecentDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/RecentDlg.cpp (.../RecentDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/RecentDlg.cpp (.../RecentDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -107,7 +107,7 @@ void CRecentDlg::OnBrowseButton() { CString strPath; - if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + if (BrowseForFolder(GetResManager().LoadString(IDS_BROWSE_STRING), &strPath)) { m_strPath=strPath; UpdateData(FALSE); Index: src/ch/ReplacePathsDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/ReplacePathsDlg.cpp (.../ReplacePathsDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ReplacePathsDlg.cpp (.../ReplacePathsDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -95,7 +95,7 @@ void CReplacePathsDlg::OnBrowseButton() { CString strPath; - if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + if (BrowseForFolder(GetResManager().LoadString(IDS_BROWSE_STRING), &strPath)) { UpdateData(TRUE); m_strDest=strPath; Index: src/ch/ShortcutsDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -102,11 +102,11 @@ lvc.mask=LVCF_SUBITEM | LVCF_WIDTH | LVCF_TEXT; lvc.iSubItem=-1; lvc.cx=100; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_SHORTCUTNAME_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_SHORTCUTNAME_STRING); m_ctlShortcuts.InsertColumn(0, &lvc); lvc.iSubItem=0; lvc.cx=200; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_SHORTCUTPATH_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_SHORTCUTPATH_STRING); m_ctlShortcuts.InsertColumn(1, &lvc); // modify list style @@ -277,7 +277,7 @@ void CShortcutsDlg::OnBrowseButton() { CString strPath; - if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + if (BrowseForFolder(GetResManager().LoadString(IDS_BROWSE_STRING), &strPath)) SetComboPath(strPath); } Index: src/ch/StatusDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -110,25 +110,25 @@ lvc.mask=LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; lvc.fmt=LVCFMT_LEFT; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=-1; m_ctlStatusList.InsertColumn(1, &lvc); - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.3*iWidth); lvc.iSubItem=0; m_ctlStatusList.InsertColumn(2, &lvc); - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=1; m_ctlStatusList.InsertColumn(3, &lvc); - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.15*iWidth); lvc.iSubItem=2; @@ -171,7 +171,7 @@ }; // refresh data timer - SetTimer(777, (UINT)GetConfig()->get_signed_num(PP_STATUSREFRESHINTERVAL), NULL); + SetTimer(777, (UINT)GetConfig().get_signed_num(PP_STATUSREFRESHINTERVAL), NULL); return TRUE; } @@ -185,21 +185,21 @@ if (!bEnable) { // get rid of text id disabling - GetDlgItem(IDC_OPERATION_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYOPERATIONTEXT_STRING)); - GetDlgItem(IDC_SOURCE_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYSOURCETEXT_STRING)); - GetDlgItem(IDC_DESTINATION_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYDESTINATIONTEXT_STRING)); - GetDlgItem(IDC_BUFFERSIZE_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYBUFFERSIZETEXT_STRING)); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYPRIORITYTEXT_STRING)); + GetDlgItem(IDC_OPERATION_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYOPERATIONTEXT_STRING)); + GetDlgItem(IDC_SOURCE_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYSOURCETEXT_STRING)); + GetDlgItem(IDC_DESTINATION_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYDESTINATIONTEXT_STRING)); + GetDlgItem(IDC_BUFFERSIZE_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYBUFFERSIZETEXT_STRING)); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYPRIORITYTEXT_STRING)); - const TCHAR *pszText=GetResManager()->LoadString(IDS_EMPTYERRORTEXT_STRING); + const TCHAR *pszText=GetResManager().LoadString(IDS_EMPTYERRORTEXT_STRING); m_ctlErrors.GetWindowText(m_strTemp); if (m_strTemp != pszText) m_ctlErrors.SetWindowText(pszText); - GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYPROCESSEDTEXT_STRING)); - GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYTRANSFERTEXT_STRING)); - GetDlgItem(IDC_TIME_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYTIMETEXT_STRING)); - GetDlgItem(IDC_ASSOCIATEDFILES__STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYASSOCFILE_STRING)); + GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYPROCESSEDTEXT_STRING)); + GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYTRANSFERTEXT_STRING)); + GetDlgItem(IDC_TIME_STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYTIMETEXT_STRING)); + GetDlgItem(IDC_ASSOCIATEDFILES__STATIC)->SetWindowText(GetResManager().LoadString(IDS_EMPTYASSOCFILE_STRING)); m_ctlCurrentProgress.SetPos(0); } @@ -215,7 +215,7 @@ RefreshStatus(); // reenable - SetTimer(777, (UINT)GetConfig()->get_signed_num(PP_STATUSREFRESHINTERVAL), NULL); + SetTimer(777, (UINT)GetConfig().get_signed_num(PP_STATUSREFRESHINTERVAL), NULL); } CLanguageDialog::OnTimer(nIDEvent); @@ -268,7 +268,7 @@ m_ctlStatusList.SetItem(&lvi); // right side update - if (pTask == pSelectedItem && GetConfig()->get_bool(PP_STATUSSHOWDETAILS)) + if (pTask == pSelectedItem && GetConfig().get_bool(PP_STATUSSHOWDETAILS)) { // data that can be changed by a thread GetDlgItem(IDC_OPERATION_STATIC)->SetWindowText(td.m_szStatusText); // operation @@ -283,7 +283,7 @@ } else { - const TCHAR *pszText=GetResManager()->LoadString(IDS_EMPTYERRORTEXT_STRING); + const TCHAR *pszText=GetResManager().LoadString(IDS_EMPTYERRORTEXT_STRING); m_ctlErrors.GetWindowText(m_strTemp2); if (m_strTemp2 != pszText) @@ -295,7 +295,7 @@ m_strTemp=CString(m_szData); m_strTemp+=GetSizeString(td.m_ullProcessedSize, m_szData, _MAX_PATH)+CString(_T("/")); m_strTemp+=GetSizeString(td.m_ullSizeAll, m_szData, _MAX_PATH)+CString(_T(")")); - _sntprintf(m_szData, _MAX_PATH, _T(" (%s%d/%d)"), GetResManager()->LoadString(IDS_CURRENTPASS_STRING), td.m_ucCurrentCopy, td.m_ucCopies); + _sntprintf(m_szData, _MAX_PATH, _T(" (%s%d/%d)"), GetResManager().LoadString(IDS_CURRENTPASS_STRING), td.m_ucCurrentCopy, td.m_ucCopies); m_strTemp+=m_szData; GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(m_strTemp); @@ -309,7 +309,7 @@ m_strTemp=GetSizeString( 0ULL, m_szData, _MAX_PATH); // avg transfer - GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s (")+CString(GetResManager()->LoadString(IDS_AVERAGEWORD_STRING)) + GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s (")+CString(GetResManager().LoadString(IDS_AVERAGEWORD_STRING)) +CString(GetSizeString(td.m_lTimeElapsed ? td.m_ullProcessedSize/td.m_lTimeElapsed : 0, m_szData, _MAX_PATH))+_T("/s )") ); @@ -333,7 +333,7 @@ // if (pTask != m_pLastSelected) { GetDlgItem(IDC_DESTINATION_STATIC)->SetWindowText(td.m_pdpDestPath->GetPath()); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(td.m_nPriority))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(td.m_nPriority))); GetDlgItem(IDC_ASSOCIATEDFILES__STATIC)->SetWindowText(*td.m_pstrUniqueName+_T(".atd (.atp, .log)")); } @@ -385,7 +385,7 @@ void CStatusDlg::OnRollUnrollButton() { // change settings in config dialog - GetConfig()->set_bool(PP_STATUSSHOWDETAILS, !GetConfig()->get_bool(PP_STATUSSHOWDETAILS)); + GetConfig().set_bool(PP_STATUSSHOWDETAILS, !GetConfig().get_bool(PP_STATUSSHOWDETAILS)); ApplyDisplayDetails(); } @@ -397,7 +397,7 @@ SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen, 0); GetWindowRect(&rect); - bool bDetails=GetConfig()->get_bool(PP_STATUSSHOWDETAILS); + bool bDetails=GetConfig().get_bool(PP_STATUSSHOWDETAILS); // stick cause if (rect.right == rcScreen.right && rect.bottom == rcScreen.bottom) @@ -433,7 +433,7 @@ { // remember ptr to CTask pSelectedItem=GetSelectedItemPointer(); - bool bShowLog=GetConfig()->get_bool(PP_CMCREATELOG); + bool bShowLog=GetConfig().get_bool(PP_CMCREATELOG); // set status of buttons pause/resume/cancel if (pSelectedItem != NULL) @@ -483,7 +483,7 @@ void CStatusDlg::OnSetPriorityButton() { CMenu menu; - HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_PRIORITY_MENU)); + HMENU hMenu=GetResManager().LoadMenu(MAKEINTRESOURCE(IDR_PRIORITY_MENU)); if (!menu.Attach(hMenu)) { DestroyMenu(hMenu); @@ -516,31 +516,31 @@ { case ID_POPUP_TIME_CRITICAL: pSelectedItem->SetPriority(THREAD_PRIORITY_TIME_CRITICAL); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_TIME_CRITICAL))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_TIME_CRITICAL))); break; case ID_POPUP_HIGHEST: pSelectedItem->SetPriority(THREAD_PRIORITY_HIGHEST); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_HIGHEST))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_HIGHEST))); break; case ID_POPUP_ABOVE_NORMAL: pSelectedItem->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_ABOVE_NORMAL))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_ABOVE_NORMAL))); break; case ID_POPUP_NORMAL: pSelectedItem->SetPriority(THREAD_PRIORITY_NORMAL); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_NORMAL))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_NORMAL))); break; case ID_POPUP_BELOW_NORMAL: pSelectedItem->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_BELOW_NORMAL))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_BELOW_NORMAL))); break; case ID_POPUP_LOWEST: pSelectedItem->SetPriority(THREAD_PRIORITY_LOWEST); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_LOWEST))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_LOWEST))); break; case ID_POPUP_IDLE: pSelectedItem->SetPriority(THREAD_PRIORITY_IDLE); - GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_IDLE))); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_IDLE))); break; } } @@ -743,17 +743,17 @@ // set title if (m_pTasks->GetSize() != 0) - _sntprintf(m_szData, _MAX_PATH, _T("%s [%d %%]"), GetResManager()->LoadString(IDS_STATUSTITLE_STRING), m_pTasks->GetPercent()); + _sntprintf(m_szData, _MAX_PATH, _T("%s [%d %%]"), GetResManager().LoadString(IDS_STATUSTITLE_STRING), m_pTasks->GetPercent()); else - _sntprintf(m_szData, _MAX_PATH, _T("%s"), GetResManager()->LoadString(IDS_STATUSTITLE_STRING)); + _sntprintf(m_szData, _MAX_PATH, _T("%s"), GetResManager().LoadString(IDS_STATUSTITLE_STRING)); // if changed GetWindowText(m_strTemp); if (m_strTemp != CString(m_szData)) SetWindowText(m_szData); // refresh overall progress - if (GetConfig()->get_bool(PP_STATUSSHOWDETAILS)) + if (GetConfig().get_bool(PP_STATUSSHOWDETAILS)) { m_ctlProgressAll.SetPos(nPercent); @@ -805,7 +805,7 @@ void CStatusDlg::OnAdvancedButton() { CMenu menu; - HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_ADVANCED_MENU)); + HMENU hMenu=GetResManager().LoadMenu(MAKEINTRESOURCE(IDR_ADVANCED_MENU)); if (!menu.Attach(hMenu)) { DestroyMenu(hMenu); @@ -846,7 +846,7 @@ // change 'no case' int iClipboard=pSelectedItem->ReplaceClipboardStrings(dlg.m_strSource, dlg.m_strDest); - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_REPLACEPATHSTEXT_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_REPLACEPATHSTEXT_STRING)); fmt.SetParam(_t("%count"), iClipboard); AfxMessageBox(fmt); } @@ -866,7 +866,7 @@ { // show log CTask* pTask; - if ( (pTask=GetSelectedItemPointer()) == NULL || !GetConfig()->get_bool(PP_CMCREATELOG)) + if ( (pTask=GetSelectedItemPointer()) == NULL || !GetConfig().get_bool(PP_CMCREATELOG)) return; // call what's needed @@ -875,7 +875,7 @@ if (lResult < 32) { CString str=CString(pTask->GetTaskPath())+pTask->GetUniqueName()+_T(".log"); - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_SHELLEXECUTEERROR_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHELLEXECUTEERROR_STRING)); fmt.SetParam(_t("%errno"), lResult); fmt.SetParam(_t("%path"), str); AfxMessageBox(fmt); @@ -903,19 +903,19 @@ switch(iIndex) { case BI_DEFAULT: - GetResManager()->LoadStringCopy(IDS_BSDEFAULT_STRING, szData, 256); + GetResManager().LoadStringCopy(IDS_BSDEFAULT_STRING, szData, 256); break; case BI_ONEDISK: - GetResManager()->LoadStringCopy(IDS_BSONEDISK_STRING, szData, 256); + GetResManager().LoadStringCopy(IDS_BSONEDISK_STRING, szData, 256); break; case BI_TWODISKS: - GetResManager()->LoadStringCopy(IDS_BSTWODISKS_STRING, szData, 256); + GetResManager().LoadStringCopy(IDS_BSTWODISKS_STRING, szData, 256); break; case BI_CD: - GetResManager()->LoadStringCopy(IDS_BSCD_STRING, szData, 256); + GetResManager().LoadStringCopy(IDS_BSCD_STRING, szData, 256); break; case BI_LAN: - GetResManager()->LoadStringCopy(IDS_BSLAN_STRING, szData, 256); + GetResManager().LoadStringCopy(IDS_BSLAN_STRING, szData, 256); break; default: _ASSERTE(false); @@ -951,25 +951,25 @@ lvc.mask=LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; lvc.fmt=LVCFMT_LEFT; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=-1; m_ctlStatusList.InsertColumn(1, &lvc); - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.3*iWidth); lvc.iSubItem=0; m_ctlStatusList.InsertColumn(2, &lvc); - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=1; m_ctlStatusList.InsertColumn(3, &lvc); - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ lvc.cchTextMax = lstrlen(lvc.pszText); lvc.cx = static_cast(0.15*iWidth); lvc.iSubItem=2; Index: src/ch/StringHelpers.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -47,13 +47,13 @@ dData=0.0; if (dData < 1200.0) - _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), dData, GetResManager()->LoadString(IDS_BYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), dData, GetResManager().LoadString(IDS_BYTE_STRING)); else if (dData < 1228800.0) - _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), static_cast(dData)/1024.0, GetResManager()->LoadString(IDS_KBYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), static_cast(dData)/1024.0, GetResManager().LoadString(IDS_KBYTE_STRING)); else if (dData < 1258291200.0) - _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), static_cast(dData)/1048576.0, GetResManager()->LoadString(IDS_MBYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), static_cast(dData)/1048576.0, GetResManager().LoadString(IDS_MBYTE_STRING)); else - _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), static_cast(dData)/1073741824.0, GetResManager()->LoadString(IDS_GBYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), static_cast(dData)/1073741824.0, GetResManager().LoadString(IDS_GBYTE_STRING)); return pszBuffer; } @@ -64,13 +64,13 @@ ullData=0; if (ullData >= 1258291200 && (!bStrict || (ullData % 1073741824) == 0)) - _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1073741824.0), GetResManager()->LoadString(IDS_GBYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1073741824.0), GetResManager().LoadString(IDS_GBYTE_STRING)); else if (ullData >= 1228800 && (!bStrict || (ullData % 1048576) == 0)) - _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1048576.0), GetResManager()->LoadString(IDS_MBYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1048576.0), GetResManager().LoadString(IDS_MBYTE_STRING)); else if (ullData >= 1200 && (!bStrict || (ullData % 1024) == 0)) - _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1024.0), GetResManager()->LoadString(IDS_KBYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1024.0), GetResManager().LoadString(IDS_KBYTE_STRING)); else - _sntprintf(pszBuffer, stMaxBufferSize, _T("%I64u %s"), ullData, GetResManager()->LoadString(IDS_BYTE_STRING)); + _sntprintf(pszBuffer, stMaxBufferSize, _T("%I64u %s"), ullData, GetResManager().LoadString(IDS_BYTE_STRING)); return pszBuffer; } Index: src/ch/Structs.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/Structs.cpp (.../Structs.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/Structs.cpp (.../Structs.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -113,7 +113,8 @@ CTask::CTask(chcore::IFeedbackHandler* piFeedbackHandler, const TASK_CREATE_DATA *pCreateData) : m_log(), - m_piFeedbackHandler(piFeedbackHandler) + m_piFeedbackHandler(piFeedbackHandler), + m_files(m_clipboard) { BOOST_ASSERT(piFeedbackHandler); @@ -141,7 +142,6 @@ m_bQueued=false; m_ucCopies=1; m_ucCurrentCopy=0; - m_files.Init(&m_clipboard); m_uiResumeInterval=0; m_plFinished=pCreateData->plFinished; m_bForce=false; @@ -229,8 +229,7 @@ const bool bRecurse, const bool bIncludeDirs) { // this uses much of memory, but resolves problem critical section hungs and m_bKill - CFileInfoArray fa; - fa.Init(&m_clipboard); + CFileInfoArray fa(m_clipboard); fa.AddDir(strDirName, pFilters, iSrcIndex, bRecurse, bIncludeDirs, &m_bKill); @@ -753,7 +752,7 @@ if (uiInterval != 0) { m_uiResumeInterval+=uiInterval; - if (m_uiResumeInterval < (UINT)GetConfig()->get_signed_num(PP_CMAUTORETRYINTERVAL)) + if (m_uiResumeInterval < (UINT)GetConfig().get_signed_num(PP_CMAUTORETRYINTERVAL)) return false; else m_uiResumeInterval=0; @@ -822,7 +821,7 @@ } else { - pData->m_fi.SetFilePath(GetResManager()->LoadString(IDS_NONEINPUTFILE_STRING)); + pData->m_fi.SetFilePath(GetResManager().LoadString(IDS_NONEINPUTFILE_STRING)); pData->m_fi.SetSrcIndex(-1); } } @@ -866,7 +865,7 @@ } else { - pData->m_fi.SetFilePath(GetResManager()->LoadString(IDS_NONEINPUTFILE_STRING)); + pData->m_fi.SetFilePath(GetResManager().LoadString(IDS_NONEINPUTFILE_STRING)); pData->m_fi.SetSrcIndex(-1); } } @@ -905,62 +904,62 @@ // first if ( (m_nStatus & ST_WORKING_MASK) == ST_ERROR ) { - GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+4, pData->m_szStatusText, _MAX_PATH); + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+4, pData->m_szStatusText, _MAX_PATH); _tcscat(pData->m_szStatusText, _T("/")); } else if ( (m_nStatus & ST_WORKING_MASK) == ST_PAUSED ) { - GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+5, pData->m_szStatusText, _MAX_PATH); + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+5, pData->m_szStatusText, _MAX_PATH); _tcscat(pData->m_szStatusText, _T("/")); } else if ( (m_nStatus & ST_STEP_MASK) == ST_FINISHED ) { - GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+3, pData->m_szStatusText, _MAX_PATH); + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+3, pData->m_szStatusText, _MAX_PATH); _tcscat(pData->m_szStatusText, _T("/")); } else if ( (m_nStatus & ST_WAITING_MASK) == ST_WAITING ) { - GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+9, pData->m_szStatusText, _MAX_PATH); + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+9, pData->m_szStatusText, _MAX_PATH); _tcscat(pData->m_szStatusText, _T("/")); } else if ( (m_nStatus & ST_STEP_MASK) == ST_CANCELLED ) { - GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+8, pData->m_szStatusText, _MAX_PATH); + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+8, pData->m_szStatusText, _MAX_PATH); _tcscat(pData->m_szStatusText, _T("/")); } else _tcscpy(pData->m_szStatusText, _T("")); // second part if ( (m_nStatus & ST_STEP_MASK) == ST_DELETING ) - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+6)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+6)); else if ( (m_nStatus & ST_STEP_MASK) == ST_SEARCHING ) - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+0)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+0)); else if ((m_nStatus & ST_OPERATION_MASK) == ST_COPY ) { - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+1)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+1)); if(!m_afFilters.IsEmpty()) - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_FILTERING_STRING)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_FILTERING_STRING)); } else if ( (m_nStatus & ST_OPERATION_MASK) == ST_MOVE ) { - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+2)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+2)); if(!m_afFilters.IsEmpty()) - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_FILTERING_STRING)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_FILTERING_STRING)); } else - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+7)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+7)); // third part if ( (m_nStatus & ST_SPECIAL_MASK) & ST_IGNORE_DIRS ) { _tcscat(pData->m_szStatusText, _T("/")); - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+10)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+10)); } if ( (m_nStatus & ST_SPECIAL_MASK) & ST_IGNORE_CONTENT ) { _tcscat(pData->m_szStatusText, _T("/")); - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+11)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+11)); } // count of copies @@ -970,9 +969,9 @@ TCHAR xx[4]; _tcscat(pData->m_szStatusText, _itot(m_ucCopies, xx, 10)); if (m_ucCopies < 5) - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_COPYWORDLESSFIVE_STRING)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_COPYWORDLESSFIVE_STRING)); else - _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_COPYWORDMOREFOUR_STRING)); + _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_COPYWORDMOREFOUR_STRING)); } // time @@ -1182,15 +1181,6 @@ return m_bContinue; } -/* -CString CTask::GetLogName() -{ - TCHAR szPath[_MAX_PATH]; - GetConfig()->get_string(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); - return GetApp()->ExpandPath(szPath)+GetUniqueName()+_T(".log"); -} -*/ - //////////////////////////////////////////////////////////////////////////////// // CTaskArray members CTaskArray::CTaskArray() : @@ -1583,7 +1573,7 @@ uiStatus=GetAt(i)->GetStatus(); bFlag=((uiStatus & ST_STEP_MASK) == ST_FINISHED || (uiStatus & ST_STEP_MASK) == ST_CANCELLED || (uiStatus & ST_WORKING_MASK) == ST_PAUSED - || ((uiStatus & ST_WORKING_MASK) == ST_ERROR && !GetConfig()->get_bool(PP_CMAUTORETRYONERROR))); + || ((uiStatus & ST_WORKING_MASK) == ST_ERROR && !GetConfig().get_bool(PP_CMAUTORETRYONERROR))); } } @@ -1602,7 +1592,7 @@ m_dwError=dwError; // format some text - CString strFormat=GetResManager()->LoadString(uiFmtID); + CString strFormat=GetResManager().LoadString(uiFmtID); ExpandFormatString(&strFormat, dwError); // get param list Index: src/ch/UpdaterDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -39,7 +39,7 @@ { ictranslate::CLanguageDialog::OnInitDialog(); - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_UPDATER_WAITING_STRING)); + ictranslate::CFormat fmt(GetResManager().LoadString(IDS_UPDATER_WAITING_STRING)); fmt.SetParam(_t("%site"), _T(PRODUCT_SITE)); m_ctlText.SetWindowText(fmt); @@ -53,27 +53,23 @@ { m_ucChecker.CheckForUpdates(_T(PRODUCT_SITE), false); - ictranslate::CResourceManager* pResManager = GetResManager(); - BOOST_ASSERT(pResManager); - if(!pResManager) - return; - + ictranslate::CResourceManager& rResManager = GetResManager(); ictranslate::CFormat fmt; CString strFmt; switch(m_ucChecker.GetResult()) { case CUpdateChecker::eResult_Error: - strFmt = pResManager->LoadString(IDS_UPDATER_ERROR_STRING); + strFmt = rResManager.LoadString(IDS_UPDATER_ERROR_STRING); break; case CUpdateChecker::eResult_VersionNewer: - strFmt = pResManager->LoadString(IDS_UPDATER_NEW_VERSION_STRING); + strFmt = rResManager.LoadString(IDS_UPDATER_NEW_VERSION_STRING); break; case CUpdateChecker::eResult_VersionCurrent: - strFmt = pResManager->LoadString(IDS_UPDATER_EQUAL_VERSION_STRING); + strFmt = rResManager.LoadString(IDS_UPDATER_EQUAL_VERSION_STRING); break; case CUpdateChecker::eResult_VersionOlder: - strFmt = pResManager->LoadString(IDS_UPDATER_OLD_VERSION_STRING); + strFmt = rResManager.LoadString(IDS_UPDATER_OLD_VERSION_STRING); break; } Index: src/ch/ch.cpp =================================================================== diff -u -r11943010978bd23bbc4158d523b170830fcf4707 -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/ch.cpp (.../ch.cpp) (revision 11943010978bd23bbc4158d523b170830fcf4707) +++ src/ch/ch.cpp (.../ch.cpp) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -115,19 +115,19 @@ } } -CCopyHandlerApp* GetApp() +CCopyHandlerApp& GetApp() { - return &theApp; + return theApp; } -ictranslate::CResourceManager* GetResManager() +ictranslate::CResourceManager& GetResManager() { - return &theApp.m_resManager; + return theApp.m_resManager; } -chcore::engine_config* GetConfig() +chcore::engine_config& GetConfig() { - return &theApp.m_cfgSettings; + return theApp.m_cfgSettings; } /* CLogFile* GetLog() @@ -137,7 +137,7 @@ int MsgBox(UINT uiID, UINT nType, UINT nIDHelp) { - return AfxMessageBox(GetResManager()->LoadString(uiID), nType, nIDHelp); + return AfxMessageBox(GetResManager().LoadString(uiID), nType, nIDHelp); } bool CCopyHandlerApp::UpdateHelpPaths() @@ -148,7 +148,7 @@ TCHAR szBuffer[_MAX_PATH]; _tcscpy(szBuffer, _T("\\Help\\")); ExpandPath(szBuffer); - _tcscat(szBuffer, GetResManager()->m_ld.GetHelpName()); + _tcscat(szBuffer, GetResManager().m_ld.GetHelpName()); if(_tcscmp(szBuffer, m_pszHelpFilePath) != 0) { free((void*)m_pszHelpFilePath); Index: src/ch/ch.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -raa6bff57279b9f9cfc276e9adab2763e2900878d --- src/ch/ch.h (.../ch.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ch.h (.../ch.h) (revision aa6bff57279b9f9cfc276e9adab2763e2900878d) @@ -56,9 +56,9 @@ friend LRESULT MainRouter(ULONGLONG ullDst, UINT uiMsg, WPARAM wParam, LPARAM lParam); friend int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); - friend CCopyHandlerApp* GetApp(); - friend ictranslate::CResourceManager* GetResManager(); - friend chcore::engine_config* GetConfig(); + friend CCopyHandlerApp& GetApp(); + friend ictranslate::CResourceManager& GetResManager(); + friend chcore::engine_config& GetConfig(); // friend CLogFile* GetLog(); bool IsShellExtEnabled() const;