summaryrefslogtreecommitdiff
path: root/LiteEditor/clang_code_completion.cpp
diff options
context:
space:
mode:
authorJames Cowgill <james410@cowgill.org.uk>2014-06-04 23:58:41 +0100
committerJames Cowgill <james410@cowgill.org.uk>2014-06-04 23:58:41 +0100
commit9535c6126d9ed34e0fdf40cc0bdd2dc01159644d (patch)
tree70c75e73c142444c753df0525a11c9c0d28077a7 /LiteEditor/clang_code_completion.cpp
parent01b494f950c9a63763683747ca330a2c70855f0f (diff)
Imported Upstream version 6.0.1+dfsg
Diffstat (limited to 'LiteEditor/clang_code_completion.cpp')
-rw-r--r--LiteEditor/clang_code_completion.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/LiteEditor/clang_code_completion.cpp b/LiteEditor/clang_code_completion.cpp
index 826da725..4f7f137f 100644
--- a/LiteEditor/clang_code_completion.cpp
+++ b/LiteEditor/clang_code_completion.cpp
@@ -37,7 +37,7 @@ ClangCodeCompletion::ClangCodeCompletion()
: m_allEditorsAreClosing(false)
{
EventNotifier::Get()->Connect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(ClangCodeCompletion::OnFileLoaded), NULL, this);
- EventNotifier::Get()->Connect(wxEVT_FILE_SAVED, wxCommandEventHandler(ClangCodeCompletion::OnFileSaved), NULL, this);
+ EventNotifier::Get()->Connect(wxEVT_FILE_SAVED, clCommandEventHandler(ClangCodeCompletion::OnFileSaved), NULL, this);
EventNotifier::Get()->Connect(wxEVT_ALL_EDITORS_CLOSING, wxCommandEventHandler(ClangCodeCompletion::OnAllEditorsClosing), NULL, this);
EventNotifier::Get()->Connect(wxEVT_ALL_EDITORS_CLOSED, wxCommandEventHandler(ClangCodeCompletion::OnAllEditorsClosed ), NULL, this);
EventNotifier::Get()->Connect(wxEVT_BUILD_STARTING, clBuildEventHandler(ClangCodeCompletion::OnBuildStarting), NULL, this);
@@ -48,7 +48,7 @@ ClangCodeCompletion::ClangCodeCompletion()
ClangCodeCompletion::~ClangCodeCompletion()
{
EventNotifier::Get()->Disconnect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(ClangCodeCompletion::OnFileLoaded), NULL, this);
- EventNotifier::Get()->Disconnect(wxEVT_FILE_SAVED, wxCommandEventHandler(ClangCodeCompletion::OnFileSaved), NULL, this);
+ EventNotifier::Get()->Disconnect(wxEVT_FILE_SAVED, clCommandEventHandler(ClangCodeCompletion::OnFileSaved), NULL, this);
EventNotifier::Get()->Disconnect(wxEVT_ALL_EDITORS_CLOSING, wxCommandEventHandler(ClangCodeCompletion::OnAllEditorsClosing), NULL, this);
EventNotifier::Get()->Disconnect(wxEVT_ALL_EDITORS_CLOSED, wxCommandEventHandler(ClangCodeCompletion::OnAllEditorsClosed ), NULL, this);
EventNotifier::Get()->Disconnect(wxEVT_BUILD_STARTING, clBuildEventHandler(ClangCodeCompletion::OnBuildStarting), NULL, this);
@@ -164,7 +164,7 @@ void ClangCodeCompletion::ListMacros(IEditor* editor)
m_clang.GetMacros(editor);
}
-void ClangCodeCompletion::OnFileSaved(wxCommandEvent& e)
+void ClangCodeCompletion::OnFileSaved(clCommandEvent& e)
{
e.Skip();
CHECK_CLANG_ENABLED_RET();
@@ -188,16 +188,10 @@ void ClangCodeCompletion::OnBuildEnded(clBuildEvent& e)
CHECK_CLANG_ENABLED_RET();
// Clear environment variables previously set by this class
- ::wxUnsetEnv(wxT("CL_COMPILATION_DB"));
- ::wxUnsetEnv(wxT("CXX"));
- ::wxUnsetEnv(wxT("CC"));
-
- // Create a worker thread (detached thread) that
- // will initialize the database now that the compilation is ended
- CompilationDatabase db;
- ClangCompilationDbThread* thr = new ClangCompilationDbThread( db.GetFileName().GetFullPath() );
- thr->Start();
-
+ ::wxUnsetEnv("CL_COMPILATION_DB");
+ ::wxUnsetEnv("CXX");
+ ::wxUnsetEnv("CC");
+
// Clear the TU cache
ClearCache();
}
@@ -224,11 +218,11 @@ void ClangCodeCompletion::OnBuildStarting(clBuildEvent& e)
wxString cxx = bldConf->GetCompiler()->GetTool(wxT("CXX"));
wxString cc = bldConf->GetCompiler()->GetTool(wxT("CC"));
- cxx.Prepend(wxT("codelitegcc "));
- cc.Prepend(wxT("codelitegcc "));
+ cxx.Prepend(wxT("codelite-cc "));
+ cc.Prepend(wxT("codelite-cc "));
- ::wxSetEnv(wxT("CXX"), cxx);
- ::wxSetEnv(wxT("CC"), cc);
+ ::wxSetEnv("CXX", cxx);
+ ::wxSetEnv("CC" , cc);
}
}