本文整理汇总了C++中TShadowFilesTreeList::cbegin方法的典型用法代码示例。如果您正苦于以下问题:C++ TShadowFilesTreeList::cbegin方法的具体用法?C++ TShadowFilesTreeList::cbegin怎么用?C++ TShadowFilesTreeList::cbegin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TShadowFilesTreeList
的用法示例。
在下文中一共展示了TShadowFilesTreeList::cbegin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowContextMenu
//.........这里部分代码省略.........
{
popupMenu.AppendMenuIcon(eCmd_CopyPath, IDS_STATUSLIST_CONTEXT_COPY, IDI_COPYCLIP);
popupMenu.AppendMenuIcon(eCmd_CopyHash, IDS_COPY_COMMIT_HASH, IDI_COPYCLIP);
}
eCmd cmd = (eCmd)popupMenu.TrackPopupMenuEx(TPM_LEFTALIGN|TPM_RETURNCMD, point.x, point.y, this, 0);
switch(cmd)
{
case eCmd_ViewLog:
case eCmd_ViewLogSubmodule:
{
CString sCmd;
sCmd.Format(_T("/command:log /path:\"%s\\%s\""), (LPCTSTR)g_Git.m_CurrentDir, (LPCTSTR)selectedLeafs.at(0)->GetFullName());
if (cmd == eCmd_ViewLog && selectedLeafs.at(0)->m_bSubmodule)
sCmd += _T(" /submodule");
CAppUtils::RunTortoiseGitProc(sCmd);
}
break;
case eCmd_Blame:
{
CAppUtils::LaunchTortoiseBlame(g_Git.CombinePath(selectedLeafs.at(0)->GetFullName()), m_sRevision);
}
break;
case eCmd_Open:
if (!selectedLeafs.at(0)->m_bSubmodule && selectedLeafs.at(0)->m_bFolder)
{
FillListCtrlForTreeNode(selectedLeafs.at(0)->m_hTree);
m_RepoTree.SelectItem(selectedLeafs.at(0)->m_hTree);
return;
}
OpenFile(selectedLeafs.at(0)->GetFullName(), OPEN, selectedLeafs.at(0)->m_bSubmodule, selectedLeafs.at(0)->m_hash);
break;
case eCmd_OpenWith:
OpenFile(selectedLeafs.at(0)->GetFullName(), OPEN_WITH, selectedLeafs.at(0)->m_bSubmodule, selectedLeafs.at(0)->m_hash);
break;
case eCmd_OpenWithAlternativeEditor:
OpenFile(selectedLeafs.at(0)->GetFullName(), ALTERNATIVEEDITOR, selectedLeafs.at(0)->m_bSubmodule, selectedLeafs.at(0)->m_hash);
break;
case eCmd_CompareWC:
{
CTGitPath file(selectedLeafs.at(0)->GetFullName());
CGitDiff::Diff(&file, &file, GIT_REV_ZERO, m_sRevision);
}
break;
case eCmd_Revert:
{
int count = 0;
for (auto itShadowTree = selectedLeafs.cbegin(); itShadowTree != selectedLeafs.cend(); ++itShadowTree)
{
if (RevertItemToVersion((*itShadowTree)->GetFullName()))
++count;
else
break;
}
CString msg;
msg.Format(IDS_STATUSLIST_FILESREVERTED, count, (LPCTSTR)m_sRevision);
MessageBox(msg, _T("TortoiseGit"), MB_OK);
}
break;
case eCmd_SaveAs:
FileSaveAs(selectedLeafs.at(0)->GetFullName());
break;
case eCmd_CopyPath:
{
CString sClipboard;
for (auto itShadowTree = selectedLeafs.cbegin(); itShadowTree != selectedLeafs.cend(); ++itShadowTree)
{
sClipboard += (*itShadowTree)->m_sName + _T("\r\n");
}
CStringUtils::WriteAsciiStringToClipboard(sClipboard);
}
break;
case eCmd_CopyHash:
{
CopyHashToClipboard(selectedLeafs);
}
break;
case eCmd_PrepareDiff:
m_sMarkForDiffFilename = selectedLeafs.at(0)->GetFullName();
if (g_Git.GetHash(m_sMarkForDiffVersion, m_sRevision))
{
m_sMarkForDiffFilename.Empty();
MessageBox(g_Git.GetGitLastErr(_T("Could not get SHA-1 for ") + m_sRevision), _T("TortoiseGit"), MB_ICONERROR);
}
break;
case eCmd_PrepareDiff_Compare:
{
CTGitPath savedFile(m_sMarkForDiffFilename);
CTGitPath selectedFile(selectedLeafs.at(0)->GetFullName());
CGitHash currentHash;
if (g_Git.GetHash(currentHash, m_sRevision))
{
MessageBox(g_Git.GetGitLastErr(_T("Could not get SHA-1 for ") + m_sRevision), _T("TortoiseGit"), MB_ICONERROR);
return;
}
CGitDiff::Diff(&selectedFile, &savedFile, currentHash, m_sMarkForDiffVersion);
}
break;
}
}