MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / SelectDirectory

Method SelectDirectory

external/ImGuiFileDialog/ImGuiFileDialog.cpp:2499–2532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2497}
2498
2499bool IGFD::FileManager::SelectDirectory(const std::shared_ptr<FileInfos>& vInfos) {
2500 if (!vInfos.use_count()) return false;
2501
2502 bool pathClick = false;
2503
2504 if (vInfos->fileNameExt == "..") {
2505 pathClick = SetPathOnParentDirectoryIfAny();
2506 } else {
2507 std::string newPath;
2508
2509 if (showDevices) {
2510 newPath = vInfos->fileNameExt + IGFD::Utils::GetPathSeparator();
2511 } else {
2512#ifdef __linux__
2513 if (fsRoot == m_CurrentPath)
2514 newPath = m_CurrentPath + vInfos->fileNameExt;
2515 else
2516#endif // __linux__
2517 newPath = m_CurrentPath + IGFD::Utils::GetPathSeparator() + vInfos->fileNameExt;
2518 }
2519
2520 if (m_FileSystemPtr->IsDirectoryCanBeOpened(newPath)) {
2521 if (showDevices) {
2522 m_CurrentPath = vInfos->fileNameExt;
2523 fsRoot = m_CurrentPath;
2524 } else {
2525 m_CurrentPath = newPath; //-V820
2526 }
2527 pathClick = true;
2528 }
2529 }
2530
2531 return pathClick;
2532}
2533
2534void IGFD::FileManager::SelectAllFileNames() {
2535 m_SelectedFileNames.clear();

Callers 3

m_ExploreWithkeysMethod · 0.80
m_DisplayPathPopupMethod · 0.80
m_SelectableItemMethod · 0.80

Calls 1

Tested by

no test coverage detected