diff --git a/src/cmake.cc b/src/cmake.cc index 03c9004..0501921 100644 --- a/src/cmake.cc +++ b/src/cmake.cc @@ -1,8 +1,8 @@ #include "cmake.h" #include "singletons.h" #include "filesystem.h" -#include #include "dialogs.h" +#include #include //TODO: remove using namespace std; //TODO: remove diff --git a/src/directories.cc b/src/directories.cc index 89f19f6..9aa8421 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -216,7 +216,7 @@ void Directories::add_path(const boost::filesystem::path& dir_path, const Gtk::T bool already_added=false; if(*children) { for(auto &child: *children) { - if(child.get_value(column_record.name)==filename) { + if(child->get_value(column_record.name)==filename) { not_deleted.emplace(filename); already_added=true; break; diff --git a/src/files.h b/src/files.h index dc6e635..32f6fd2 100644 --- a/src/files.h +++ b/src/files.h @@ -1,3 +1,5 @@ +#ifndef JUCI_FILES_H_ +#define JUCI_FILES_H_ #include #define JUCI_VERSION "0.9.6" @@ -373,4 +375,4 @@ const std::string snippetpy = " output=getSnippet(theWord) \n" " juci.replaceWord(output) \n"; - +#endif // JUCI_FILES_H_ diff --git a/src/filesystem.h b/src/filesystem.h index 46bcc67..10d51bb 100644 --- a/src/filesystem.h +++ b/src/filesystem.h @@ -1,5 +1,5 @@ -#ifndef JUCI_SOURCEFILE_H_ -#define JUCI_SOURCEFILE_H_ +#ifndef JUCI_FILESYSTEM_H_ +#define JUCI_FILESYSTEM_H_ #include #include #include @@ -26,4 +26,4 @@ public: static bool write(const boost::filesystem::path &path, Glib::RefPtr text_buffer) { return write(path.string(), text_buffer); } }; -#endif // JUCI_SOURCEFILE_H_ +#endif // JUCI_FILESYSTEM_H_ diff --git a/src/juci.h b/src/juci.h index b34df62..5c8f6cd 100644 --- a/src/juci.h +++ b/src/juci.h @@ -8,9 +8,9 @@ class Application : public Gtk::Application { public: Application(); - int on_command_line(const Glib::RefPtr &cmd); - void on_activate(); - void on_startup(); + int on_command_line(const Glib::RefPtr &cmd) override; + void on_activate() override; + void on_startup() override; std::unique_ptr window; private: std::vector directories; diff --git a/src/window.cc b/src/window.cc index 0c85a33..6d50229 100644 --- a/src/window.cc +++ b/src/window.cc @@ -152,7 +152,7 @@ void Window::set_menu_actions() { notebook.open(Singleton::config->juci_home_path()/"config"/"config.json"); }); menu->add_action("quit", [this]() { - hide(); + close(); }); menu->add_action("new_file", [this]() { @@ -682,19 +682,14 @@ bool Window::on_key_press_event(GdkEventKey *event) { return Gtk::Window::on_key_press_event(event); } -bool Window::on_delete_event (GdkEventAny *event) { - hide(); - return true; -} - -void Window::hide() { +bool Window::on_delete_event(GdkEventAny *event) { auto size=notebook.size(); for(int c=0;ckill_async_executes(); - Gtk::Window::hide(); + return false; } void Window::search_and_replace_entry() { diff --git a/src/window.h b/src/window.h index 957b44d..d02f23c 100644 --- a/src/window.h +++ b/src/window.h @@ -11,9 +11,8 @@ public: Window(); Notebook notebook; -protected: - bool on_key_press_event(GdkEventKey *event); - bool on_delete_event (GdkEventAny *event); + bool on_key_press_event(GdkEventKey *event) override; + bool on_delete_event(GdkEventAny *event) override; private: Gtk::VPaned vpaned; @@ -29,7 +28,6 @@ private: void configure(); void set_menu_actions(); void activate_menu_items(bool activate=true); - void hide(); void search_and_replace_entry(); void set_tab_entry(); void goto_line_entry();