Browse Source

Removed boost-log and boost-thread dependencies

merge-requests/365/head
Ole Christian Eidheim 10 years ago
parent
commit
8825fd6099
  1. 2
      README.md
  2. 4
      docs/install.md
  3. 3
      src/CMakeLists.txt
  4. 1
      src/config.cc
  5. 8
      src/directories.cc
  6. 1
      src/filesystem.cc
  7. 6
      src/juci.cc
  8. 26
      src/logging.h
  9. 17
      src/notebook.cc
  10. 1
      src/selectiondialog.h
  11. 1
      src/source.cc
  12. 7
      src/source_clang.cc
  13. 1
      src/terminal.cc
  14. 3
      src/window.cc

2
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

4
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:

3
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

1
src/config.cc

@ -1,5 +1,4 @@
#include "config.h"
#include "logging.h"
#include <exception>
#include "files.h"
#include <iostream>

8
src/directories.cc

@ -1,5 +1,4 @@
#include "directories.h"
#include "logging.h"
#include <algorithm>
#include <unordered_set>
#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<std::mutex> 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) {

1
src/filesystem.cc

@ -4,7 +4,6 @@
#include <algorithm>
#include "filesystem.h"
#include "logging.h"
const size_t buffer_size=131072;

6
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<Gio::ApplicationCommandLine> &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

26
src/logging.h

@ -1,26 +0,0 @@
#ifndef JUCI_LOGGING_H_
#define JUCI_LOGGING_H_
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/expressions.hpp>
#include <boost/log/sinks/text_file_backend.hpp>
#include <boost/log/utility/setup/file.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
#include <boost/log/sources/severity_logger.hpp>
#include <boost/log/sources/record_ostream.hpp>
#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_

17
src/notebook.cc

@ -1,7 +1,6 @@
#include "notebook.h"
#include "config.h"
#include "directories.h"
#include "logging.h"
#include <fstream>
#include <regex>
#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;c<size();c++) {
if(file_path==get_view(c)->file_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;
}

1
src/selectiondialog.h

@ -2,7 +2,6 @@
#define JUCI_SELECTIONDIALOG_H_
#include "gtkmm.h"
#include "logging.h"
#include <unordered_map>
class ListViewText : public Gtk::TreeView {

1
src/source.cc

@ -1,7 +1,6 @@
#include "source.h"
#include "config.h"
#include <boost/property_tree/json_parser.hpp>
#include "logging.h"
#include <algorithm>
#include <gtksourceview/gtksource.h>
#include <iostream>

7
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<Gsv::Language> 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());
}
}
}
}

1
src/terminal.cc

@ -1,6 +1,5 @@
#include "terminal.h"
#include <iostream>
#include "logging.h"
#include "config.h"
#include "project.h"

3
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() {

Loading…
Cancel
Save