mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05:00
Bookmarks fixes: try to cleanup Recent entries in order
This commit is contained in:
parent
b5a658bb4c
commit
aab899d63c
@ -561,9 +561,10 @@ void BookmarkView::onTreeActivate( wxTreeEvent& event ) {
|
||||
nextDemod = tvi->demod;
|
||||
}
|
||||
} else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) {
|
||||
wxGetApp().getBookmarkMgr().removeRecent(tvi->bookmarkEnt);
|
||||
|
||||
activateBookmark(tvi->bookmarkEnt);
|
||||
nextEnt = tvi->bookmarkEnt;
|
||||
wxGetApp().getBookmarkMgr().removeRecent(tvi->bookmarkEnt);
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
} else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
|
||||
activateBookmark(tvi->bookmarkEnt);
|
||||
@ -742,9 +743,10 @@ void BookmarkView::doBookmarkActive(std::string group, DemodulatorInstance *demo
|
||||
|
||||
|
||||
void BookmarkView::doBookmarkRecent(std::string group, BookmarkEntryPtr be) {
|
||||
wxGetApp().getBookmarkMgr().removeRecent(be);
|
||||
|
||||
wxGetApp().getBookmarkMgr().addBookmark(group, be);
|
||||
nextEnt = be;
|
||||
wxGetApp().getBookmarkMgr().removeRecent(be);
|
||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||
bookmarkSelection(be);
|
||||
}
|
||||
@ -1203,10 +1205,10 @@ void BookmarkView::onActivateRecent( wxCommandEvent& /* event */ ) {
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) {
|
||||
|
||||
wxGetApp().getBookmarkMgr().removeRecent(curSel->bookmarkEnt);
|
||||
|
||||
activateBookmark(curSel->bookmarkEnt);
|
||||
DeleteSingleItem(m_treeView->GetSelection());
|
||||
wxGetApp().getBookmarkMgr().removeRecent(curSel->bookmarkEnt);
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
}
|
||||
}
|
||||
@ -1220,8 +1222,9 @@ void BookmarkView::onRemoveRecent ( wxCommandEvent& /* event */ ) {
|
||||
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
|
||||
|
||||
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) {
|
||||
wxGetApp().getBookmarkMgr().removeRecent(curSel->bookmarkEnt);
|
||||
|
||||
DeleteSingleItem(m_treeView->GetSelection());
|
||||
wxGetApp().getBookmarkMgr().removeRecent(curSel->bookmarkEnt);
|
||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,7 @@ public:
|
||||
};
|
||||
|
||||
virtual ~TreeViewItem() {
|
||||
//dec ref count manually ???
|
||||
bookmarkEnt = nullptr;
|
||||
rangeEnt = nullptr;
|
||||
//
|
||||
};
|
||||
|
||||
TreeViewItemType type;
|
||||
|
Loading…
Reference in New Issue
Block a user