From 9ca0945d8f4dc8119b38925b6fbb21adf457ff40 Mon Sep 17 00:00:00 2001 From: Vadim Date: Mon, 23 Nov 2015 22:03:09 +0200 Subject: [PATCH 1/7] fix access to data member through pointer --- src/directories.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directories.cc b/src/directories.cc index b7e5c7e..b643579 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -215,7 +215,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; From 6dd5bf8bde29e33b445dab73d188e9c7b103d527 Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 24 Nov 2015 00:21:00 +0200 Subject: [PATCH 2/7] use std::rgex instead boost::regex --- src/cmake.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/cmake.cc b/src/cmake.cc index 03c9004..cbcfa5c 100644 --- a/src/cmake.cc +++ b/src/cmake.cc @@ -1,18 +1,19 @@ #include "cmake.h" #include "singletons.h" #include "filesystem.h" -#include #include "dialogs.h" +#include + #include //TODO: remove using namespace std; //TODO: remove CMake::CMake(const boost::filesystem::path &path) { const auto find_cmake_project=[this](const boost::filesystem::path &cmake_path) { for(auto &line: filesystem::read_lines(cmake_path)) { - const boost::regex project_regex("^ *project *\\(.*$"); - boost::smatch sm; - if(boost::regex_match(line, sm, project_regex)) { + const std::regex project_regex("^ *project *\\(.*$"); + std::smatch sm; + if(std::regex_match(line, sm, project_regex)) { return true; } } @@ -142,9 +143,9 @@ void CMake::find_variables() { end_line=file.size(); if(end_line>start_line) { auto line=file.substr(start_line, end_line-start_line); - const boost::regex set_regex("^ *set *\\( *([A-Za-z_][A-Za-z_0-9]*) +(.*)\\) *$"); - boost::smatch sm; - if(boost::regex_match(line, sm, set_regex)) { + const std::regex set_regex("^ *set *\\( *([A-Za-z_][A-Za-z_0-9]*) +(.*)\\) *$"); + std::smatch sm; + if(std::regex_match(line, sm, set_regex)) { auto data=sm[2].str(); while(data.size()>0 && data.back()==' ') data.pop_back(); @@ -264,10 +265,10 @@ std::vector > > CMak end_line=file.size(); if(end_line>start_line) { auto line=file.substr(start_line, end_line-start_line); - const boost::regex function_regex("^ *"+name+" *\\( *(.*)\\) *$"); - boost::smatch sm; - if(boost::regex_match(line, sm, function_regex)) { - auto data=sm[1].str(); + const std::regex function_regex("^ *"+name+" *\\( *(.*)\\) *$"); + std::smatch sm; + if(std::regex_match(line, sm, function_regex)) { + auto data=sm[1].str(); while(data.size()>0 && data.back()==' ') data.pop_back(); auto parameters=get_function_parameters(data); From fe143399eae2b0fae0bfd964eebcf018eaa76013 Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 24 Nov 2015 00:34:44 +0200 Subject: [PATCH 3/7] add include guard --- src/files.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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_ From 03ae90b411e4f3e768ae78061fd80ef288fc0602 Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 24 Nov 2015 02:02:03 +0200 Subject: [PATCH 4/7] override virtual functions from gtk::Application --- src/juci.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; From 9734ea89fc552787b0ba1689cec9bb6dc3aebbcb Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 24 Nov 2015 02:37:36 +0200 Subject: [PATCH 5/7] don't hide gtkmm interfaces! (gtkmm doc) --- src/window.cc | 2 +- src/window.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.cc b/src/window.cc index b157296..c53443c 100644 --- a/src/window.cc +++ b/src/window.cc @@ -683,7 +683,7 @@ bool Window::on_delete_event (GdkEventAny *event) { return true; } -void Window::hide() { +void Window::on_hide() { auto size=notebook.size(); for(int c=0;c Date: Tue, 24 Nov 2015 05:04:38 +0200 Subject: [PATCH 6/7] restore boost::regex --- src/cmake.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cmake.cc b/src/cmake.cc index cbcfa5c..0a9afdb 100644 --- a/src/cmake.cc +++ b/src/cmake.cc @@ -3,7 +3,7 @@ #include "filesystem.h" #include "dialogs.h" -#include +#include #include //TODO: remove using namespace std; //TODO: remove @@ -11,9 +11,9 @@ using namespace std; //TODO: remove CMake::CMake(const boost::filesystem::path &path) { const auto find_cmake_project=[this](const boost::filesystem::path &cmake_path) { for(auto &line: filesystem::read_lines(cmake_path)) { - const std::regex project_regex("^ *project *\\(.*$"); - std::smatch sm; - if(std::regex_match(line, sm, project_regex)) { + const boost::regex project_regex("^ *project *\\(.*$"); + boost::smatch sm; + if(boost::regex_match(line, sm, project_regex)) { return true; } } @@ -143,9 +143,9 @@ void CMake::find_variables() { end_line=file.size(); if(end_line>start_line) { auto line=file.substr(start_line, end_line-start_line); - const std::regex set_regex("^ *set *\\( *([A-Za-z_][A-Za-z_0-9]*) +(.*)\\) *$"); - std::smatch sm; - if(std::regex_match(line, sm, set_regex)) { + const boost::regex set_regex("^ *set *\\( *([A-Za-z_][A-Za-z_0-9]*) +(.*)\\) *$"); + boost::smatch sm; + if(boost::regex_match(line, sm, set_regex)) { auto data=sm[2].str(); while(data.size()>0 && data.back()==' ') data.pop_back(); @@ -265,9 +265,9 @@ std::vector > > CMak end_line=file.size(); if(end_line>start_line) { auto line=file.substr(start_line, end_line-start_line); - const std::regex function_regex("^ *"+name+" *\\( *(.*)\\) *$"); - std::smatch sm; - if(std::regex_match(line, sm, function_regex)) { + const boost::regex function_regex("^ *"+name+" *\\( *(.*)\\) *$"); + boost::smatch sm; + if(boost::regex_match(line, sm, function_regex)) { auto data=sm[1].str(); while(data.size()>0 && data.back()==' ') data.pop_back(); From 0117ab4696a0917f259cc5e4dfd5d8f3c7801c7f Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 24 Nov 2015 23:02:18 +0200 Subject: [PATCH 7/7] restore Window::hide --- src/window.cc | 2 +- src/window.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.cc b/src/window.cc index 6ba18f4..aa29431 100644 --- a/src/window.cc +++ b/src/window.cc @@ -682,7 +682,7 @@ bool Window::on_delete_event (GdkEventAny *event) { return true; } -void Window::on_hide() { +void Window::hide() { auto size=notebook.size(); for(int c=0;c