From d901cca6113663667c3bb958365c8297f987a159 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 18 Mar 2016 10:05:51 +0100 Subject: [PATCH] Removed Notebook::set_tab_label and used g_signal_emit instead for updating notebook tab labels --- src/directories.cc | 3 ++- src/notebook.cc | 4 ---- src/notebook.h | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/directories.cc b/src/directories.cc index f703f21..24d2323 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -243,7 +243,8 @@ Directories::Directories() : Gtk::TreeView(), stop_update_thread(false) { } else if(view->file_path==*source_path) { view->file_path=target_path; - Notebook::get().set_tab_label(c, target_path.filename().string()); + g_signal_emit_by_name(view->get_buffer()->gobj(), "modified_changed"); + std::string old_language_id; if(view->language) old_language_id=view->language->get_id(); diff --git a/src/notebook.cc b/src/notebook.cc index df4f9c2..ea9124b 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -329,10 +329,6 @@ boost::filesystem::path Notebook::get_current_folder() { return boost::filesystem::path(); } -void Notebook::set_tab_label(int page, const std::string &label) { - tab_labels.at(get_index(page))->label.set_text(label); -} - bool Notebook::save_modified_dialog(int page) { Gtk::MessageDialog dialog((Gtk::Window&)(*get_toplevel()), "Save file!", false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO); dialog.set_default_response(Gtk::RESPONSE_YES); diff --git a/src/notebook.h b/src/notebook.h index 0654165..6bb3127 100644 --- a/src/notebook.h +++ b/src/notebook.h @@ -36,7 +36,6 @@ public: bool save_current(); void configure(int view_nr); boost::filesystem::path get_current_folder(); - void set_tab_label(int page, const std::string &label); Gtk::Label info; Gtk::Label status;