[desktop] Delete "Search" bookmarks category when closing search.

This commit is contained in:
vng 2012-10-16 13:41:30 +03:00 committed by Alex Zolotarev
parent e2150dcdbd
commit 31c919ff69

View file

@ -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();
}