Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
reduced the number of threads created by CodeLite
  • Loading branch information
eranif committed Mar 20, 2022
1 parent 9ef2c4a commit 547857b
Show file tree
Hide file tree
Showing 22 changed files with 7 additions and 791 deletions.
6 changes: 0 additions & 6 deletions Interfaces/imanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class clWorkspaceView;
class TagsManager;
class clCxxWorkspace;
class EnvironmentConfig;
class JobQueue;
class wxApp;
class IPlugin;
class BuildManager;
Expand Down Expand Up @@ -365,11 +364,6 @@ class IManager
* @sa EnvironmentConfig
*/
virtual EnvironmentConfig* GetEnv() = 0;
/**
* @brief return a pointer to the job queue manager
* @return job queue manager
*/
virtual JobQueue* GetJobQueue() = 0;

/**
* @brief return the project execution command as set in the project's settings
Expand Down
2 changes: 0 additions & 2 deletions LiteEditor/cl_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
#include "frame.h"
#include "globals.h"
#include "imanager.h"
#include "job.h"
#include "jobqueue.h"
#include "lexer_configuration.h"
#include "localworkspace.h"
#include "macromanager.h"
Expand Down
1 change: 0 additions & 1 deletion LiteEditor/context_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
#include "new_quick_watch_dlg.h"
#include "pluginmanager.h"
#include "precompiled_header.h"
#include "refactorindexbuildjob.h"
#include "renamesymboldlg.h"
#include "setters_getters_dlg.h"
#include "symbols_dialog.h"
Expand Down
57 changes: 0 additions & 57 deletions LiteEditor/dbcontentcacher.cpp

This file was deleted.

44 changes: 0 additions & 44 deletions LiteEditor/dbcontentcacher.h

This file was deleted.

5 changes: 0 additions & 5 deletions LiteEditor/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
#include "generalinfo.h"
#include "globals.h"
#include "imanager.h"
#include "jobqueue.h"
#include "language.h"
#include "localstable.h"
#include "macros.h"
Expand All @@ -117,7 +116,6 @@
#include "project.h"
#include "quickdebugdlg.h"
#include "quickfindbar.h"
#include "refactorindexbuildjob.h"
#include "renamesymboldlg.h"
#include "replaceinfilespanel.h"
#include "save_perspective_as_dlg.h"
Expand Down Expand Up @@ -751,9 +749,6 @@ clMainFrame::clMainFrame(wxWindow* pParent, wxWindowID id, const wxString& title
SearchThreadST::Get()->SetNotifyWindow(EventNotifier::Get());
SearchThreadST::Get()->Start(WXTHREAD_MIN_PRIORITY);

// start the job queue
JobQueueSingleton::Instance()->Start(6);

// Create the single instance thread
m_singleInstanceThread = new clSingleInstanceThread();
m_singleInstanceThread->Start();
Expand Down
14 changes: 0 additions & 14 deletions LiteEditor/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include "crawler_include.h"
#include "ctags_manager.h"
#include "custombuildrequest.h"
#include "dbcontentcacher.h"
#include "debuggerasciiviewer.h"
#include "debuggerconfigtool.h"
#include "debuggersettings.h"
Expand All @@ -71,7 +70,6 @@
#include "fileutils.h"
#include "frame.h"
#include "globals.h"
#include "jobqueue.h"
#include "language.h"
#include "localstable.h"
#include "localworkspace.h"
Expand Down Expand Up @@ -207,7 +205,6 @@ Manager::Manager(void)
Bind(wxEVT_ASYNC_PROCESS_TERMINATED, &Manager::OnProcessEnd, this);

Connect(wxEVT_CMD_RESTART_CODELITE, wxCommandEventHandler(Manager::OnCmdRestart), NULL, this);
Connect(wxEVT_CMD_DB_CONTENT_CACHE_COMPLETED, wxCommandEventHandler(Manager::OnDbContentCacherLoaded), NULL, this);

EventNotifier::Get()->Connect(wxEVT_CMD_PROJ_SETTINGS_SAVED,
clProjectSettingsEventHandler(Manager::OnProjectSettingsModified), NULL, this);
Expand Down Expand Up @@ -262,15 +259,13 @@ Manager::~Manager(void)
DbgStop();
{
// wxLogNull noLog;
JobQueueSingleton::Instance()->Stop();
SearchThreadST::Get()->Stop();
}

// free all plugins
PluginManager::Get()->UnLoad();
ServiceProviderManager::Get().UnregisterAll();
DebuggerMgr::Free();
JobQueueSingleton::Release();
TagsManagerST::Free(); // it is important to release it *before* the TagsManager
LanguageST::Free();
clCxxWorkspaceST::Free();
Expand Down Expand Up @@ -401,13 +396,6 @@ void Manager::DoSetupWorkspace(const wxString& path)
// Set the encoding for the tags manager
TagsManagerST::Get()->SetEncoding(EditorConfigST::Get()->GetOptions()->GetFileFontEncoding());

// Load the tags file content (we load the file and then destroy it) this way the file is forced into
// the file system cache and will prevent hangs when first using the tagging system
if(TagsManagerST::Get()->GetDatabase()) {
wxFileName dbfn = TagsManagerST::Get()->GetDatabase()->GetDatabaseFileName();
JobQueueSingleton::Instance()->PushJob(new DbContentCacher(this, dbfn.GetFullPath().c_str()));
}

// Ensure that the "C++" view is selected
clGetManager()->GetWorkspaceView()->SelectPage(clCxxWorkspaceST::Get()->GetWorkspaceType());
}
Expand Down Expand Up @@ -3296,8 +3284,6 @@ void Manager::OnProjectSettingsModified(clProjectSettingsEvent& event)
clMainFrame::Get()->SelectBestEnvSet();
}

void Manager::OnDbContentCacherLoaded(wxCommandEvent& event) { clLogMessage(event.GetString()); }

void Manager::GetActiveProjectAndConf(wxString& project, wxString& conf)
{
if(!IsWorkspaceOpen()) {
Expand Down
14 changes: 4 additions & 10 deletions LiteEditor/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
#ifndef MANAGER_H
#define MANAGER_H

#include <list>
#include <map>
#include <wx/event.h>

#include "async_executable_cmd.h"
#include "breakpointsmgr.h"
#include "clDebuggerTerminal.h"
Expand All @@ -43,6 +39,10 @@
#include "singleton.h"
#include "workspace.h"

#include <list>
#include <map>
#include <wx/event.h>

class clEditor;
class IProcess;

Expand Down Expand Up @@ -344,12 +344,6 @@ class Manager : public wxEvtHandler, public IDebuggerObserver
*/
void RetagWorkspace(TagsManager::RetagType type);

/**
* @brief the parser thread has completed to scan for include files to parse
* @param event
*/
void OnDbContentCacherLoaded(wxCommandEvent& event);

/**
* \brief retag a given file
* \param filename
Expand Down
2 changes: 0 additions & 2 deletions LiteEditor/pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include "fileview.h"
#include "frame.h"
#include "generalinfo.h"
#include "jobqueue.h"
#include "language.h"
#include "macromanager.h"
#include "manager.h"
Expand Down Expand Up @@ -449,7 +448,6 @@ wxAuiManager* PluginManager::GetDockingManager() { return m_dockingManager; }

EnvironmentConfig* PluginManager::GetEnv() { return EnvironmentConfig::Instance(); }

JobQueue* PluginManager::GetJobQueue() { return JobQueueSingleton::Instance(); }
wxString PluginManager::GetProjectExecutionCommand(const wxString& projectName, wxString& wd)
{
return ManagerST::Get()->GetProjectExecutionCommand(projectName, wd, false);
Expand Down
2 changes: 0 additions & 2 deletions LiteEditor/pluginmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class clToolBar;
class clEditorBar;
class wxBookCtrlBase;
class EnvironmentConfig;
class JobQueue;
class BuildSettingsConfig;
class BuildManager;
class BitmapLoader;
Expand Down Expand Up @@ -110,7 +109,6 @@ class PluginManager : public IManager
int GetToolbarIconSize() override;
wxAuiManager* GetDockingManager() override;
EnvironmentConfig* GetEnv() override;
JobQueue* GetJobQueue() override;
wxString GetProjectExecutionCommand(const wxString& projectName, wxString& wd) override;
wxApp* GetTheApp() override;
void ReloadWorkspace() override;
Expand Down
82 changes: 0 additions & 82 deletions LiteEditor/refactorindexbuildjob.cpp

This file was deleted.

Loading

0 comments on commit 547857b

Please sign in to comment.