MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / UpdateDirectory

Method UpdateDirectory

src/Windows/Treeview.cpp:272–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272int Treeview::UpdateDirectory(FileObject * dir) {
273 void* dat = dir->GetData();
274 if (!dat)
275 return 0;
276
277 HTREEITEM hti = (HTREEITEM)dat;
278
279 TV_ITEM tvi{};
280 tvi.hItem = hti;
281 tvi.mask = TVIF_STATE;
282 tvi.stateMask = TVIS_EXPANDED;
283 BOOL res = TreeView_GetItem(m_hwnd, &tvi);
284 if (res == FALSE)
285 return -1;
286
287 bool expanded = (tvi.state & TVIS_EXPANDED);
288 if (expanded) {
289 RemoveAllChildItems(hti);
290 FillTreeDirectory(dir);
291 TreeView_Expand(m_hwnd, hti, TVE_EXPAND);
292 }
293 return 0;
294}
295
296int Treeview::CollapseDirectory(FileObject* dir)
297{

Callers

nothing calls this directly

Calls 1

GetDataMethod · 0.45

Tested by

no test coverage detected