Skip to content

Commit 602414e

Browse files
authored
[cleanup] Remove unused code (#3588)
* [cleanup] Remove set but never used `ContextCpp::m_cppFileBmp` * [cleanup] Remove unused CallGraph/toolbaricons.h * [cleanup] Remove set but never used `Manager::m_repositionEditor` * [cleanup] Remove unused `pos` parameter of `PHPCodeCompletion::FindDefinition` * [cleanup] Remove unused `requiredVersion` parameter of `CodeLiteApp::DoFindMenuFile`
1 parent 19d5e42 commit 602414e

File tree

12 files changed

+12
-164
lines changed

12 files changed

+12
-164
lines changed

CallGraph/callgraph.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,16 @@
2727

2828
#include "fileutils.h"
2929
#include "macromanager.h"
30-
#include "string.h"
31-
#include "toolbaricons.h"
3230
#include "uicallgraphpanel.h"
3331
#include "uisettingsdlg.h"
3432
#include "workspace.h"
3533

3634
#include <wx/aboutdlg.h>
37-
#include <wx/artprov.h>
3835
#include <wx/bitmap.h>
3936
#include <wx/datetime.h>
4037
#include <wx/image.h>
4138
#include <wx/msgdlg.h>
4239
#include <wx/mstream.h>
43-
#include <wx/sstream.h>
44-
#include <wx/txtstrm.h>
4540
#include <wx/wfstream.h>
4641
#include <wx/xrc/xmlres.h>
4742

CallGraph/toolbaricons.h

Lines changed: 0 additions & 115 deletions
This file was deleted.

LiteEditor/app.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,9 @@ bool CodeLiteApp::OnInit()
593593
::wxSetWorkingDirectory(homeDir);
594594
// Load all of the XRC files that will be used. You can put everything
595595
// into one giant XRC file if you wanted, but then they become more
596-
// diffcult to manage, and harder to reuse in later projects.
596+
// difficult to manage, and harder to reuse in later projects.
597597
// The menubar
598-
if (!wxXmlResource::Get()->Load(DoFindMenuFile(ManagerST::Get()->GetInstallDir(), wxT("2.0"))))
598+
if (!wxXmlResource::Get()->Load(DoFindMenuFile(ManagerST::Get()->GetInstallDir())))
599599
return false;
600600

601601
// keep the startup directory
@@ -950,9 +950,8 @@ void CodeLiteApp::MSWReadRegistry()
950950
#endif
951951
}
952952

953-
wxString CodeLiteApp::DoFindMenuFile(const wxString& installDirectory, const wxString& requiredVersion)
953+
wxString CodeLiteApp::DoFindMenuFile(const wxString& installDirectory)
954954
{
955-
wxUnusedVar(requiredVersion);
956955
wxFileName menu_xrc{ installDirectory, MENU_XRC };
957956
menu_xrc.AppendDir("rc");
958957
return menu_xrc.GetFullPath();

LiteEditor/app.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CodeLiteApp : public wxApp
5959
bool IsSingleInstance(const wxCmdLineParser& parser);
6060
void DoCopyGdbPrinters();
6161
void MSWReadRegistry();
62-
wxString DoFindMenuFile(const wxString& installDirectory, const wxString& requiredVersion);
62+
wxString DoFindMenuFile(const wxString& installDirectory);
6363
void AdjustPathForCygwinIfNeeded();
6464
void AdjustPathForMSYSIfNeeded();
6565
void PrintUsage(const wxCmdLineParser& parser);

LiteEditor/context_cpp.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ struct SFileSort {
142142

143143
//----------------------------------------------------------------------------------
144144

145-
wxBitmap ContextCpp::m_cppFileBmp = wxNullBitmap;
146-
wxBitmap ContextCpp::m_hFileBmp = wxNullBitmap;
147-
wxBitmap ContextCpp::m_otherFileBmp = wxNullBitmap;
148-
149145
BEGIN_EVENT_TABLE(ContextCpp, wxEvtHandler)
150146
EVT_UPDATE_UI(XRCID("find_decl"), ContextCpp::OnUpdateUI)
151147
EVT_UPDATE_UI(XRCID("find_impl"), ContextCpp::OnUpdateUI)
@@ -1536,15 +1532,6 @@ void ContextCpp::ApplySettings()
15361532

15371533
DoApplySettings(lexPtr);
15381534

1539-
// create all images used by the cpp context
1540-
if (!m_cppFileBmp.IsOk()) {
1541-
// Initialise the file bitmaps
1542-
BitmapLoader* bmpLoader = PluginManager::Get()->GetStdIcons();
1543-
m_cppFileBmp = bmpLoader->LoadBitmap("mime-cpp");
1544-
m_hFileBmp = bmpLoader->LoadBitmap("mime-h");
1545-
m_otherFileBmp = bmpLoader->LoadBitmap("mime-txt");
1546-
}
1547-
15481535
// delete uneeded commands
15491536
rCtrl.CmdKeyClear('/', wxSTC_KEYMOD_CTRL);
15501537
rCtrl.CmdKeyClear('/', wxSTC_KEYMOD_CTRL | wxSTC_KEYMOD_SHIFT);

LiteEditor/context_cpp.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ class ContextCpp : public ContextBase
4242
std::map<wxString, int> m_propertyInt;
4343
wxMenu* m_rclickMenu;
4444

45-
static wxBitmap m_cppFileBmp;
46-
static wxBitmap m_hFileBmp;
47-
static wxBitmap m_otherFileBmp;
48-
4945
protected:
5046
void OnShowCodeNavMenu(clCodeCompletionEvent& e);
5147
void OnCodeCompleteFiles(clCodeCompletionEvent& event);

LiteEditor/manager.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ Manager::Manager(void)
259259
, m_frameLineno(wxNOT_FOUND)
260260
, m_watchDlg(NULL)
261261
, m_retagInProgress(false)
262-
, m_repositionEditor(true)
263262
{
264263
Bind(wxEVT_RESTART_CODELITE, &Manager::OnRestart, this);
265264
Bind(wxEVT_FORCE_RESTART_CODELITE, &Manager::OnForcedRestart, this);
@@ -3425,6 +3424,5 @@ void Manager::OnDebuggerAtFileLine(clDebugEvent& event)
34253424

34263425
DbgMarkDebuggerLine(fileName, lineNumber);
34273426
UpdateDebuggerPane();
3428-
SetRepositionEditor(true);
34293427
}
34303428
}

LiteEditor/manager.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ class Manager : public wxEvtHandler, public IDebuggerObserver
101101
wxArrayString m_dbgWatchExpressions;
102102
DisplayVariableDlg* m_watchDlg;
103103
bool m_retagInProgress;
104-
bool m_repositionEditor; // flag used for debugging, should editor be repositioned after user updates like "add
105-
// watch"
106104
DbgStackInfo m_dbgCurrentFrameInfo;
107105
PerspectiveManager m_perspectiveManager;
108106
clDebuggerTerminalPOSIX m_debuggerTerminal;
@@ -133,9 +131,6 @@ class Manager : public wxEvtHandler, public IDebuggerObserver
133131
bool IsShutdownInProgress() const { return m_isShutdown; }
134132
void SetShutdownInProgress(bool b) { m_isShutdown = b; }
135133

136-
bool GetRepositionEditor() const { return m_repositionEditor; }
137-
void SetRepositionEditor(bool b) { m_repositionEditor = b; }
138-
139134
void OnRestart(clCommandEvent& event);
140135
void OnForcedRestart(clCommandEvent& event);
141136
void OnFindInFilesDismissed(clFindInFilesEvent& event);

LiteEditor/simpletable.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ void WatchesTable::UpdateVariableObjects()
221221

222222
void WatchesTable::RefreshValues(bool repositionEditor)
223223
{
224-
// indicate in the global manager if we want to actually reposition the editor's position after the
225-
// dbgr->QueryFileLine() refresh
226-
ManagerST::Get()->SetRepositionEditor(repositionEditor);
227-
228224
// loop over the childrens, if we got a valid variable object, re-evaluate it
229225
wxTreeItemId root = m_listTable->GetRootItem();
230226
if(root.IsOk() == false)

codelitephp/PHPParser/php_code_completion.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,8 @@ void PHPCodeCompletion::OnTypeinfoTip(clCodeCompletionEvent& e)
406406
}
407407
}
408408

409-
PHPLocation::Ptr_t PHPCodeCompletion::FindDefinition(IEditor* editor, int pos)
409+
PHPLocation::Ptr_t PHPCodeCompletion::FindDefinition(IEditor* editor)
410410
{
411-
wxUnusedVar(pos);
412411
CHECK_PHP_WORKSPACE_RET_NULL();
413412
PHPLocation::Ptr_t loc; // Null
414413
if(IsPHPFile(editor)) {
@@ -646,16 +645,16 @@ void PHPCodeCompletion::OnQuickJump(clCodeCompletionEvent& e)
646645
CHECK_EXPECTED_RETURN(IsPHPFile(editor), true);
647646

648647
e.Skip(false);
649-
GotoDefinition(editor, editor->GetCurrentPosition());
648+
GotoDefinition(editor);
650649
}
651650

652-
void PHPCodeCompletion::GotoDefinition(IEditor* editor, int pos)
651+
void PHPCodeCompletion::GotoDefinition(IEditor* editor)
653652
{
654653
CHECK_PTR_RET(editor);
655654
wxStyledTextCtrl* sci = editor->GetCtrl();
656655
CHECK_PTR_RET(sci);
657656

658-
PHPLocation::Ptr_t definitionLocation = FindDefinition(editor, pos);
657+
PHPLocation::Ptr_t definitionLocation = FindDefinition(editor);
659658
CHECK_PTR_RET(definitionLocation);
660659

661660
// Open the file (make sure we use the 'OpenFile' so we will get a browsing record)

0 commit comments

Comments
 (0)