| 552 | } |
| 553 | } |
| 554 | void FileDialog::AddFavorite(const std::string& path) |
| 555 | { |
| 556 | if (std::count(m_favorites.begin(), m_favorites.end(), path) > 0) |
| 557 | return; |
| 558 | |
| 559 | if (!std::filesystem::exists(std::filesystem::path(path))) |
| 560 | return; |
| 561 | |
| 562 | m_favorites.push_back(path); |
| 563 | |
| 564 | // add to sidebar |
| 565 | for (auto& p : m_treeCache) |
| 566 | if (p->Path == "Quick Access") { |
| 567 | p->Children.push_back(new FileTreeNode(path)); |
| 568 | break; |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | void FileDialog::m_select(const std::filesystem::path& path, bool isCtrlDown) |
| 573 | { |