| 2435 | } |
| 2436 | |
| 2437 | bool IGFD::FileManager::SelectDirectory(const std::shared_ptr<FileInfos>& vInfos) { |
| 2438 | if (!vInfos.use_count()) return false; |
| 2439 | |
| 2440 | bool pathClick = false; |
| 2441 | |
| 2442 | if (vInfos->fileNameExt == "..") { |
| 2443 | pathClick = SetPathOnParentDirectoryIfAny(); |
| 2444 | } else { |
| 2445 | std::string newPath; |
| 2446 | |
| 2447 | if (showDevices) { |
| 2448 | newPath = vInfos->fileNameExt + IGFD::Utils::GetPathSeparator(); |
| 2449 | } else { |
| 2450 | #ifdef __linux__ |
| 2451 | if (fsRoot == m_CurrentPath) |
| 2452 | newPath = m_CurrentPath + vInfos->fileNameExt; |
| 2453 | else |
| 2454 | #endif // __linux__ |
| 2455 | newPath = m_CurrentPath + IGFD::Utils::GetPathSeparator() + vInfos->fileNameExt; |
| 2456 | } |
| 2457 | |
| 2458 | if (m_FileSystemPtr->IsDirectoryCanBeOpened(newPath)) { |
| 2459 | if (showDevices) { |
| 2460 | m_CurrentPath = vInfos->fileNameExt; |
| 2461 | fsRoot = m_CurrentPath; |
| 2462 | } else { |
| 2463 | m_CurrentPath = newPath; //-V820 |
| 2464 | } |
| 2465 | pathClick = true; |
| 2466 | } |
| 2467 | } |
| 2468 | |
| 2469 | return pathClick; |
| 2470 | } |
| 2471 | |
| 2472 | void IGFD::FileManager::SelectAllFileNames() { |
| 2473 | m_SelectedFileNames.clear(); |
no test coverage detected