Browse Source

add log messages

merge-requests/365/head
Jørgen Lien Sellæg 11 years ago
parent
commit
c05692546a
  1. 2
      juci/config.cc
  2. 12
      juci/notebook.cc
  3. 3
      juci/source.cc

2
juci/config.cc

@ -3,7 +3,9 @@
MainConfig::MainConfig() : MainConfig::MainConfig() :
keybindings_cfg_(), source_cfg_() { keybindings_cfg_(), source_cfg_() {
INFO("Reading config file");
boost::property_tree::json_parser::read_json("config.json", cfg_); boost::property_tree::json_parser::read_json("config.json", cfg_);
INFO("Config file read");
GenerateSource(); GenerateSource();
GenerateKeybindings(); GenerateKeybindings();
GenerateDirectoryFilter(); GenerateDirectoryFilter();

12
juci/notebook.cc

@ -1,4 +1,5 @@
#include "notebook.h" #include "notebook.h"
#include "logging.h"
#include <fstream> #include <fstream>
Notebook::Model::Model() { Notebook::Model::Model() {
@ -18,6 +19,7 @@ Notebook::Controller::Controller(Gtk::Window* window, Keybindings::Controller& k
source_config_(source_cfg), source_config_(source_cfg),
directories_(dir_cfg), directories_(dir_cfg),
index_(0, 1) { index_(0, 1) {
INFO("Create notebook");
window_ = window; window_ = window;
OnNewPage("juCi++"); OnNewPage("juCi++");
refClipboard_ = Gtk::Clipboard::get(); refClipboard_ = Gtk::Clipboard::get();
@ -201,16 +203,14 @@ bool Notebook::Controller::GeneratePopup(int key_id) {
case clang::CompletionChunk_ResultType: case clang::CompletionChunk_ResultType:
return_value = chunk.chunk(); return_value = chunk.chunk();
break; break;
case clang::CompletionChunk_Informative: case clang::CompletionChunk_Informative: break;
break; default: ss << chunk.chunk(); break;
default:
ss << chunk.chunk();
break;
} }
} }
if (ss.str().length() > 0) { // if length is 0 the result is empty
items[ss.str() + " --> " + return_value] = ss.str(); items[ss.str() + " --> " + return_value] = ss.str();
} }
// Replace over with get suggestions from zalox! OVER IS JUST FOR TESTING }
Gtk::ScrolledWindow popup_scroll_; Gtk::ScrolledWindow popup_scroll_;
Gtk::ListViewText listview_(1, false, Gtk::SelectionMode::SELECTION_SINGLE); Gtk::ListViewText listview_(1, false, Gtk::SelectionMode::SELECTION_SINGLE);
popup_scroll_.set_policy(Gtk::PolicyType::POLICY_NEVER, popup_scroll_.set_policy(Gtk::PolicyType::POLICY_NEVER,

3
juci/source.cc

@ -136,6 +136,7 @@ GetAutoCompleteSuggestions(int line_number,
int column, int column,
std::vector<Source::AutoCompleteData> std::vector<Source::AutoCompleteData>
*suggestions) { *suggestions) {
INFO("Getting auto complete suggestions");
parsing.lock(); parsing.lock();
std::map<std::string, std::string> buffers; std::map<std::string, std::string> buffers;
notebook_->MapBuffers(&buffers); notebook_->MapBuffers(&buffers);
@ -143,6 +144,8 @@ GetAutoCompleteSuggestions(int line_number,
line_number, line_number,
column, column,
suggestions); suggestions);
DEBUG("Number of suggestions");
DEBUG_VAR(suggestions->size());
parsing.unlock(); parsing.unlock();
} }

Loading…
Cancel
Save