From 2f4886e6e291f659537b0f0e6ec3bc09bd39d9e8 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Sat, 13 Apr 2024 23:43:27 +0200 Subject: [PATCH 01/17] Remove unused `EventNotifier::_eventsDiabled`. --- CodeLite/event_notifier.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/CodeLite/event_notifier.h b/CodeLite/event_notifier.h index c94c2f33e3..0add93ab96 100644 --- a/CodeLite/event_notifier.h +++ b/CodeLite/event_notifier.h @@ -34,8 +34,6 @@ class WXDLLIMPEXP_CL EventNotifier : public wxEvtHandler { - bool _eventsDiabled; - private: EventNotifier(); virtual ~EventNotifier(); From 5f8e03dc7c95bfd6c0147188257755ddd14ccd90 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Sat, 13 Apr 2024 23:51:05 +0200 Subject: [PATCH 02/17] Remove unused `IsCppKeyword`. --- Plugin/globals.cpp | 79 ---------------------------------------------- Plugin/globals.h | 7 ---- 2 files changed, 86 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 9d15b750df..f4ae95794e 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -864,85 +864,6 @@ void GetProjectTemplateList(std::list& list) list.sort(ProjListComparator()); } -thread_local std::unordered_set words; - -bool IsCppKeyword(const wxString& word) -{ - if (words.empty()) { - words.insert("auto"); - words.insert("break"); - words.insert("case"); - words.insert("char"); - words.insert("const"); - words.insert("continue"); - words.insert("default"); - words.insert("define"); - words.insert("defined"); - words.insert("do"); - words.insert("double"); - words.insert("elif"); - words.insert("else"); - words.insert("endif"); - words.insert("enum"); - words.insert("error"); - words.insert("extern"); - words.insert("float"); - words.insert("for"); - words.insert("goto"); - words.insert("if"); - words.insert("ifdef"); - words.insert("ifndef"); - words.insert("include"); - words.insert("int"); - words.insert("line"); - words.insert("long"); - words.insert("bool"); - words.insert("pragma"); - words.insert("register"); - words.insert("return"); - words.insert("short"); - words.insert("signed"); - words.insert("sizeof"); - words.insert("static"); - words.insert("struct"); - words.insert("switch"); - words.insert("typedef"); - words.insert("undef"); - words.insert("union"); - words.insert("unsigned"); - words.insert("void"); - words.insert("volatile"); - words.insert("while"); - words.insert("class"); - words.insert("namespace"); - words.insert("delete"); - words.insert("friend"); - words.insert("inline"); - words.insert("new"); - words.insert("operator"); - words.insert("overload"); - words.insert("protected"); - words.insert("private"); - words.insert("public"); - words.insert("this"); - words.insert("virtual"); - words.insert("template"); - words.insert("typename"); - words.insert("dynamic_cast"); - words.insert("static_cast"); - words.insert("const_cast"); - words.insert("reinterpret_cast"); - words.insert("using"); - words.insert("throw"); - words.insert("catch"); - words.insert("nullptr"); - words.insert("noexcept"); - words.insert("override"); - words.insert("constexpr"); - } - return words.count(word) != 0; -} - void MSWSetNativeTheme(wxWindow* win, const wxString& theme) { #if defined(__WXMSW__) && defined(_WIN64) && 0 diff --git a/Plugin/globals.h b/Plugin/globals.h index 64cd6bda54..881c4fc1bd 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -165,13 +165,6 @@ WXDLLIMPEXP_SDK bool RemoveDirectory(const wxString& path); */ WXDLLIMPEXP_SDK bool IsValidCppIndetifier(const wxString& id); -/** - * \brief return true of word is a C++ keyword - * \param word - * \return - */ -WXDLLIMPEXP_SDK bool IsCppKeyword(const wxString& word); - /** * \brief return true of id is a valid cpp file */ From d50879ac80bda9b26c9f9c44e8540dae23ec77b8 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 22:57:16 +0200 Subject: [PATCH 03/17] Remove unused `ArrayToSemiColonString`. --- Plugin/globals.cpp | 14 -------------- Plugin/globals.h | 5 ----- 2 files changed, 19 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index f4ae95794e..3ed0d2620a 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -679,20 +679,6 @@ void FillFromSemiColonString(wxArrayString& arr, const wxString& str) arr = StringUtils::BuildArgv(str); } -wxString ArrayToSemiColonString(const wxArrayString& array) -{ - wxString result; - for (size_t i = 0; i < array.GetCount(); i++) { - wxString tmp = NormalizePath(array.Item(i)); - tmp.Trim().Trim(false); - if (tmp.IsEmpty() == false) { - result += NormalizePath(array.Item(i)); - result += ";"; - } - } - return result.BeforeLast(';'); -} - void StripSemiColons(wxString& str) { str.Replace(";", " "); } wxString NormalizePath(const wxString& path) diff --git a/Plugin/globals.h b/Plugin/globals.h index 881c4fc1bd..a2119db623 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -240,11 +240,6 @@ WXDLLIMPEXP_SDK bool IsFileReadOnly(const wxFileName& filename); */ WXDLLIMPEXP_SDK void FillFromSemiColonString(wxArrayString& arr, const wxString& str); -/** - * \brief return a string semi-colon separated of the given array - */ -WXDLLIMPEXP_SDK wxString ArrayToSemiColonString(const wxArrayString& array); - /** * \brief Remove all semi colons of the given string */ From 398cc9e3def7212bbe1a22fa4486242a3464ee96 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:04:58 +0200 Subject: [PATCH 04/17] Remove unneeded `XYPair::m_string`. --- wxcrafter/src/xy_pair.cpp | 18 +++++++++--------- wxcrafter/src/xy_pair.h | 3 +-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/wxcrafter/src/xy_pair.cpp b/wxcrafter/src/xy_pair.cpp index f574a67f2b..2586b1e620 100644 --- a/wxcrafter/src/xy_pair.cpp +++ b/wxcrafter/src/xy_pair.cpp @@ -1,18 +1,19 @@ #include "xy_pair.h" + #include "wxgui_helpers.h" -XYPair::XYPair(const wxString& str, int defaultx, int defaulty) - : m_string(str) - , m_x(defaultx) +XYPair::XYPair(wxString str, int defaultx, int defaulty) + : m_x(defaultx) , m_y(defaulty) { - m_string.Trim().Trim(false); - if(m_string.StartsWith(wxT("("))) m_string.Remove(0, 1); + if (str.StartsWith(wxT("("))) + str.Remove(0, 1); - if(m_string.EndsWith(wxT(")"))) m_string.RemoveLast(); + if (str.EndsWith(wxT(")"))) + str.RemoveLast(); - wxString strx = m_string.BeforeFirst(wxT(',')); - wxString stry = m_string.AfterFirst(wxT(',')); + wxString strx = str.BeforeFirst(wxT(',')); + wxString stry = str.AfterFirst(wxT(',')); strx.Trim().Trim(false); stry.Trim().Trim(false); @@ -25,7 +26,6 @@ XYPair::XYPair(int x, int y) : m_x(x) , m_y(y) { - m_string = ToString(false); } XYPair::~XYPair() {} diff --git a/wxcrafter/src/xy_pair.h b/wxcrafter/src/xy_pair.h index c9900d1c7d..65a202da70 100644 --- a/wxcrafter/src/xy_pair.h +++ b/wxcrafter/src/xy_pair.h @@ -6,12 +6,11 @@ class XYPair { protected: - wxString m_string; int m_x; int m_y; public: - XYPair(const wxString& str, int defaultx = -1, int defaulty = -1); + XYPair(wxString str, int defaultx = -1, int defaulty = -1); XYPair(int x, int y); virtual ~XYPair(); From 22aa9f4ad2549e455277904e9865bddaa6f44b33 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:10:21 +0200 Subject: [PATCH 05/17] Remove unussed MACRO `DRAW_LINE` --- Plugin/clTabRendererMinimal.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Plugin/clTabRendererMinimal.cpp b/Plugin/clTabRendererMinimal.cpp index a66e614da9..294ce47366 100644 --- a/Plugin/clTabRendererMinimal.cpp +++ b/Plugin/clTabRendererMinimal.cpp @@ -12,12 +12,6 @@ #include #include -#define DRAW_LINE(__p1, __p2) \ - dc.DrawLine(__p1, __p2); \ - dc.DrawLine(__p1, __p2); \ - dc.DrawLine(__p1, __p2); \ - dc.DrawLine(__p1, __p2); - namespace { #ifdef __WXMAC__ From 2b3946b53180fa3a30a0a1c85ec3d4cb59dffb6a Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:14:56 +0200 Subject: [PATCH 06/17] Remove unused function `StripSemiColons`. --- Plugin/globals.cpp | 2 -- Plugin/globals.h | 5 ----- 2 files changed, 7 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 3ed0d2620a..1327a0e7ed 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -679,8 +679,6 @@ void FillFromSemiColonString(wxArrayString& arr, const wxString& str) arr = StringUtils::BuildArgv(str); } -void StripSemiColons(wxString& str) { str.Replace(";", " "); } - wxString NormalizePath(const wxString& path) { wxString normalized_path(path); diff --git a/Plugin/globals.h b/Plugin/globals.h index a2119db623..a1c9e8fcc0 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -240,11 +240,6 @@ WXDLLIMPEXP_SDK bool IsFileReadOnly(const wxFileName& filename); */ WXDLLIMPEXP_SDK void FillFromSemiColonString(wxArrayString& arr, const wxString& str); -/** - * \brief Remove all semi colons of the given string - */ -WXDLLIMPEXP_SDK void StripSemiColons(wxString& str); - /** * \brief Normalize the given path (change all \ by /) */ From 8060264c4ea25797b8d1c0d4e4b6300fa7c82f57 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:18:56 +0200 Subject: [PATCH 07/17] Remove unused function `MacGetInstallPath` (duplicate of `MacGetBasePath`). --- Plugin/globals.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 1327a0e7ed..c424184f21 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -124,31 +124,6 @@ void MSWSetWindowDarkTheme(wxWindow* win) static wxString DoExpandAllVariables(const wxString& expression, clCxxWorkspace* workspace, const wxString& projectName, const wxString& confToBuild, const wxString& fileName); -#ifdef __WXMAC__ -#include - -// On Mac we determine the base path using system call -//_NSGetExecutablePath(path, &path_len); -static wxString MacGetInstallPath() -{ - char path[257]; - uint32_t path_len = 256; - _NSGetExecutablePath(path, &path_len); - - // path now contains - // CodeLite.app/Contents/MacOS/ - wxFileName fname(wxString(path, wxConvUTF8)); - - // remove he MacOS part of the exe path - wxString file_name = fname.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR); - wxString rest; - file_name.EndsWith("MacOS/", &rest); - rest.Append("SharedSupport/"); - - return rest; -} -#endif - #if defined(__WXGTK__) #include #include From b5f6668bf9e2e43252fa537b40eb65ea8d147c48 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:26:08 +0200 Subject: [PATCH 08/17] Remove unused `RemoveDirectory`. --- Plugin/globals.cpp | 14 -------------- Plugin/globals.h | 7 ------- 2 files changed, 21 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index c424184f21..a6a9e9037b 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -288,20 +288,6 @@ bool ReadFileWithConversion(const wxString& fileName, wxString& content, wxFontE return !content.IsEmpty(); } -bool RemoveDirectory(const wxString& path) -{ - wxString cmd; - if (wxGetOsVersion() & wxOS_WINDOWS) { - // any of the windows variants - cmd << "rmdir /S /Q " - << "\"" << path << "\""; - } else { - cmd << "\rm -fr " - << "\"" << path << "\""; - } - return wxShell(cmd); -} - bool IsValidCppIndetifier(const wxString& id) { if (id.IsEmpty()) { diff --git a/Plugin/globals.h b/Plugin/globals.h index a1c9e8fcc0..cbf5e6fb0a 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -153,13 +153,6 @@ WXDLLIMPEXP_SDK bool WriteFileUTF8(const wxString& fileName, const wxString& con */ WXDLLIMPEXP_SDK bool CompareFileWithString(const wxString& filePath, const wxString& str); -/** - * \brief delete directory using shell command - * \param path directory path - * \return true on success, false otherwise - */ -WXDLLIMPEXP_SDK bool RemoveDirectory(const wxString& path); - /** * \brief return true of id is a valid cpp identifier */ From 3c3280c5d1e0b5a4302a8a2dcab2e4dc62aa6da8 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:29:25 +0200 Subject: [PATCH 09/17] Remove unused `IsValidCppFile`. --- Plugin/globals.cpp | 13 ------------- Plugin/globals.h | 5 ----- 2 files changed, 18 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index a6a9e9037b..0df6630aaf 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -318,19 +318,6 @@ long AppendListCtrlRow(wxListCtrl* list) return item; } -bool IsValidCppFile(const wxString& id) -{ - if (id.IsEmpty()) { - return false; - } - - // make sure that rest of the id contains only a-zA-Z0-9_ - if (id.find_first_not_of("_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") != wxString::npos) { - return false; - } - return true; -} - wxString ExpandVariables(const wxString& expression, ProjectPtr proj, IEditor* editor, const wxString& filename) { wxString project_name(proj->GetName()); diff --git a/Plugin/globals.h b/Plugin/globals.h index cbf5e6fb0a..49472d240f 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -158,11 +158,6 @@ WXDLLIMPEXP_SDK bool CompareFileWithString(const wxString& filePath, const wxStr */ WXDLLIMPEXP_SDK bool IsValidCppIndetifier(const wxString& id); -/** - * \brief return true of id is a valid cpp file - */ -WXDLLIMPEXP_SDK bool IsValidCppFile(const wxString& id); - /** * [DEPRECATED] DONT USE THIS METHOD ANYMORE - USE IMacroManager * Expand variables to their real value, if expanding fails From ca660a7af47f9742665ec0a3aaf8b38585b3db78 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:33:10 +0200 Subject: [PATCH 10/17] Remove unused `WriteFileUTF8`. --- Plugin/globals.cpp | 11 ----------- Plugin/globals.h | 8 -------- 2 files changed, 19 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 0df6630aaf..05ca821f7d 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -500,17 +500,6 @@ wxString DoExpandAllVariables(const wxString& expression, clCxxWorkspace* worksp return output; } -bool WriteFileUTF8(const wxString& fileName, const wxString& content) -{ - wxFFile file(fileName, "w+b"); - if (!file.IsOpened()) { - return false; - } - - // first try the Utf8 - return file.Write(content, wxConvUTF8); -} - bool CompareFileWithString(const wxString& filePath, const wxString& str) { wxString content; diff --git a/Plugin/globals.h b/Plugin/globals.h index 49472d240f..0ccb30a33f 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -137,14 +137,6 @@ WXDLLIMPEXP_SDK long AppendListCtrlRow(wxListCtrl* list); WXDLLIMPEXP_SDK bool ReadFileWithConversion(const wxString& fileName, wxString& content, wxFontEncoding encoding = wxFONTENCODING_DEFAULT, BOM* bom = NULL); -/** - * \brief write file using UTF8 converter - * \param fileName file path - * \param content file's content - * \return true on success, false otherwise - */ -WXDLLIMPEXP_SDK bool WriteFileUTF8(const wxString& fileName, const wxString& content); - /** * \brief compare a file with a wxString using md5 * \param filePath file's full path From 4529bf2228e215244877145620bb64dc77bd1ede Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:51:22 +0200 Subject: [PATCH 11/17] Remove unused `GetCppExpressionFromPos`. --- Plugin/globals.cpp | 172 --------------------------------------------- Plugin/globals.h | 8 --- 2 files changed, 180 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 05ca821f7d..8aa34ea330 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -34,7 +34,6 @@ #include "clGetTextFromUserDialog.h" #include "clTreeCtrl.h" #include "cl_standard_paths.h" -#include "cpp_scanner.h" #include "ctags_manager.h" #include "debugger.h" #include "debuggermanager.h" @@ -1372,177 +1371,6 @@ wxStandardID PromptForYesNoDialogWithCheckbox(const wxString& message, const wxS checkboxInitialValue); } -static wxChar sPreviousChar(wxStyledTextCtrl* ctrl, int pos, int& foundPos, bool wantWhitespace) -{ - wxChar ch = 0; - long curpos = ctrl->PositionBefore(pos); - if (curpos == 0) { - foundPos = curpos; - return ch; - } - - while (true) { - ch = ctrl->GetCharAt(curpos); - if (ch == '\t' || ch == ' ' || ch == '\r' || ch == '\v' || ch == '\n') { - // if the caller is intrested in whitepsaces, - // simply return it - if (wantWhitespace) { - foundPos = curpos; - return ch; - } - - long tmpPos = curpos; - curpos = ctrl->PositionBefore(curpos); - if (curpos == 0 && tmpPos == curpos) { - break; - } - } else { - foundPos = curpos; - return ch; - } - } - foundPos = -1; - return ch; -} - -wxString GetCppExpressionFromPos(long pos, wxStyledTextCtrl* ctrl, bool forCC) -{ - bool cont(true); - int depth(0); - - int position(pos); - int at(position); - bool prevGt(false); - while (cont && depth >= 0) { - wxChar ch = sPreviousChar(ctrl, position, at, true); - position = at; - // Eof? - if (ch == 0) { - at = 0; - break; - } - - // Comment? - int style = ctrl->GetStyleAt(position); - if (style == wxSTC_C_COMMENT || style == wxSTC_C_COMMENTLINE || style == wxSTC_C_COMMENTDOC || - style == wxSTC_C_COMMENTLINEDOC || style == wxSTC_C_COMMENTDOCKEYWORD || - style == wxSTC_C_COMMENTDOCKEYWORDERROR || style == wxSTC_C_STRING || style == wxSTC_C_STRINGEOL || - style == wxSTC_C_CHARACTER) { - continue; - } - - switch (ch) { - case ';': - // dont include this token - at = ctrl->PositionAfter(at); - cont = false; - break; - case '-': - if (prevGt) { - prevGt = false; - // if previous char was '>', we found an arrow so reduce the depth - // which was increased - depth--; - } else { - if (depth <= 0) { - // dont include this token - at = ctrl->PositionAfter(at); - cont = false; - } - } - break; - case ' ': - case '\n': - case '\v': - case '\t': - case '\r': - prevGt = false; - if (depth <= 0) { - cont = false; - break; - } - break; - case '{': - case '=': - prevGt = false; - cont = false; - break; - case '(': - case '[': - depth--; - prevGt = false; - if (depth < 0) { - // dont include this token - at = ctrl->PositionAfter(at); - cont = false; - } - break; - case ',': - case '*': - case '&': - case '!': - case '~': - case '+': - case '^': - case '|': - case '%': - case '?': - prevGt = false; - if (depth <= 0) { - - // dont include this token - at = ctrl->PositionAfter(at); - cont = false; - } - break; - case '>': - prevGt = true; - depth++; - break; - case '<': - prevGt = false; - depth--; - if (depth < 0) { - - // dont include this token - at = ctrl->PositionAfter(at); - cont = false; - } - break; - case ')': - case ']': - prevGt = false; - depth++; - break; - default: - prevGt = false; - break; - } - } - - if (at < 0) { - at = 0; - } - wxString expr = ctrl->GetTextRange(at, pos); - if (!forCC) { - // If we do not require the expression for CodeCompletion - // return the un-touched buffer - return expr; - } - - // remove comments from it - CppScanner sc; - sc.SetText(_C(expr)); - wxString expression; - int type = 0; - while ((type = sc.yylex()) != 0) { - wxString token = _U(sc.YYText()); - expression += token; - expression += " "; - } - return expression; -} - wxString& WrapWithQuotes(wxString& str) { if (!str.empty() && str.Contains(" ") && !str.StartsWith("\"") && !str.EndsWith("\"")) { diff --git a/Plugin/globals.h b/Plugin/globals.h index 0ccb30a33f..49271c5474 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -430,14 +430,6 @@ WXDLLIMPEXP_SDK wxString& WrapWithQuotes(wxString& str); */ WXDLLIMPEXP_SDK wxString& EscapeSpaces(wxString& str); -/** - * @brief return an expression from a given position. - * e.g. if the caret is on a line: - * variable.m_name.m_value| - * the | represents the cart, this function will return the entire expression: variable.m_name.m_value - */ -WXDLLIMPEXP_SDK wxString GetCppExpressionFromPos(long pos, wxStyledTextCtrl* ctrl, bool forCC); - /** * @brief save an xml document to file */ From a055a8a0c909c2e276bca288329d51031a7d9cb7 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:56:36 +0200 Subject: [PATCH 12/17] Remove unused `EscapeSpaces`. --- Plugin/globals.cpp | 6 ------ Plugin/globals.h | 5 ----- 2 files changed, 11 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 8aa34ea330..176ab298d6 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -1379,12 +1379,6 @@ wxString& WrapWithQuotes(wxString& str) return str; } -wxString& EscapeSpaces(wxString& str) -{ - str.Replace(" ", "\\ "); - return str; -} - bool LoadXmlFile(wxXmlDocument* doc, const wxString& filepath) { wxString content; diff --git a/Plugin/globals.h b/Plugin/globals.h index 49271c5474..600a90e0e4 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -425,11 +425,6 @@ WXDLLIMPEXP_SDK wxStandardID PromptForYesNoDialogWithCheckbox( */ WXDLLIMPEXP_SDK wxString& WrapWithQuotes(wxString& str); -/** - * @brief wrap string with quotes if needed - */ -WXDLLIMPEXP_SDK wxString& EscapeSpaces(wxString& str); - /** * @brief save an xml document to file */ From 3f882d4dc1fd339b5276997b178160bca720e86c Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 15 May 2024 23:58:39 +0200 Subject: [PATCH 13/17] Remove unused `MakeCommandRunInBackground`. --- Plugin/globals.cpp | 12 ------------ Plugin/globals.h | 5 ----- 2 files changed, 17 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 176ab298d6..5f778d5c5e 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -1402,18 +1402,6 @@ bool SaveXmlToFile(wxXmlDocument* doc, const wxString& filename) return false; } -wxString MakeCommandRunInBackground(const wxString& cmd) -{ - wxString alteredCommand; -#ifdef __WXMSW__ - alteredCommand << "start /b " << cmd; -#else - // POSIX systems - alteredCommand << cmd << "&"; -#endif - return alteredCommand; -} - void wxPGPropertyBooleanUseCheckbox(wxPropertyGrid* grid) { grid->SetPropertyAttributeAll(wxPG_BOOL_USE_CHECKBOX, true); diff --git a/Plugin/globals.h b/Plugin/globals.h index 600a90e0e4..e5e32dc1aa 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -449,11 +449,6 @@ WXDLLIMPEXP_SDK bool clIsCygwinEnvironment(); */ WXDLLIMPEXP_SDK bool clIsMSYSEnvironment(); -/** - * @brief change the command so it will run in the background - */ -WXDLLIMPEXP_SDK wxString MakeCommandRunInBackground(const wxString& cmd); - /** * @brief enable use of checkbox for boolean properties */ From 64f847eb9bc00beb2e332750bfe11c4f774bb89d Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Thu, 16 May 2024 00:06:19 +0200 Subject: [PATCH 14/17] Remove unused `clNextWord`. --- CodeLite/fileutils.h | 2 +- Plugin/globals.cpp | 2 -- Plugin/globals.h | 17 ----------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/CodeLite/fileutils.h b/CodeLite/fileutils.h index 5e5ac1f9ca..2bf445c5a1 100644 --- a/CodeLite/fileutils.h +++ b/CodeLite/fileutils.h @@ -149,7 +149,7 @@ class WXDLLIMPEXP_CL FileUtils * wxString str = "My String That Requires Tokenize"; * wxString word; // The output * size_t offset = 0; - * while(clNextWord(str, offset, word)) { + * while (NextWord(str, offset, word)) { * // Do something with "word" here * } * @codeend diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index 5f778d5c5e..d1aea4b49c 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -1562,8 +1562,6 @@ int clFindMenuItemPosition(wxMenu* menu, int menuItemId) return wxNOT_FOUND; } -bool clNextWord(const wxString& str, size_t& offset, wxString& word) { return FileUtils::NextWord(str, offset, word); } - wxString clJoinLinesWithEOL(const wxArrayString& lines, int eol) { wxString glue = "\n"; diff --git a/Plugin/globals.h b/Plugin/globals.h index e5e32dc1aa..95dcb2d4d5 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -541,23 +541,6 @@ WXDLLIMPEXP_SDK bool clFindExecutable(const wxString& name, wxFileName& exepath, */ WXDLLIMPEXP_SDK int clFindMenuItemPosition(wxMenu* menu, int menuItemId); -/** - * @brief an efficient way to tokenize string into words (separated by SPACE and/or TAB) - * @code - * wxString str = "My String That Requires Tokenize"; - * wxString word; // The output - * size_t offset = 0; - * while(clNextWord(str, offset, word)) { - * // Do something with "word" here - * } - * @codeend - * @param str the string to tokenize - * @param offset used internally, allocate one on the stack and initialise it to 0 - * @param word [output] - * @return true if a word was found - */ -WXDLLIMPEXP_SDK bool clNextWord(const wxString& str, size_t& offset, wxString& word); - /** * @brief join strings with "\n" or "\r\n" (depends on eol) * eol can be wxSTC_EOL_CRLF, wxSTC_EOL_LF etc From d1a4a6af917f709131a9e97afedbea81203f5384 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Thu, 16 May 2024 00:12:34 +0200 Subject: [PATCH 15/17] Remove unused `IsWindowParentOf`. --- Plugin/globals.cpp | 25 ------------------------- Plugin/globals.h | 3 --- 2 files changed, 28 deletions(-) diff --git a/Plugin/globals.cpp b/Plugin/globals.cpp index d1aea4b49c..316f51da94 100644 --- a/Plugin/globals.cpp +++ b/Plugin/globals.cpp @@ -1793,31 +1793,6 @@ bool SetBestFocus(wxWindow* win) return false; } -bool IsWindowParentOf(wxWindow* parent, wxWindow* child) -{ - if (!child) { - return false; - } - - std::vector Q; - Q.push_back(parent); - - while (!Q.empty()) { - auto parent = Q.front(); - Q.erase(Q.begin()); - - if (parent == child) { - return true; - } - - // put its children - for (auto c : parent->GetChildren()) { - Q.push_back(c); - } - } - return false; -} - Notebook* FindNotebookParentOf(wxWindow* child) { if (!child) { diff --git a/Plugin/globals.h b/Plugin/globals.h index 95dcb2d4d5..37507a8bef 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -598,9 +598,6 @@ WXDLLIMPEXP_SDK bool clShowFileTypeSelectionDialog(wxWindow* parent, const wxArr /// Find the best window starting from `win` and give it the focus WXDLLIMPEXP_SDK bool SetBestFocus(wxWindow* win); -/// Check if Window `parent` is the parent (or grand parent, or grand-grand-parent ...) of `child` -WXDLLIMPEXP_SDK bool IsWindowParentOf(wxWindow* parent, wxWindow* child); - /// Find Notebook parent of a `child` WXDLLIMPEXP_SDK Notebook* FindNotebookParentOf(wxWindow* child); From c08b26d86691e6502153b225082057e1915bb81e Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Thu, 16 May 2024 00:18:51 +0200 Subject: [PATCH 16/17] Remove declaration of `PostCall` with no definition. --- Plugin/globals.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Plugin/globals.h b/Plugin/globals.h index 37507a8bef..e90f4345b9 100644 --- a/Plugin/globals.h +++ b/Plugin/globals.h @@ -367,12 +367,6 @@ WXDLLIMPEXP_SDK wxVariant MakeBitmapIndexText(const wxString& text, int imgIndex */ WXDLLIMPEXP_SDK wxVariant MakeCheckboxVariant(const wxString& label, bool checked, int imgIndex); -/** - * @brief queue a call to a function to be executed on the next event loop - */ -WXDLLIMPEXP_SDK void PostCall(wxObject* instance, clEventFunc_t func, wxClientData* arg); -WXDLLIMPEXP_SDK void PostCall(wxObject* instance, clEventFunc_t func); - /** * @brief split lines (using CR|LF as the separator), taking into considertaion line continuation * @param trim trim the lines with set to true From 6d64ad7ee30292bcacba2b802c93f15664f8c3d7 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Mon, 20 May 2024 11:58:43 +0200 Subject: [PATCH 17/17] Remove `#include "clJoinableThread.h"` from clJoinableThread.h **itself**. --- CodeLite/clJoinableThread.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CodeLite/clJoinableThread.h b/CodeLite/clJoinableThread.h index 5de84249e4..799314f57b 100644 --- a/CodeLite/clJoinableThread.h +++ b/CodeLite/clJoinableThread.h @@ -1,9 +1,10 @@ #ifndef CSJOINABLETHREAD_H #define CSJOINABLETHREAD_H -#include "clJoinableThread.h" #include "codelite_exports.h" + #include + class WXDLLIMPEXP_CL clJoinableThread : public wxThread { protected: