Added Framework::DeleteBmCategory()

This commit is contained in:
Alex Zolotarev 2012-05-14 18:11:51 +03:00 committed by Alex Zolotarev
parent 708e96f839
commit 8ac3a183c0
2 changed files with 17 additions and 0 deletions

View file

@ -216,6 +216,20 @@ BookmarkCategory * Framework::GetBmCategory(string const & name)
}
}
bool Framework::DeleteBmCategory(size_t index)
{
for (vector<BookmarkCategory *>::iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it)
{
if (index-- == 0)
{
delete *it;
m_bookmarks.erase(it);
return true;
}
}
return false;
}
Bookmark const * Framework::GetBookmark(m2::PointD pt) const
{
// Get the global rect of touching area.

View file

@ -130,6 +130,9 @@ public:
/// Find or create new category by name.
BookmarkCategory * GetBmCategory(string const & name);
/// Delete bookmarks category with all bookmarks
/// @return true if category was deleted
bool DeleteBmCategory(size_t index);
/// Get bookmark by touch.
/// @param[in] pixPt Coordinates of touch point in pixels.