MCPcopy Create free account
hub / github.com/WinMerge/winmerge / SaveTreeState

Function SaveTreeState

Src/DirActions.cpp:1594–1608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1592}
1593
1594DirViewTreeState *SaveTreeState(const CDiffContext& ctxt)
1595{
1596 DirViewTreeState *pTreeState = new DirViewTreeState();
1597 DIFFITEM *diffpos = ctxt.GetFirstDiffPosition();
1598 while (diffpos != nullptr)
1599 {
1600 const DIFFITEM &di = ctxt.GetNextDiffPosition(diffpos);
1601 if (di.HasChildren())
1602 {
1603 String relpath = paths::ConcatPath(di.diffFileInfo[0].path, di.diffFileInfo[0].filename);
1604 pTreeState->insert(std::pair<String, bool>(relpath, !!(di.customFlags & ViewCustomFlags::EXPANDED)));
1605 }
1606 }
1607 return pTreeState;
1608}
1609
1610void RestoreTreeState(CDiffContext& ctxt, DirViewTreeState *pTreeState)
1611{

Callers 4

OnRefreshMethod · 0.85
OnEndLabelEditMethod · 0.85
OnMarkedRescanMethod · 0.85
OnStatusBarClickMethod · 0.85

Calls 4

ConcatPathFunction · 0.85
GetFirstDiffPositionMethod · 0.80
HasChildrenMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected