Skip to content

Commit

Permalink
[cleanup] Code removal (#3473)
Browse files Browse the repository at this point in the history
* [cleanup] Remove unused methods in class `Compiler`

* [cleanup] Remove unused methods in class `NodeDebugger`

* [cleanup] Remove unused methods in class `CompilerLocatorCLANG`

* [cleanup] Remove unused methods in class `CompilerLocatorMSYS2Clang`

* [cleanup] Remove unused methods in class `clSystemSettings`

* [cleanup] Remove unused methods in class `SyntaxHighlightDlg`

* [cleanup] Remove unused methods in class `Manager`

* [cleanup] Remove unused methods in class `TagsOptionsData`
  • Loading branch information
Jarod42 authored Sep 19, 2024
1 parent ed01ffa commit 814a068
Show file tree
Hide file tree
Showing 17 changed files with 3 additions and 355 deletions.
19 changes: 0 additions & 19 deletions CodeLite/tags_options_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <wx/ffile.h>
#include <wx/tokenzr.h>

wxString TagsOptionsData::CLANG_CACHE_LAZY = "Lazy";
wxString TagsOptionsData::CLANG_CACHE_ON_FILE_LOAD = "On File Load";

size_t TagsOptionsData::CURRENT_VERSION = 7100;
Expand Down Expand Up @@ -443,7 +442,6 @@ TagsOptionsData::TagsOptionsData()
// Initialize defaults
m_languages.Add("C++");
AddDefaultTokens();
AddDefaultTypes();

SyncData();
}
Expand All @@ -458,8 +456,6 @@ void TagsOptionsData::AddDefaultTokens()
}
}

void TagsOptionsData::AddDefaultTypes() {}

wxString TagsOptionsData::ToString() const
{
wxString options(wxEmptyString);
Expand Down Expand Up @@ -550,19 +546,6 @@ std::map<std::string, std::string> TagsOptionsData::GetTokensMap() const

const wxStringTable_t& TagsOptionsData::GetTokensWxMap() const { return m_tokensWxMap; }

wxStringTable_t TagsOptionsData::GetTypesMap() const
{
wxStringTable_t tokens;
for(size_t i = 0; i < m_types.GetCount(); i++) {
wxString item = m_types.Item(i);
item.Trim().Trim(false);
wxString k = item.BeforeFirst('=');
wxString v = item.AfterFirst('=');
tokens[k] = v;
}
return tokens;
}

void TagsOptionsData::SetTokens(const wxString& tokens)
{
this->m_tokens = ::wxStringTokenize(tokens, "\r\n", wxTOKEN_STRTOK);
Expand Down Expand Up @@ -594,8 +577,6 @@ void TagsOptionsData::DoUpdateTokensWxMapReversed()
}
}

const wxStringTable_t& TagsOptionsData::GetTokensReversedWxMap() const { return m_tokensWxMapReversed; }

void TagsOptionsData::FromJSON(const JSONItem& json)
{
m_version = json.namedObject("version").toSize_t();
Expand Down
25 changes: 1 addition & 24 deletions CodeLite/tags_options_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class WXDLLIMPEXP_CL TagsOptionsData : public clConfigItem
wxString DoJoinArray(const wxArrayString& arr) const;

public:
static wxString CLANG_CACHE_LAZY;
static wxString CLANG_CACHE_ON_FILE_LOAD;
static const std::vector<wxString>& GetDefaultTokens();
static const std::vector<wxString>& GetDefaultTypes();
Expand All @@ -127,7 +126,6 @@ class WXDLLIMPEXP_CL TagsOptionsData : public clConfigItem
virtual ~TagsOptionsData();

void AddDefaultTokens();
void AddDefaultTypes();

void Merge(const TagsOptionsData& tod);
void SetVersion(size_t version) { this->m_version = version; }
Expand All @@ -138,26 +136,14 @@ class WXDLLIMPEXP_CL TagsOptionsData : public clConfigItem
this->m_ccNumberOfDisplayItems = ccNumberOfDisplayItems;
}
size_t GetCcNumberOfDisplayItems() const { return m_ccNumberOfDisplayItems; }
void SetClangCachePolicy(const wxString& clangCachePolicy) { this->m_clangCachePolicy = clangCachePolicy; }
const wxString& GetClangCachePolicy() const { return m_clangCachePolicy; }
void SetClangMacros(const wxString& clangMacros) { this->m_clangMacros = clangMacros; }
void SetClangSearchPaths(const wxString& clangSearchPaths)
{
this->m_clangSearchPaths = ::wxStringTokenize(clangSearchPaths, "\r\n", wxTOKEN_STRTOK);
}
const wxString& GetClangMacros() const { return m_clangMacros; }
wxString GetClangSearchPaths() const { return DoJoinArray(m_clangSearchPaths); }

const wxArrayString& GetClangSearchPathsArray() const { return m_clangSearchPaths; }

void SetClangSearchPathsArray(const wxArrayString& paths) { m_clangSearchPaths = paths; }

void SetClangCmpOptions(const wxString& clangCmpOptions) { this->m_clangCmpOptions = clangCmpOptions; }
const wxString& GetClangCmpOptions() const { return m_clangCmpOptions; }
void SetClangOptions(size_t clangOptions) { this->m_clangOptions = clangOptions; }
size_t GetClangOptions() const { return m_clangOptions; }
void SetClangBinary(const wxString& clangBinary) { this->m_clangBinary = clangBinary; }
const wxString& GetClangBinary() const { return m_clangBinary; }

void SetFlags(size_t flags) { m_ccFlags = flags; }

void SetFileSpec(const wxString& filespec) { m_fileSpec = filespec; }
Expand All @@ -175,11 +161,8 @@ class WXDLLIMPEXP_CL TagsOptionsData : public clConfigItem

std::map<std::string, std::string> GetTokensMap() const;

const wxStringTable_t& GetTokensReversedWxMap() const;
const wxStringTable_t& GetTokensWxMap() const;

wxStringTable_t GetTypesMap() const;

const size_t& GetFlags() const { return m_ccFlags; }
const wxString& GetFileSpec() const { return m_fileSpec; }

Expand All @@ -200,19 +183,13 @@ class WXDLLIMPEXP_CL TagsOptionsData : public clConfigItem
void SetCcColourFlags(const size_t& ccColourFlags) { this->m_ccColourFlags = ccColourFlags; }

const size_t& GetCcColourFlags() const { return m_ccColourFlags; }
void SetParserEnabled(const bool& parserEnabled) { this->m_parserEnabled = parserEnabled; }
void SetParserSearchPaths(const wxArrayString& parserSearchPaths) { this->m_parserSearchPaths = parserSearchPaths; }
const bool& GetParserEnabled() const { return m_parserEnabled; }
const wxArrayString& GetParserSearchPaths() const { return m_parserSearchPaths; }
void SetParserExcludePaths(const wxArrayString& parserExcludePaths)
{
this->m_parserExcludePaths = parserExcludePaths;
}
const wxArrayString& GetParserExcludePaths() const { return m_parserExcludePaths; }
void SetMaxItemToColour(int maxItemToColour) { this->m_maxItemToColour = maxItemToColour; }
int GetMaxItemToColour() const { return m_maxItemToColour; }
void SetMacrosFiles(const wxString& macrosFiles) { this->m_macrosFiles = macrosFiles; }
const wxString& GetMacrosFiles() const { return m_macrosFiles; }
};

#endif // TAGS_OPTIONS_DATA_H
3 changes: 1 addition & 2 deletions Interfaces/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,7 @@ class IDebugger
*/
virtual bool SetCommands(const clDebuggerBreakpoint& bp) = 0;
/**
* \brief ask the debugger to query about its file & line. Once the result arrives, the observer's UpdateFileLine()
* will be invoked
* \brief ask the debugger to query about its file & line.
*/
virtual bool QueryFileLine() = 0;

Expand Down
78 changes: 0 additions & 78 deletions LiteEditor/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ Manager::Manager(void)
, m_programProcess(NULL)
, m_breakptsmgr(new BreakptMgr)
, m_isShutdown(false)
, m_workspceClosing(false)
, m_dbgCanInteract(false)
, m_useTipWin(false)
, m_tipWinPos(wxNOT_FOUND)
Expand Down Expand Up @@ -294,9 +293,6 @@ Manager::Manager(void)
// Instantiate the remote host manager executor
clRemoteHost::Instance();
#endif

// extract and install clang-tools if needed (GTK only)
InstallClangTools();
}

Manager::~Manager(void)
Expand Down Expand Up @@ -460,7 +456,6 @@ void Manager::DoSetupWorkspace(const wxString& path)

void Manager::CloseWorkspace()
{
m_workspceClosing = true;
if (!IsShutdownInProgress()) {
clWorkspaceEvent closing_event(wxEVT_WORKSPACE_CLOSING);
EventNotifier::Get()->ProcessEvent(closing_event);
Expand Down Expand Up @@ -511,7 +506,6 @@ void Manager::CloseWorkspace()
clWorkspaceEvent closed_event(wxEVT_WORKSPACE_CLOSED);
EventNotifier::Get()->ProcessEvent(closed_event);
}
m_workspceClosing = false;
}

void Manager::AddToRecentlyOpenedWorkspaces(const wxString& fileName)
Expand Down Expand Up @@ -887,13 +881,6 @@ void Manager::GetWorkspaceFiles(std::vector<wxFileName>& files, bool absPath)
}
}

bool Manager::IsFileInWorkspace(const wxString& fileName)
{
std::set<wxString> files;
GetWorkspaceFiles(files);
return files.find(fileName) != files.end();
}

void Manager::GetWorkspaceFiles(std::set<wxString>& files)
{
wxArrayString filesArr;
Expand Down Expand Up @@ -1577,19 +1564,6 @@ bool Manager::IsPaneVisible(const wxString& pane_name)
return false;
}

bool Manager::DoFindDockInfo(const wxString& saved_perspective, const wxString& dock_name, wxString& dock_info)
{
// search for the 'Output View' perspective
wxArrayString panes = wxStringTokenize(saved_perspective, wxT("|"), wxTOKEN_STRTOK);
for (size_t i = 0; i < panes.GetCount(); i++) {
if (panes.Item(i).StartsWith(dock_name)) {
dock_info = panes.Item(i);
return true;
}
}
return false;
}

bool Manager::ShowOutputPane(const wxString& focusWin, bool show, bool take_focus)
{
// make the output pane visible
Expand Down Expand Up @@ -3324,45 +3298,6 @@ void Manager::GetActiveProjectAndConf(wxString& project, wxString& conf)

void Manager::UpdatePreprocessorFile(clEditor* editor) { wxUnusedVar(editor); }

BuildConfigPtr Manager::GetCurrentBuildConf()
{
wxString project, conf;
GetActiveProjectAndConf(project, conf);
if (project.IsEmpty())
return NULL;

return clCxxWorkspaceST::Get()->GetProjBuildConf(project, conf);
}

void Manager::GetActiveFileProjectFiles(wxArrayString& files)
{
// Send an event to the plugins to get a list of the current file's project files
// If no plugin has replied, use the default GetProjectFiles method
wxCommandEvent getFilesEevet(wxEVT_CMD_GET_CURRENT_FILE_PROJECT_FILES);
getFilesEevet.SetEventObject(this);
getFilesEevet.SetClientData(&files);
if (!EventNotifier::Get()->ProcessEvent(getFilesEevet)) {
// Set default project name
wxString project = GetActiveProjectName();
if (clMainFrame::Get()->GetMainBook()->GetActiveEditor()) {
// use the active file's project
wxFileName activeFile = clMainFrame::Get()->GetMainBook()->GetActiveEditor()->GetFileName();
project = GetProjectNameByFile(activeFile.GetFullPath());
}
GetProjectFiles(project, files);
}
}

void Manager::GetActiveProjectFiles(wxArrayString& files)
{
wxCommandEvent getFilesEevet(wxEVT_CMD_GET_ACTIVE_PROJECT_FILES);
getFilesEevet.SetEventObject(this);
getFilesEevet.SetClientData(&files);
if (!EventNotifier::Get()->ProcessEvent(getFilesEevet)) {
GetProjectFiles(GetActiveProjectName(), files);
}
}

bool Manager::DbgCanInteract()
{
/// First, we also propogate this question to the plugins
Expand All @@ -3375,17 +3310,6 @@ bool Manager::DbgCanInteract()
return m_dbgCanInteract;
}

void Manager::OnAddWorkspaceToRecentlyUsedList(wxCommandEvent& e)
{
// We don't call e.Skip() here
wxFileName fn(e.GetString());
if (fn.FileExists()) {
AddToRecentlyOpenedWorkspaces(fn.GetFullPath());
}
}

void Manager::GenerateCompileCommands() {}

void Manager::OnBuildEnded(clBuildEvent& event) { event.Skip(); }

void Manager::DbgContinue()
Expand Down Expand Up @@ -3629,5 +3553,3 @@ void Manager::OnDebuggerAtFileLine(clDebugEvent& event)
SetRepositionEditor(true);
}
}

void Manager::InstallClangTools() {}
Loading

0 comments on commit 814a068

Please sign in to comment.