| 534 | } |
| 535 | |
| 536 | void FileDialog::RemoveFavorite(const std::string& path) |
| 537 | { |
| 538 | auto itr = std::find(m_favorites.begin(), m_favorites.end(), m_currentDirectory.string()); |
| 539 | |
| 540 | if (itr != m_favorites.end()) |
| 541 | m_favorites.erase(itr); |
| 542 | |
| 543 | // remove from sidebar |
| 544 | for (auto& p : m_treeCache) |
| 545 | if (p->Path == "Quick Access") { |
| 546 | for (int i = 0; i < p->Children.size(); i++) |
| 547 | if (p->Children[i]->Path == path) { |
| 548 | p->Children.erase(p->Children.begin() + i); |
| 549 | break; |
| 550 | } |
| 551 | break; |
| 552 | } |
| 553 | } |
| 554 | void FileDialog::AddFavorite(const std::string& path) |
| 555 | { |
| 556 | if (std::count(m_favorites.begin(), m_favorites.end(), path) > 0) |