From 8825fd609995027b45744b61de2ca3deb4e8e387 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 29 Apr 2016 10:32:46 +0200 Subject: [PATCH] Removed boost-log and boost-thread dependencies --- README.md | 2 -- docs/install.md | 4 ++-- src/CMakeLists.txt | 3 +-- src/config.cc | 1 - src/directories.cc | 8 -------- src/filesystem.cc | 1 - src/juci.cc | 6 ------ src/logging.h | 26 -------------------------- src/notebook.cc | 17 ++--------------- src/selectiondialog.h | 1 - src/source.cc | 1 - src/source_clang.cc | 7 +------ src/terminal.cc | 1 - src/window.cc | 3 --- 14 files changed, 6 insertions(+), 75 deletions(-) delete mode 100644 src/logging.h diff --git a/README.md b/README.md index b9bc670..49c4830 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,6 @@ See [enhancements](https://github.com/cppit/jucipp/labels/enhancement) for plann ## Dependencies * boost-filesystem -* boost-log -* boost-thread * boost-system * boost-regex * gtkmm-3.0 diff --git a/docs/install.md b/docs/install.md index 0476176..0520dec 100644 --- a/docs/install.md +++ b/docs/install.md @@ -16,7 +16,7 @@ ## Debian testing/Linux Mint/Ubuntu Install dependencies: ```sh -sudo apt-get install git cmake make g++ libclang-3.6-dev liblldb-3.6-dev clang-format-3.6 pkg-config libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-regex-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev +sudo apt-get install git cmake make g++ libclang-3.6-dev liblldb-3.6-dev clang-format-3.6 pkg-config libboost-system-dev libboost-filesystem-dev libboost-regex-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev ``` Get juCi++ source, compile and install: @@ -32,7 +32,7 @@ sudo make install ## Debian stable/Linux Mint Debian Edition/Raspbian Install dependencies: ```sh -sudo apt-get install git cmake make g++ libclang-3.5-dev liblldb-3.5-dev clang-format-3.5 pkg-config libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-regex-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev +sudo apt-get install git cmake make g++ libclang-3.5-dev liblldb-3.5-dev clang-format-3.5 pkg-config libboost-system-dev libboost-filesystem-dev libboost-regex-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev ``` Get juCi++ source, compile and install: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e0c6bdc..ee83302 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,7 +26,7 @@ if(MSYS) endif() find_package(LibClang REQUIRED) -find_package(Boost 1.54 COMPONENTS thread log regex system filesystem REQUIRED) +find_package(Boost 1.54 COMPONENTS regex system filesystem REQUIRED) find_package(ASPELL REQUIRED) set(LIBCLANGMM_INCLUDE_DIR ../libclangmm/src) set(TINY_PROCESS_INCLUDE_DIR ../tiny-process-library) @@ -86,7 +86,6 @@ set(project_files filesystem.h juci.cc juci.h - logging.h menu.cc menu.h notebook.cc diff --git a/src/config.cc b/src/config.cc index f6d3849..2ec52f9 100644 --- a/src/config.cc +++ b/src/config.cc @@ -1,5 +1,4 @@ #include "config.h" -#include "logging.h" #include #include "files.h" #include diff --git a/src/directories.cc b/src/directories.cc index 09dd08a..78534c9 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -1,5 +1,4 @@ #include "directories.h" -#include "logging.h" #include #include #include "source.h" @@ -422,7 +421,6 @@ Directories::~Directories() { } void Directories::open(const boost::filesystem::path &dir_path) { - JDEBUG("start"); if(dir_path.empty()) return; @@ -448,23 +446,18 @@ void Directories::open(const boost::filesystem::path &dir_path) { } path=dir_path; - - JDEBUG("end"); } void Directories::update() { - JDEBUG("start"); { std::unique_lock lock(update_mutex); for(auto &last_write_time: last_write_times) { add_path(last_write_time.first, last_write_time.second.first); } } - JDEBUG("end"); } void Directories::select(const boost::filesystem::path &select_path) { - JDEBUG("start"); if(path=="") return; @@ -533,7 +526,6 @@ void Directories::select(const boost::filesystem::path &select_path) { } return false; }); - JDEBUG("end"); } bool Directories::on_button_press_event(GdkEventButton* event) { diff --git a/src/filesystem.cc b/src/filesystem.cc index d83ca13..63730f1 100644 --- a/src/filesystem.cc +++ b/src/filesystem.cc @@ -4,7 +4,6 @@ #include #include "filesystem.h" -#include "logging.h" const size_t buffer_size=131072; diff --git a/src/juci.cc b/src/juci.cc index 5feb99e..2b04470 100644 --- a/src/juci.cc +++ b/src/juci.cc @@ -4,7 +4,6 @@ #include "directories.h" #include "menu.h" #include "config.h" -#include "logging.h" int Application::on_command_line(const Glib::RefPtr &cmd) { Glib::set_prgname("juci"); @@ -115,11 +114,6 @@ void Application::on_startup() { } Application::Application() : Gtk::Application("no.sout.juci", Gio::APPLICATION_NON_UNIQUE | Gio::APPLICATION_HANDLES_COMMAND_LINE) { - boost::log::add_common_attributes(); - auto log_dir = Config::get().juci_home_path()/"log"/"juci.log"; - boost::log::add_file_log(boost::log::keywords::file_name = log_dir, boost::log::keywords::auto_flush = true); - JINFO("Logging initalized"); - Glib::set_application_name("juCi++"); //Gtk::MessageDialog without buttons caused text to be selected, this prevents that diff --git a/src/logging.h b/src/logging.h deleted file mode 100644 index 7fd780b..0000000 --- a/src/logging.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef JUCI_LOGGING_H_ -#define JUCI_LOGGING_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define TRACE_VAR(x) BOOST_LOG_TRIVIAL(trace) << "** Trace: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): " << #x << "=<" << x << ">"; -#define DEBUG_VAR(x) BOOST_LOG_TRIVIAL(debug) << "** Debug: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): " << #x << "=<" << x << ">"; -#define INFO_VAR(x) BOOST_LOG_TRIVIAL(info) << "** Info: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): " << #x << "=<" << x << ">"; -#define WARNING_VAR(x) BOOST_LOG_TRIVIAL(warning) << "** Warning: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): " << #x << "=<" << x << ">"; -#define FATAL_VAR(x) BOOST_LOG_TRIVIAL(fatal) << "** Fatal: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): " << #x << "=<" << x << ">"; -#define JERROR_VAR(x) BOOST_LOG_TRIVIAL(error) << "** Error: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): " << #x << "=<" << x << ">"; -#define JTRACE(x) BOOST_LOG_TRIVIAL(trace) << "** Trace: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): \"" << x << "\""; -#define JDEBUG(x) BOOST_LOG_TRIVIAL(debug) << "** Debug: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): \"" << x << "\""; -#define JINFO(x) BOOST_LOG_TRIVIAL(info) << "** Info: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): \"" << x << "\""; -#define JWARNING(x) BOOST_LOG_TRIVIAL(warning) << "** Warning: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): \"" << x << "\""; -#define JFATAL(x) BOOST_LOG_TRIVIAL(fatal) << "** Fatal: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): \"" << x << "\""; -#define JERROR(x) BOOST_LOG_TRIVIAL(error) << "** Error: " << __FILE__ << "@" << __func__ << "(" << __LINE__ << "): \"" << x << "\""; - -#endif // JUCI_LOGGING_H_ diff --git a/src/notebook.cc b/src/notebook.cc index fdb70e7..1f68c27 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -1,7 +1,6 @@ #include "notebook.h" #include "config.h" #include "directories.h" -#include "logging.h" #include #include #include "project.h" @@ -80,7 +79,6 @@ Source::View* Notebook::get_current_view() { } void Notebook::open(const boost::filesystem::path &file_path) { - JDEBUG("start"); for(int c=0;cfile_path) { set_current_page(c); @@ -181,8 +179,6 @@ void Notebook::open(const boost::filesystem::path &file_path) { tab_label->set_tooltip_text(source_view->file_path.string()); } }); - - JDEBUG("end"); } void Notebook::configure(int view_nr) { @@ -200,11 +196,8 @@ void Notebook::configure(int view_nr) { } bool Notebook::save(int page) { - JDEBUG("start"); - if(page>=size()) { - JDEBUG("end false"); + if(page>=size()) return false; - } auto view=get_view(page); if (view->file_path != "" && view->get_buffer()->get_modified()) { //Remove trailing whitespace characters on save, and add trailing newline if missing @@ -249,12 +242,10 @@ bool Notebook::save(int page) { Project::on_save(page); - JDEBUG("end true"); return true; } Terminal::get().print("Error: could not save file " +view->file_path.string()+"\n", true); } - JDEBUG("end false"); return false; } @@ -265,14 +256,11 @@ bool Notebook::save_current() { } bool Notebook::close(int page) { - JDEBUG("start"); if (page!=-1) { auto view=get_view(page); if(view->get_buffer()->get_modified()){ - if(!save_modified_dialog(page)) { - JDEBUG("end false"); + if(!save_modified_dialog(page)) return false; - } } auto index=get_index(page); if(page==get_current_page()) { @@ -301,7 +289,6 @@ bool Notebook::close(int page) { hboxes.erase(hboxes.begin()+index); tab_labels.erase(tab_labels.begin()+index); } - JDEBUG("end true"); return true; } diff --git a/src/selectiondialog.h b/src/selectiondialog.h index 732652f..bff6c73 100644 --- a/src/selectiondialog.h +++ b/src/selectiondialog.h @@ -2,7 +2,6 @@ #define JUCI_SELECTIONDIALOG_H_ #include "gtkmm.h" -#include "logging.h" #include class ListViewText : public Gtk::TreeView { diff --git a/src/source.cc b/src/source.cc index 4e4802d..63ad7c3 100644 --- a/src/source.cc +++ b/src/source.cc @@ -1,7 +1,6 @@ #include "source.h" #include "config.h" #include -#include "logging.h" #include #include #include diff --git a/src/source_clang.cc b/src/source_clang.cc index 8b4a8a1..2ed5be5 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -24,8 +24,6 @@ clang::Index Source::ClangViewParse::clang_index(0, 0); Source::ClangViewParse::ClangViewParse(const boost::filesystem::path &file_path, Glib::RefPtr language): Source::View(file_path, language) { - JDEBUG("start"); - auto tag_table=get_buffer()->get_tag_table(); for (auto &item : Config::get().source.clang_types) { if(!tag_table->lookup(item.second)) { @@ -42,8 +40,6 @@ Source::View(file_path, language) { type_tooltips.hide(); diagnostic_tooltips.hide(); }); - - JDEBUG("end"); } void Source::ClangViewParse::configure() { @@ -66,8 +62,7 @@ void Source::ClangViewParse::configure() { // // if (style->property_italic_set()) tag->property_italic() = style->property_italic(); // // if (style->property_line_background_set()) tag->property_line_background() = style->property_line_background(); // // if (style->property_underline_set()) tag->property_underline() = style->property_underline(); - } else - JINFO("Style " + item.second + " not found in " + scheme->get_name()); + } } } } diff --git a/src/terminal.cc b/src/terminal.cc index d72196f..f043bd5 100644 --- a/src/terminal.cc +++ b/src/terminal.cc @@ -1,6 +1,5 @@ #include "terminal.h" #include -#include "logging.h" #include "config.h" #include "project.h" diff --git a/src/window.cc b/src/window.cc index b29f147..f793fce 100644 --- a/src/window.cc +++ b/src/window.cc @@ -1,5 +1,4 @@ #include "window.h" -#include "logging.h" #include "config.h" #include "menu.h" #include "directories.h" @@ -24,7 +23,6 @@ namespace sigc { } Window::Window() : notebook(Notebook::get()) { - JDEBUG("start"); set_title("juCi++"); set_events(Gdk::POINTER_MOTION_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::SCROLL_MASK|Gdk::LEAVE_NOTIFY_MASK); @@ -134,7 +132,6 @@ Window::Window() : notebook(Notebook::get()) { about.set_comments("This is an open source IDE with high-end features to make your programming experience juicy"); about.set_license_type(Gtk::License::LICENSE_MIT_X11); about.set_transient_for(*this); - JDEBUG("end"); } // Window constructor void Window::configure() {