Skip to content

Commit

Permalink
[cleanup] Code removal (#3528)
Browse files Browse the repository at this point in the history
code cleanup (removed unused functions and properties)
  • Loading branch information
Jarod42 authored Nov 12, 2024
1 parent 23e5b42 commit a41fe68
Show file tree
Hide file tree
Showing 20 changed files with 0 additions and 128 deletions.
2 changes: 0 additions & 2 deletions CallGraph/static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ const wxString CALLGRAPH_DIR = "CallGraph";
#ifdef __WXMSW__
const wxString GPROF_FILENAME_EXE = "gprof.exe";
const wxString DOT_FILENAME_EXE = "dot.exe";
const wxString EXECUTABLE_EXTENSION = "exe";
#else
const wxString GPROF_FILENAME_EXE = "gprof";
const wxString DOT_FILENAME_EXE = "dot";
const wxString EXECUTABLE_EXTENSION = "";
#endif
7 changes: 0 additions & 7 deletions CallGraph/static.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ extern const wxString DOT_FILENAME_PNG;
extern const wxString DOT_FILENAME_TXT;
extern const wxString CALLGRAPH_DIR;

#ifdef __WXMSW__
extern const wxString GPROF_FILENAME_EXE;
extern const wxString DOT_FILENAME_EXE;
extern const wxString EXECUTABLE_EXTENSION;
#else
extern const wxString GPROF_FILENAME_EXE;
extern const wxString DOT_FILENAME_EXE;
extern const wxString EXECUTABLE_EXTENSION;
#endif

#endif // __CALLGRAPH_STATIC_H__
3 changes: 0 additions & 3 deletions CodeLite/language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,3 @@ int Language::GetBestLineForForwardDecl(const wxString& fileContent) const
--line;
return line;
}

void Language::ClearAdditionalScopesCache() { m_additionalScopesCache.clear(); }

6 changes: 0 additions & 6 deletions CodeLite/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class WXDLLIMPEXP_CL Language
private:
wxString m_expression;
TagsManager* m_tm;
std::map<wxString, std::vector<wxString>> m_additionalScopesCache; // collected by parsing 'using namespace XXX'
CxxVariable::Map_t m_locals;

public:
Expand All @@ -102,11 +101,6 @@ class WXDLLIMPEXP_CL Language
*/
int GetBestLineForForwardDecl(const wxString& fileContent) const;

/**
* @brief clear the additional scopes cache
*/
void ClearAdditionalScopesCache();

/**
* @brief set the tags manager to be used by this language instance
* @param tm
Expand Down
9 changes: 0 additions & 9 deletions LiteEditor/clConfigurationSelectionCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ void clConfigurationSelectionCtrl::OnChoice(wxCommandEvent& event)
}
}

void clConfigurationSelectionCtrl::Clear() {}

void clConfigurationSelectionCtrl::SetConfigurations(const wxArrayString& configurations, const wxString& activeConfig)
{
m_configurations = configurations;
Expand All @@ -109,31 +107,25 @@ void clConfigurationSelectionCtrl::OnWorkspaceLoaded(clWorkspaceEvent& event)
if(ManagerST::Get()->IsWorkspaceOpen()) {
Enable(true);
DoWorkspaceConfig();
DoUpdateChoiceWithProjects();
}
}

void clConfigurationSelectionCtrl::OnWorkspaceClosed(clWorkspaceEvent& event)
{
event.Skip();
Clear();
Enable(false);
}

void clConfigurationSelectionCtrl::OnProjectAdded(clCommandEvent& event)
{
event.Skip();
DoUpdateChoiceWithProjects();
}

void clConfigurationSelectionCtrl::OnProjectRemoved(clCommandEvent& event)
{
event.Skip();
DoUpdateChoiceWithProjects();
}

void clConfigurationSelectionCtrl::DoUpdateChoiceWithProjects() {}

void clConfigurationSelectionCtrl::DoWorkspaceConfig()
{
// Update the workspace configuration
Expand Down Expand Up @@ -166,7 +158,6 @@ void clConfigurationSelectionCtrl::DoOpenConfigurationManagerDlg()

// in case user added configurations, update the choice control
DoWorkspaceConfig();
DoUpdateChoiceWithProjects();

BuildMatrixPtr matrix = ManagerST::Get()->GetWorkspaceBuildMatrix();
SetActiveConfiguration(matrix->GetSelectedConfigurationName());
Expand Down
6 changes: 0 additions & 6 deletions LiteEditor/clConfigurationSelectionCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class clConfigurationSelectionCtrl : public wxPanel
void OnActiveProjectChanged(clProjectSettingsEvent& event);

protected:
void DoUpdateChoiceWithProjects();
void DoWorkspaceConfig();
void DoOpenConfigurationManagerDlg();
void DoConfigChanged(const wxString& newConfigName);
Expand All @@ -43,11 +42,6 @@ class clConfigurationSelectionCtrl : public wxPanel
*/
void Update(const wxArrayString& projects, const wxArrayString& configurations);

/**
* @brief clear everything
*/
void Clear();

void SetActiveConfiguration(const wxString& activeConfiguration);
void SetConfigurations(const wxArrayString& configurations, const wxString& activeConfig);

Expand Down
7 changes: 0 additions & 7 deletions LiteEditor/cl_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ clEditor::clEditor(wxWindow* parent)
, m_isFocused(true)
, m_findBookmarksActive(false)
, m_mgr(PluginManager::Get())
, m_hasCCAnnotation(false)
, m_richTooltip(NULL)
, m_lastEndLine(0)
, m_lastLineCount(0)
Expand Down Expand Up @@ -4856,12 +4855,6 @@ void clEditor::OnChange(wxStyledTextEvent& event)
}
}

// Remove any code completion annotations if we have some...
if (m_hasCCAnnotation) {
CallAfter(&clEditor::AnnotationClearAll);
m_hasCCAnnotation = false;
}

// Notify about this editor being changed
if (GetModify()) {
clCommandEvent eventMod(wxEVT_EDITOR_MODIFIED);
Expand Down
5 changes: 0 additions & 5 deletions LiteEditor/cl_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ class clEditor : public wxStyledTextCtrl, public IEditor
wxTimer* m_timerHighlightMarkers;
IManager* m_mgr;
OptionsConfigPtr m_options;
bool m_hasCCAnnotation;
wxRichToolTip* m_richTooltip;
wxString m_keywordClasses;
wxString m_keywordMethods;
Expand Down Expand Up @@ -334,10 +333,6 @@ class clEditor : public wxStyledTextCtrl, public IEditor
* @brief CodeLite preferences updated
*/
void PreferencesChanged();
/**
* @brief are the CC annotations visible?
*/
bool IsHasCCAnnotation() const { return m_hasCCAnnotation; }

void SetEditorBitmap(int editorBitmap) { this->m_editorBitmap = editorBitmap; }
int GetEditorBitmap() const { return m_editorBitmap; }
Expand Down
35 changes: 0 additions & 35 deletions LiteEditor/code_completion_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ struct EditorDimmerDisabler {

CodeCompletionManager::CodeCompletionManager()
: m_options(CC_CTAGS_ENABLED)
, m_wordCompletionRefreshNeeded(false)
, m_buildInProgress(false)
{
EventNotifier::Get()->Bind(wxEVT_BUILD_STARTED, &CodeCompletionManager::OnBuildStarted, this);
Expand Down Expand Up @@ -120,11 +119,6 @@ CodeCompletionManager::~CodeCompletionManager()
wxTheApp->Unbind(wxEVT_ACTIVATE_APP, &CodeCompletionManager::OnAppActivated, this);
EventNotifier::Get()->Unbind(wxEVT_ENVIRONMENT_VARIABLES_MODIFIED,
&CodeCompletionManager::OnEnvironmentVariablesModified, this);

if(m_compileCommandsThread) {
m_compileCommandsThread->join();
wxDELETE(m_compileCommandsThread);
}
}

CodeCompletionManager& CodeCompletionManager::Get()
Expand Down Expand Up @@ -179,7 +173,6 @@ void CodeCompletionManager::OnWorkspaceConfig(wxCommandEvent& event)
void CodeCompletionManager::OnWorkspaceClosed(clWorkspaceEvent& event)
{
event.Skip();
LanguageST::Get()->ClearAdditionalScopesCache();
}

void CodeCompletionManager::OnEnvironmentVariablesModified(clCommandEvent& event)
Expand All @@ -190,34 +183,6 @@ void CodeCompletionManager::OnEnvironmentVariablesModified(clCommandEvent& event
}
}

void CodeCompletionManager::DoProcessCompileCommands()
{
// return; // for now, dont use it
if(m_compileCommandsThread) {
return;
}

// Create a thread that will process the current workspace folder and search for any compile_commands.json file
m_compileCommandsThread = new std::thread(&CodeCompletionManager::ThreadProcessCompileCommandsEntry, this,
clCxxWorkspaceST::Get()->GetDir());
}

void CodeCompletionManager::ThreadProcessCompileCommandsEntry(CodeCompletionManager* owner, const wxString& rootFolder)
{
// Search for compile_commands file, process it and send back the results to the main thread
wxArrayString includePaths = CompilationDatabase::FindIncludePaths(rootFolder, owner->m_compileCommands,
owner->m_compileCommandsLastModified);
owner->CallAfter(&CodeCompletionManager::CompileCommandsFileProcessed, includePaths);
}

void CodeCompletionManager::CompileCommandsFileProcessed(const wxArrayString& includePaths)
{
if(m_compileCommandsThread) {
m_compileCommandsThread->join();
wxDELETE(m_compileCommandsThread);
}
}

void CodeCompletionManager::OnBlockCommentCodeComplete(clCodeCompletionEvent& event)
{
event.Skip();
Expand Down
13 changes: 0 additions & 13 deletions LiteEditor/code_completion_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,10 @@ class CodeCompletionManager : public wxEvtHandler
{
protected:
size_t m_options = 0;
bool m_wordCompletionRefreshNeeded = false;
bool m_buildInProgress = false;
std::thread* m_compileCommandsThread = nullptr;
wxFileName m_compileCommands;
time_t m_compileCommandsLastModified = 0;
CompileCommandsGenerator::Ptr_t m_compileCommandsGenerator;

protected:
void DoProcessCompileCommands();
static void ThreadProcessCompileCommandsEntry(CodeCompletionManager* owner, const wxString& rootFolder);
void CompileCommandsFileProcessed(const wxArrayString& includePaths);
size_t CreateBlockCommentKeywordsList(wxCodeCompletionBoxEntry::Vec_t& entries) const;

protected:
Expand All @@ -73,12 +66,6 @@ class CodeCompletionManager : public wxEvtHandler
CodeCompletionManager();
virtual ~CodeCompletionManager();

void SetWordCompletionRefreshNeeded(bool wordCompletionRefreshNeeded)
{
this->m_wordCompletionRefreshNeeded = wordCompletionRefreshNeeded;
}

bool GetWordCompletionRefreshNeeded() const { return m_wordCompletionRefreshNeeded; }
void SetOptions(size_t options) { this->m_options = options; }
size_t GetOptions() const { return m_options; }

Expand Down
9 changes: 0 additions & 9 deletions LiteEditor/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,6 @@ void clMainFrame::CreateGUIControls()
// add the managed panel to the AUI manager
GetSizer()->Add(m_mainPanel, 1, wxEXPAND);

// try to locate the build tools
long fix(1);
fix = EditorConfigST::Get()->GetInteger("FixBuildToolOnStartup", fix);
if (fix) {
UpdateBuildTools();
}

::clSetTLWindowBestSizeAndPosition(this);

// This is needed in >=wxGTK-2.9, otherwise the auinotebook doesn't fully expand at first
Expand Down Expand Up @@ -1718,8 +1711,6 @@ void clMainFrame::Bootstrap()
codelite_initialised = true;
}

void clMainFrame::UpdateBuildTools() {}

void clMainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(); }

void clMainFrame::OnTBUnRedoMenu(wxCommandEvent& event)
Expand Down
5 changes: 0 additions & 5 deletions LiteEditor/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,6 @@ class clMainFrame : public wxFrame

void PostConstruct();

/**
* \brief update the path & name of the build tool
* on windows, try to locate make, followed by mingw32-make
*/
void UpdateBuildTools();
/**
* Helper function that prompt user with a simple wxTextEntry dialog
* @param msg message to display to user
Expand Down
3 changes: 0 additions & 3 deletions Runtime/config/codelite.xml.default
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<ArchiveObject Name="highlight_word">
<long Value="1" Name="m_value"/>
</ArchiveObject>
<ArchiveObject Name="FixBuildToolOnStartup">
<long Value="0" Name="m_value"/>
</ArchiveObject>
<ArchiveObject Name="GenerateFullPathMakefile">
<long Value="1" Name="m_value"/>
</ArchiveObject>
Expand Down
3 changes: 0 additions & 3 deletions Runtime/config/codelite.xml.default.gtk
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<ArchiveObject Name="highlight_word">
<long Value="1" Name="m_value"/>
</ArchiveObject>
<ArchiveObject Name="FixBuildToolOnStartup">
<long Value="0" Name="m_value"/>
</ArchiveObject>
<ArchiveObject Name="GenerateFullPathMakefile">
<long Value="1" Name="m_value"/>
</ArchiveObject>
Expand Down
3 changes: 0 additions & 3 deletions Runtime/config/codelite.xml.default.mac
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<ArchiveObject Name="highlight_word">
<long Value="1" Name="m_value"/>
</ArchiveObject>
<ArchiveObject Name="FixBuildToolOnStartup">
<long Value="0" Name="m_value"/>
</ArchiveObject>
<ArchiveObject Name="GenerateFullPathMakefile">
<long Value="1" Name="m_value"/>
</ArchiveObject>
Expand Down
2 changes: 0 additions & 2 deletions wxcrafter/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ MainFrame::MainFrame(wxWindow* parent, bool hidden)
, m_wxcView(NULL)
, m_treeView(NULL)
, m_findReplaceDialog(NULL)
, m_exiting(false)
{
m_mainToolbar->SetMiniToolBar(false);
auto images = m_mainToolbar->GetBitmapsCreateIfNeeded();
Expand Down Expand Up @@ -609,7 +608,6 @@ void MainFrame::OnHide(wxCommandEvent& event)
{
wxUnusedVar(event);
#if STANDALONE_BUILD
m_exiting = true;
Close();
#else
HideDesigner();
Expand Down
1 change: 0 additions & 1 deletion wxcrafter/src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class MainFrame : public MainFrameBase
wxcTreeView* m_treeView = nullptr;
wxFindReplaceDialog* m_findReplaceDialog = nullptr;
wxFindReplaceData m_findData;
bool m_exiting = false;

protected:
virtual void OnFileOpen(wxCommandEvent& event);
Expand Down
5 changes: 0 additions & 5 deletions wxcrafter/src/wxcrafter_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,15 +815,10 @@ void wxCrafterPlugin::OnPageChanged(wxCommandEvent& e)
wxWindow* win = reinterpret_cast<wxWindow*>(e.GetClientData());
if(win && (win == m_mainPanel)) {
DoSelectWorkspaceTab();
if(wxcProjectMetadata::Get().IsLoaded()) {
CallAfter(&wxCrafterPlugin::UpdateFileNameInStatusBar);
}
}
}
}

void wxCrafterPlugin::UpdateFileNameInStatusBar() {}

void wxCrafterPlugin::OnDesignerItemSelected(wxCommandEvent& e)
{
e.Skip();
Expand Down
1 change: 0 additions & 1 deletion wxcrafter/src/wxcrafter_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class wxCrafterPlugin : public IPlugin
void DoImportFB(const wxString& filename = "");
void DoInitDone(wxObject* obj = NULL);
void DoLoadWxcProject(const wxFileName& filename);
void UpdateFileNameInStatusBar();

protected:
// Event handlers
Expand Down
3 changes: 0 additions & 3 deletions wxcrafter/src/wxguicraft_main_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,9 +1096,6 @@ void GUICraftMainPanel::OnOpenProject(wxCommandEvent& e)
wxFileName curfile = wxcProjectMetadata::Get().GetProjectFile();
wxFileName newfile = path;

wxString p1, p2;
p1 = curfile.GetFullPath();
p2 = path;
if (curfile == path) {
return;
}
Expand Down

0 comments on commit a41fe68

Please sign in to comment.