Browse Source

Correctly clears the selectiondialog model after hiding

merge-requests/365/head
eidheim 10 years ago
parent
commit
edc46d2561
  1. 6
      src/selectiondialog.cc
  2. 1
      src/selectiondialog.h

6
src/selectiondialog.cc

@ -38,6 +38,11 @@ void ListViewText::append(const std::string& value) {
new_row->set_value(column_record.text, value); new_row->set_value(column_record.text, value);
} }
void ListViewText::clear() {
unset_model();
list_store.reset();
}
SelectionDialogBase::SelectionDialogBase(Gtk::TextView& text_view, Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark, bool show_search_entry, bool use_markup): text_view(text_view), SelectionDialogBase::SelectionDialogBase(Gtk::TextView& text_view, Glib::RefPtr<Gtk::TextBuffer::Mark> 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) { list_view_text(use_markup), start_mark(start_mark), show_search_entry(show_search_entry) {
if(!show_search_entry) if(!show_search_entry)
@ -117,6 +122,7 @@ void SelectionDialogBase::hide() {
window->hide(); window->hide();
if(on_hide) if(on_hide)
on_hide(); on_hide();
list_view_text.clear();
} }
void SelectionDialogBase::move() { void SelectionDialogBase::move() {

1
src/selectiondialog.h

@ -17,6 +17,7 @@ public:
bool use_markup; bool use_markup;
ListViewText(bool use_markup); ListViewText(bool use_markup);
void append(const std::string& value); void append(const std::string& value);
void clear();
private: private:
Glib::RefPtr<Gtk::ListStore> list_store; Glib::RefPtr<Gtk::ListStore> list_store;
ColumnRecord column_record; ColumnRecord column_record;

Loading…
Cancel
Save