forked from organicmaps/organicmaps
Added Framework::DeleteBmCategory()
This commit is contained in:
parent
708e96f839
commit
8ac3a183c0
2 changed files with 17 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue