MCPcopy Create free account
hub / github.com/dfranx/ImFileDialog / AddFavorite

Method AddFavorite

ImFileDialog.cpp:556–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected