forked from organicmaps/organicmaps
[desktop] Delete "Search" bookmarks category when closing search.
This commit is contained in:
parent
e2150dcdbd
commit
31c919ff69
1 changed files with 7 additions and 3 deletions
|
@ -106,6 +106,8 @@ namespace
|
|||
return pm;
|
||||
}
|
||||
*/
|
||||
|
||||
char const * SEARCH_CATEGORY = "Search";
|
||||
}
|
||||
|
||||
void SearchPanel::OnSearchResult(ResultsT * res)
|
||||
|
@ -115,9 +117,8 @@ void SearchPanel::OnSearchResult(ResultsT * res)
|
|||
m_pTable->setRowCount(0);
|
||||
m_results.clear();
|
||||
|
||||
string const searchCategory = "Search";
|
||||
Framework & frm = m_pDrawWidget->GetFramework();
|
||||
frm.DeleteBmCategory(searchCategory);
|
||||
frm.DeleteBmCategory(SEARCH_CATEGORY);
|
||||
|
||||
for (ResultsT::IterT i = res->Begin(); i != res->End(); ++i)
|
||||
{
|
||||
|
@ -132,7 +133,7 @@ void SearchPanel::OnSearchResult(ResultsT * res)
|
|||
if (e.GetResultType() == ResultT::RESULT_FEATURE)
|
||||
{
|
||||
// For debug purposes: add bookmarks for search results
|
||||
frm.AddBookmark(searchCategory,
|
||||
frm.AddBookmark(SEARCH_CATEGORY,
|
||||
Bookmark(e.GetFeatureCenter(), e.GetString(), "placemark-red"));
|
||||
|
||||
m_pTable->setItem(rowCount, 0,
|
||||
|
@ -216,7 +217,10 @@ void SearchPanel::showEvent(QShowEvent *)
|
|||
|
||||
void SearchPanel::hideEvent(QHideEvent *)
|
||||
{
|
||||
m_pDrawWidget->GetFramework().DeleteBmCategory(SEARCH_CATEGORY);
|
||||
|
||||
disconnect(m_pDrawWidget, SIGNAL(ViewportChanged()), this, SLOT(OnViewportChanged()));
|
||||
|
||||
m_pDrawWidget->CloseSearch();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue