This commit is contained in:
Igor Pavlov
2023-12-22 17:17:05 +00:00
committed by Kornel
parent ec44a8a070
commit a36c48cece
954 changed files with 42199 additions and 25482 deletions

View File

@@ -49,7 +49,7 @@ void CPanelCallbackImp::OnTab()
void CPanelCallbackImp::SetFocusToPath(unsigned index)
{
int newPanelIndex = index;
unsigned newPanelIndex = index;
if (g_App.NumPanels == 1)
newPanelIndex = g_App.LastFocusedPanel;
_app->RefreshTitle();
@@ -66,7 +66,7 @@ void CPanelCallbackImp::DragBegin() { _app->DragBegin(_index); }
void CPanelCallbackImp::DragEnd() { _app->DragEnd(); }
void CPanelCallbackImp::RefreshTitle(bool always) { _app->RefreshTitlePanel(_index, always); }
void CApp::ReloadLang()
void CApp::ReloadLangItems()
{
LangString(IDS_N_SELECTED_ITEMS, LangString_N_SELECTED_ITEMS);
}
@@ -101,11 +101,11 @@ void CApp::SetListSettings()
panel._showRealFileIcons = st.ShowRealFileIcons;
panel._exStyle = extendedStyle;
DWORD style = (DWORD)panel._listView.GetStyle();
LONG_PTR style = panel._listView.GetStyle();
if (st.AlternativeSelection)
style |= LVS_SINGLESEL;
else
style &= ~LVS_SINGLESEL;
style &= ~(LONG_PTR)(DWORD)LVS_SINGLESEL;
panel._listView.SetStyle(style);
panel.SetExtendedStyle();
}
@@ -115,7 +115,7 @@ void CApp::SetListSettings()
#define ILC_COLOR32 0x0020
#endif
HRESULT CApp::CreateOnePanel(int panelIndex, const UString &mainPath, const UString &arcFormat,
HRESULT CApp::CreateOnePanel(unsigned panelIndex, const UString &mainPath, const UString &arcFormat,
bool needOpenArc,
COpenResult &openRes)
{
@@ -133,7 +133,7 @@ HRESULT CApp::CreateOnePanel(int panelIndex, const UString &mainPath, const UStr
else
path = mainPath;
int id = 1000 + 100 * panelIndex;
const unsigned id = 1000 + 100 * panelIndex; // check it
return Panels[panelIndex].Create(_window, _window,
id, path, arcFormat, &m_PanelCallbackImp[panelIndex], &AppState,
@@ -214,9 +214,9 @@ static bool SetButtonText(int commandID, const CButtonInfo *buttons, unsigned nu
static void SetButtonText(int commandID, UString &s)
{
if (SetButtonText(commandID, g_StandardButtons, ARRAY_SIZE(g_StandardButtons), s))
if (SetButtonText(commandID, g_StandardButtons, Z7_ARRAY_SIZE(g_StandardButtons), s))
return;
SetButtonText(commandID, g_ArchiveButtons, ARRAY_SIZE(g_ArchiveButtons), s);
SetButtonText(commandID, g_ArchiveButtons, Z7_ARRAY_SIZE(g_ArchiveButtons), s);
}
static void AddButton(
@@ -241,7 +241,7 @@ static void AddButton(
large ?
MAKEINTRESOURCE(butInfo.BitmapResID):
MAKEINTRESOURCE(butInfo.Bitmap2ResID));
if (b != 0)
if (b)
{
imageList.AddMasked(b, RGB(255, 0, 255));
::DeleteObject(b);
@@ -264,10 +264,10 @@ void CApp::ReloadToolbars()
CreateToolbar(_window, _buttonsImageList, _toolBar, LargeButtons);
unsigned i;
if (ShowArchiveToolbar)
for (i = 0; i < ARRAY_SIZE(g_ArchiveButtons); i++)
for (i = 0; i < Z7_ARRAY_SIZE(g_ArchiveButtons); i++)
AddButton(_buttonsImageList, _toolBar, g_ArchiveButtons[i], ShowButtonsLables, LargeButtons);
if (ShowStandardToolbar)
for (i = 0; i < ARRAY_SIZE(g_StandardButtons); i++)
for (i = 0; i < Z7_ARRAY_SIZE(g_StandardButtons); i++)
AddButton(_buttonsImageList, _toolBar, g_StandardButtons[i], ShowButtonsLables, LargeButtons);
_toolBar.AutoSize();
@@ -290,7 +290,7 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcForma
_commandBar.Create(g_hInstance, hwnd, 1);
#endif
MyLoadMenu();
MyLoadMenu(false); // needResetMenu
#ifdef UNDER_CE
_commandBar.AutoSize();
@@ -317,7 +317,7 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcForma
for (i = 0; i < kNumPanelsMax; i++)
{
CPanel &panel = Panels[i];
panel._ListViewMode = listMode.Panels[i];
panel._listViewMode = listMode.Panels[i];
panel._xSize = xSizes[i];
panel._flatModeForArc = ReadFlatView(i);
}
@@ -342,7 +342,7 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcForma
RINOK(CreateOnePanel(panelIndex, path, arcFormat,
isMainPanel && needOpenArc,
*(isMainPanel ? &openRes : &openRes2)));
*(isMainPanel ? &openRes : &openRes2)))
if (isMainPanel)
{
@@ -366,7 +366,7 @@ HRESULT CApp::SwitchOnOffOnePanel()
COpenResult openRes;
RINOK(CreateOnePanel(1 - LastFocusedPanel, UString(), UString(),
false, // needOpenArc
openRes));
openRes))
Panels[1 - LastFocusedPanel].Enable(true);
Panels[1 - LastFocusedPanel].Show(SW_SHOWNORMAL);
}
@@ -479,7 +479,7 @@ void AddValuePair2(UString &s, UINT resourceID, UInt64 num, UInt64 size)
s.Add_LF();
}
static void AddPropValueToSum(IFolderFolder *folder, int index, PROPID propID, UInt64 &sum)
static void AddPropValueToSum(IFolderFolder *folder, UInt32 index, PROPID propID, UInt64 &sum)
{
if (sum == (UInt64)(Int64)-1)
return;
@@ -501,7 +501,7 @@ UString CPanel::GetItemsInfoString(const CRecordVector<UInt32> &indices)
unsigned i;
for (i = 0; i < indices.Size(); i++)
{
int index = indices[i];
const UInt32 index = indices[i];
if (IsItem_Folder(index))
{
AddPropValueToSum(_folder, index, kpidSize, foldersSize);
@@ -528,7 +528,7 @@ UString CPanel::GetItemsInfoString(const CRecordVector<UInt32> &indices)
{
info.Add_LF();
info += " ";
int index = indices[i];
const UInt32 index = indices[i];
info += GetItemRelPath(index);
if (IsItem_Folder(index))
info.Add_PathSepar();
@@ -557,9 +557,9 @@ static bool IsFsPath(const FString &path)
}
*/
void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
void CApp::OnCopy(bool move, bool copyToSame, unsigned srcPanelIndex)
{
unsigned destPanelIndex = (NumPanels <= 1) ? srcPanelIndex : (1 - srcPanelIndex);
const unsigned destPanelIndex = (NumPanels <= 1) ? srcPanelIndex : (1 - srcPanelIndex);
CPanel &srcPanel = Panels[srcPanelIndex];
CPanel &destPanel = Panels[destPanelIndex];
@@ -584,10 +584,10 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
{
if (copyToSame)
{
int focusedItem = srcPanel._listView.GetFocusedItem();
const int focusedItem = srcPanel._listView.GetFocusedItem();
if (focusedItem < 0)
return;
int realIndex = srcPanel.GetRealItemIndex(focusedItem);
const unsigned realIndex = srcPanel.GetRealItemIndex(focusedItem);
if (realIndex == kParentIndex)
return;
indices.Add(realIndex);
@@ -595,7 +595,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
}
else
{
srcPanel.GetOperatedIndicesSmart(indices);
srcPanel.Get_ItemIndices_OperSmart(indices);
if (indices.Size() == 0)
return;
destPath = destPanel.GetFsPath();
@@ -607,7 +607,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
UStringVector copyFolders;
ReadCopyHistory(copyFolders);
bool useFullItemPaths = srcPanel.Is_IO_FS_Folder(); // maybe we need flat also here ??
const bool useFullItemPaths = srcPanel.Is_IO_FS_Folder(); // maybe we need flat also here ??
{
CCopyDialog copyDialog;
@@ -722,7 +722,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
UString prefix = destPath.Left(pos + 1);
if (!CreateComplexDir(us2fs(prefix)))
{
DWORD lastError = ::GetLastError();
const HRESULT lastError = GetLastError_noZero_HRESULT();
srcPanel.MessageBox_Error_2Lines_Message_HRESULT(prefix, lastError);
return;
}
@@ -734,7 +734,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
NName::NormalizeDirPathPrefix(destPath);
if (!CreateComplexDir(us2fs(destPath)))
{
DWORD lastError = ::GetLastError();
const HRESULT lastError = GetLastError_noZero_HRESULT();
srcPanel.MessageBox_Error_2Lines_Message_HRESULT(destPath, lastError);
return;
}
@@ -815,7 +815,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
filePaths.AddInReserved(s);
}
result = destPanel.CopyFrom(move, folderPrefix, filePaths, true, 0);
result = destPanel.CopyFrom(move, folderPrefix, filePaths, true, NULL);
}
if (result != S_OK)
@@ -849,7 +849,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
srcPanel.SetFocusToList();
}
void CApp::OnSetSameFolder(int srcPanelIndex)
void CApp::OnSetSameFolder(unsigned srcPanelIndex)
{
if (NumPanels <= 1)
return;
@@ -858,17 +858,17 @@ void CApp::OnSetSameFolder(int srcPanelIndex)
destPanel.BindToPathAndRefresh(srcPanel._currentFolderPrefix);
}
void CApp::OnSetSubFolder(int srcPanelIndex)
void CApp::OnSetSubFolder(unsigned srcPanelIndex)
{
if (NumPanels <= 1)
return;
const CPanel &srcPanel = Panels[srcPanelIndex];
CPanel &destPanel = Panels[1 - srcPanelIndex];
int focusedItem = srcPanel._listView.GetFocusedItem();
const int focusedItem = srcPanel._listView.GetFocusedItem();
if (focusedItem < 0)
return;
int realIndex = srcPanel.GetRealItemIndex(focusedItem);
const unsigned realIndex = srcPanel.GetRealItemIndex(focusedItem);
if (!srcPanel.IsItem_Folder(realIndex))
return;
@@ -933,7 +933,7 @@ void CApp::OnNotify(int /* ctrlID */, LPNMHDR pnmh)
if (pnmh->code == TTN_GETDISPINFO)
{
LPNMTTDISPINFO info = (LPNMTTDISPINFO)pnmh;
info->hinst = 0;
info->hinst = NULL;
g_ToolTipBuffer.Empty();
SetButtonText((int)info->hdr.idFrom, g_ToolTipBuffer);
g_ToolTipBufferSys = GetSystemString(g_ToolTipBuffer);
@@ -944,7 +944,7 @@ void CApp::OnNotify(int /* ctrlID */, LPNMHDR pnmh)
if (pnmh->code == TTN_GETDISPINFOW)
{
LPNMTTDISPINFOW info = (LPNMTTDISPINFOW)pnmh;
info->hinst = 0;
info->hinst = NULL;
g_ToolTipBuffer.Empty();
SetButtonText((int)info->hdr.idFrom, g_ToolTipBuffer);
info->lpszText = g_ToolTipBuffer.Ptr_non_const();