[bookmarks] Added a new method of getting the category id by the server id.

This commit is contained in:
Daria Volvenkova 2020-05-12 12:27:16 +03:00 committed by Arsentiy Milchakov
parent ee4ba01276
commit 1597351c65
2 changed files with 12 additions and 0 deletions

View file

@ -3620,6 +3620,17 @@ bool BookmarkManager::IsCategoryFromCatalog(kml::MarkGroupId categoryId) const
return cat->IsCategoryFromCatalog();
}
kml::MarkGroupId BookmarkManager::GetCategoryIdByServerId(std::string const & serverId) const
{
CHECK_THREAD_CHECKER(m_threadChecker, ());
for (auto const & category : m_categories)
{
if (category.second->GetServerId() == serverId)
return category.first;
}
return kml::kInvalidMarkGroupId;
}
std::string BookmarkManager::GetCategoryServerId(kml::MarkGroupId categoryId) const
{
CHECK_THREAD_CHECKER(m_threadChecker, ());

View file

@ -402,6 +402,7 @@ public:
void ImportDownloadedFromCatalog(std::string const & id, std::string const & filePath);
void UploadToCatalog(kml::MarkGroupId categoryId, kml::AccessRules accessRules);
bool IsCategoryFromCatalog(kml::MarkGroupId categoryId) const;
kml::MarkGroupId GetCategoryIdByServerId(std::string const & serverId) const;
std::string GetCategoryServerId(kml::MarkGroupId categoryId) const;
std::string GetCategoryCatalogDeeplink(kml::MarkGroupId categoryId) const;
std::string GetCategoryCatalogPublicLink(kml::MarkGroupId categoryId) const;