Browse Source

Fixed the elusive crash.

merge-requests/365/head
Ole Christian Eidheim 10 years ago
parent
commit
f14332eac4
  1. 4
      src/notebook.cc
  2. 2
      src/window.cc

4
src/notebook.cc

@ -104,8 +104,10 @@ void Notebook::open(const boost::filesystem::path &file_path) {
}); });
get_current_view()->on_update_status=[this](Source::View* view, const std::string &status) { get_current_view()->on_update_status=[this](Source::View* view, const std::string &status) {
if(get_current_view()==view) if(get_current_page()!=-1 && get_current_view()==view)
Singleton::status()->set_text(status); Singleton::status()->set_text(status);
else
Singleton::status()->set_text("");
}; };
} }

2
src/window.cc

@ -80,6 +80,7 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil
}); });
notebook.signal_switch_page().connect([this](Gtk::Widget* page, guint page_num) { notebook.signal_switch_page().connect([this](Gtk::Widget* page, guint page_num) {
DEBUG("start");
if(notebook.get_current_page()!=-1) { if(notebook.get_current_page()!=-1) {
if(search_entry_shown && entry_box.labels.size()>0) { if(search_entry_shown && entry_box.labels.size()>0) {
notebook.get_current_view()->update_search_occurrences=[this](int number){ notebook.get_current_view()->update_search_occurrences=[this](int number){
@ -108,6 +109,7 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil
Singleton::status()->set_text(notebook.get_current_view()->status); Singleton::status()->set_text(notebook.get_current_view()->status);
} }
DEBUG("end");
}); });
notebook.signal_page_removed().connect([this](Gtk::Widget* page, guint page_num) { notebook.signal_page_removed().connect([this](Gtk::Widget* page, guint page_num) {
entry_box.hide(); entry_box.hide();

Loading…
Cancel
Save