From 0466a0eeaf0a3d973f507e28684de2742daaf66d Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 19 Nov 2015 21:25:43 +0100 Subject: [PATCH] Now clears list store on hide. --- src/selectiondialog.cc | 6 ++++++ src/selectiondialog.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/selectiondialog.cc b/src/selectiondialog.cc index 490371d..487b21e 100644 --- a/src/selectiondialog.cc +++ b/src/selectiondialog.cc @@ -38,6 +38,11 @@ void ListViewText::ListViewText::append(const std::string& value) { new_row->set_value(column_record.text, value); } +void ListViewText::ListViewText::hide() { + Gtk::TreeView::hide(); + list_store->clear(); +} + SelectionDialogBase::SelectionDialogBase(Gtk::TextView& text_view, Glib::RefPtr start_mark, bool show_search_entry, bool use_markup): text_view(text_view), list_view_text(use_markup), start_mark(start_mark), show_search_entry(show_search_entry) { if(!show_search_entry) @@ -99,6 +104,7 @@ void SelectionDialogBase::hide() { window->hide(); if(tooltips) tooltips->hide(); + list_view_text.hide(); if(on_hide && shown) on_hide(); shown=false; diff --git a/src/selectiondialog.h b/src/selectiondialog.h index b580176..b13fffb 100644 --- a/src/selectiondialog.h +++ b/src/selectiondialog.h @@ -18,6 +18,7 @@ public: bool use_markup; ListViewText(bool use_markup); void append(const std::string& value); + void hide(); private: Glib::RefPtr list_store; ColumnRecord column_record;