Reverted removed method to Android compilation

This commit is contained in:
r.kuznetsov 2018-06-22 11:32:31 +03:00 committed by Vlad Mihaylenko
parent b226126a4e
commit 805c2d1d39
2 changed files with 42 additions and 0 deletions

View file

@ -1784,6 +1784,45 @@ bool BookmarkManager::IsUsedCategoryName(std::string const & name) const
return false;
}
bool BookmarkManager::AreAllCategoriesVisible(CategoryFilterType const filter) const
{
return CheckVisibility(filter, true /* isVisible */);
}
bool BookmarkManager::AreAllCategoriesInvisible(CategoryFilterType const filter) const
{
return CheckVisibility(filter, false /* isVisible */);
}
bool BookmarkManager::CheckVisibility(BookmarkManager::CategoryFilterType const filter,
bool isVisible) const
{
CHECK_THREAD_CHECKER(m_threadChecker, ());
for (auto const & category : m_categories)
{
auto const fromCatalog = IsCategoryFromCatalog(category.first);
if (!IsValidFilterType(filter, fromCatalog))
continue;
if (category.second->IsVisible() != isVisible)
return false;
}
return true;
}
void BookmarkManager::SetAllCategoriesVisibility(CategoryFilterType const filter, bool visible)
{
CHECK_THREAD_CHECKER(m_threadChecker, ());
auto session = GetEditSession();
for (auto const & category : m_categories)
{
auto const fromCatalog = IsCategoryFromCatalog(category.first);
if (!IsValidFilterType(filter, fromCatalog))
continue;
category.second->SetIsVisible(visible);
}
}
bool BookmarkManager::CanConvert() const
{
// The conversion available only after successful migration.

View file

@ -258,6 +258,9 @@ public:
bool IsEditableCategory(kml::MarkGroupId groupId) const;
bool IsUsedCategoryName(std::string const & name) const;
bool AreAllCategoriesVisible(CategoryFilterType const filter) const;
bool AreAllCategoriesInvisible(CategoryFilterType const filter) const;
void SetAllCategoriesVisibility(CategoryFilterType const filter, bool visible);
// Return number of files for the conversion to the binary format.
size_t GetKmlFilesCountForConversion() const;