MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / resolveDirentFromListIndex

Method resolveDirentFromListIndex

Tactility/Source/app/files/View.cpp:243–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243bool View::resolveDirentFromListIndex(int32_t list_index, dirent& out_entry) {
244 const bool is_root = (state->getCurrentPath() == "/");
245 const bool has_back = (!is_root && current_start_index > 0);
246
247 if (has_back && list_index == 0) {
248 return false; // Back button
249 }
250
251 const size_t adjusted_index =
252 current_start_index + static_cast<size_t>(list_index) - (has_back ? 1 : 0);
253
254 return state->getDirent(static_cast<uint32_t>(adjusted_index), out_entry);
255}
256
257void View::onDirEntryPressed(uint32_t index) {
258 dirent dir_entry;

Callers

nothing calls this directly

Calls 2

getCurrentPathMethod · 0.45
getDirentMethod · 0.45

Tested by

no test coverage detected