Skip to content

Commit d4a352b

Browse files
committed
[cleanup] Remove unneeded call to StdToWX::ToArrayString, as wxArrayString now supports initializer_list
1 parent ec95042 commit d4a352b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+478
-480
lines changed

CMakePlugin/CMakePlugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ wxArrayString CMakePlugin::GetSupportedGenerators() const
174174
{
175175
#ifdef __WXMSW__
176176
// Windows supported generators
177-
return StdToWX::ToArrayString({"MinGW Makefiles"});
177+
return {"MinGW Makefiles"};
178178
#else
179179
// Linux / Mac supported generators
180-
return StdToWX::ToArrayString({
180+
return {
181181
"Unix Makefiles",
182182
// "Ninja",
183-
});
183+
};
184184
#endif
185185
}
186186

CodeLite/AsyncProcess/asyncprocess.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class IProcess;
2828

2929
#include "asyncprocess.h"
3030

31-
#include "StdToWX.h"
3231
#include "StringUtils.h"
3332
#include "clTempFile.hpp"
3433
#include "cl_command_event.h"
@@ -115,9 +114,9 @@ static wxArrayString __WrapInShell(const wxArrayString& args, size_t flags)
115114
if (shell.IsEmpty()) {
116115
shell = "CMD.EXE";
117116
}
118-
return StdToWX::ToArrayString({shell, "/C", "\"" + cmd + "\""});
117+
return {shell, wxString("/C"), "\"" + cmd + "\""};
119118
} else {
120-
return StdToWX::ToArrayString({"/bin/sh", "-c", "'" + cmd + "'"});
119+
return {wxString("/bin/sh"), wxString("-c"), "'" + cmd + "'"};
121120
}
122121
}
123122

CodeLite/Console/clConsoleBase.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "clConsoleBase.h"
22

3-
#include "StdToWX.h"
43
#include "clConsoleAlacritty.hpp"
54
#include "clConsoleCMD.h"
65
#include "clConsoleGnomeTerminal.h"
@@ -95,16 +94,25 @@ clConsoleBase::Ptr_t clConsoleBase::GetTerminal()
9594

9695
wxArrayString clConsoleBase::GetAvailableTerminals()
9796
{
98-
return StdToWX::ToArrayString({
97+
return {
9998
#ifdef __WXMSW__
10099
"CMD",
101100
#elif defined(__WXGTK__)
102-
"konsole", "gnome-terminal", "lxterminal", "mate-terminal", "qterminal",
103-
"xfce4-terminal", "rxvt-unicode", "kgx", "Kitty",
101+
"konsole",
102+
"gnome-terminal",
103+
"lxterminal",
104+
"mate-terminal",
105+
"qterminal",
106+
"xfce4-terminal",
107+
"rxvt-unicode",
108+
"kgx",
109+
"Kitty",
104110
#else
105-
"Terminal", "iTerm2", "Kitty",
111+
"Terminal",
112+
"iTerm2",
113+
"Kitty",
106114
#endif
107-
"alacritty" });
115+
"alacritty"};
108116
}
109117

110118
wxString clConsoleBase::WrapWithQuotesIfNeeded(const wxString& s) const

CodeLite/Console/clConsoleRXVTerminal.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#include "clConsoleRXVTerminal.h"
22

33
#include "Platform/Platform.hpp"
4-
#include "StdToWX.h"
54

65
clConsoleRXVTTerminal::clConsoleRXVTTerminal()
76
{
8-
const wxArrayString commands = StdToWX::ToArrayString({"rxvt-unicode", "urxvt", "rxvt"});
7+
const wxArrayString commands = {"rxvt-unicode", "urxvt", "rxvt"};
98
const auto executable = ThePlatform->AnyWhich(commands);
109

1110
SetTerminalCommand(executable.value_or("rxvt-unicode") + " -cd %WD% -e /bin/bash -c '%COMMAND%'");

CodeLite/Cxx/CxxCodeCompletion.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "CxxExpression.hpp"
55
#include "CxxScannerTokens.h"
66
#include "CxxVariableScanner.h"
7-
#include "StdToWX.h"
87
#include "file_logger.h"
98
#include "fileextmanager.h"
109
#include "fileutils.h"
@@ -210,8 +209,7 @@ void CxxCodeCompletion::shrink_scope(const wxString& text, std::unordered_map<wx
210209
}
211210

212211
// we also include the anonymous entries for this scope
213-
const wxArrayString kinds =
214-
StdToWX::ToArrayString({ "class", "struct", "namespace", "member", "function", "variable", "enum", "macro" });
212+
const wxArrayString kinds = {"class", "struct", "namespace", "member", "function", "variable", "enum", "macro"};
215213
std::vector<TagEntryPtr> anonymous_tags;
216214
get_anonymous_tags(wxEmptyString, kinds, anonymous_tags);
217215

CodeLite/ctags_manager.cpp

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "Cxx/CxxLexerAPI.h"
2929
#include "Cxx/CxxVariableScanner.h"
3030
#include "Cxx/cpp_comment_creator.h"
31-
#include "StdToWX.h"
3231
#include "cl_command_event.h"
3332
#include "codelite_events.h"
3433
#include "database/tags_storage_sqlite3.h"
@@ -208,7 +207,7 @@ bool TagsManager::GetDerivationListInternal(const wxString& path, TagEntryPtr de
208207
{
209208
std::vector<TagEntryPtr> tags;
210209
TagEntryPtr tag;
211-
const wxArrayString kind = StdToWX::ToArrayString({ wxT("class"), wxT("struct") });
210+
const wxArrayString kind = { wxT("class"), wxT("struct") };
212211

213212
GetDatabase()->GetTagsByKindAndPath(kind, path, tags);
214213

@@ -380,7 +379,7 @@ Language* TagsManager::GetLanguage()
380379

381380
void TagsManager::GetClasses(std::vector<TagEntryPtr>& tags)
382381
{
383-
const wxArrayString kind = StdToWX::ToArrayString({ wxT("class"), wxT("struct"), wxT("union") });
382+
const wxArrayString kind = {wxT("class"), wxT("struct"), wxT("union")};
384383

385384
GetDatabase()->GetTagsByKind(kind, wxT("name"), ITagsStorage::OrderAsc, tags);
386385
}
@@ -456,7 +455,7 @@ void TagsManager::CacheFile(const wxString& fileName)
456455
m_cachedFile = fileName;
457456
m_cachedFileFunctionsTags.clear();
458457

459-
const wxArrayString kinds = StdToWX::ToArrayString({ wxT("function"), wxT("prototype") });
458+
const wxArrayString kinds = {wxT("function"), wxT("prototype")};
460459
// disable the cache
461460
GetDatabase()->SetUseCache(false);
462461
GetDatabase()->GetTagsByKindAndFile(kinds, fileName, wxT("line"), ITagsStorage::OrderDesc,
@@ -690,49 +689,49 @@ void TagsManager::GetCXXKeywords(wxStringSet_t& words)
690689

691690
void TagsManager::GetCXXKeywords(wxArrayString& words)
692691
{
693-
words = StdToWX::ToArrayString({ "alignas", "alignof",
694-
"and", "and_eq",
695-
"asm", "auto",
696-
"bitand", "bitor",
697-
"bool", "break",
698-
"case", "catch",
699-
"char", "char16_t",
700-
"char32_t", "class",
701-
"compl", "const",
702-
"constexpr", "const_cast",
703-
"continue", "decltype",
704-
"default", "delete",
705-
"do", "double",
706-
"dynamic_cast", "else",
707-
"enum", "explicit",
708-
"export", "extern",
709-
"false", "final",
710-
"float", "for",
711-
"friend", "goto",
712-
"if", "inline",
713-
"int", "long",
714-
"mutable", "namespace",
715-
"new", "noexcept",
716-
"not", "not_eq",
717-
"nullptr", "operator",
718-
"or", "or_eq",
719-
"override", "private",
720-
"protected", "public",
721-
"register", "reinterpret_cast",
722-
"return", "short",
723-
"signed", "sizeof",
724-
"static", "static_assert",
725-
"static_cast", "struct",
726-
"switch", "template",
727-
"this", "thread_local",
728-
"throw", "true",
729-
"try", "typedef",
730-
"typeid", "typename",
731-
"union", "unsigned",
732-
"using", "virtual",
733-
"void", "volatile",
734-
"wchar_t", "while",
735-
"xor", "xor_eq" });
692+
words = {"alignas", "alignof",
693+
"and", "and_eq",
694+
"asm", "auto",
695+
"bitand", "bitor",
696+
"bool", "break",
697+
"case", "catch",
698+
"char", "char16_t",
699+
"char32_t", "class",
700+
"compl", "const",
701+
"constexpr", "const_cast",
702+
"continue", "decltype",
703+
"default", "delete",
704+
"do", "double",
705+
"dynamic_cast", "else",
706+
"enum", "explicit",
707+
"export", "extern",
708+
"false", "final",
709+
"float", "for",
710+
"friend", "goto",
711+
"if", "inline",
712+
"int", "long",
713+
"mutable", "namespace",
714+
"new", "noexcept",
715+
"not", "not_eq",
716+
"nullptr", "operator",
717+
"or", "or_eq",
718+
"override", "private",
719+
"protected", "public",
720+
"register", "reinterpret_cast",
721+
"return", "short",
722+
"signed", "sizeof",
723+
"static", "static_assert",
724+
"static_cast", "struct",
725+
"switch", "template",
726+
"this", "thread_local",
727+
"throw", "true",
728+
"try", "typedef",
729+
"typeid", "typename",
730+
"union", "unsigned",
731+
"using", "virtual",
732+
"void", "volatile",
733+
"wchar_t", "while",
734+
"xor", "xor_eq"};
736735
}
737736

738737
TagEntryPtrVector_t TagsManager::ParseBuffer(const wxString& content, const wxString& filename, const wxString& kinds)

DatabaseExplorer/MySqlDbAdapter.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "MySqlDbAdapter.h"
2727

28-
#include "StdToWX.h"
2928
#include "constraint.h"
3029
#include "database.h"
3130
#include "dbconnection.h"
@@ -184,10 +183,25 @@ IDbType* MySqlDbAdapter::GetDbTypeByName(const wxString& typeName)
184183

185184
wxArrayString* MySqlDbAdapter::GetDbTypes()
186185
{
187-
return new wxArrayString(StdToWX::ToArrayString(
188-
{ wxT("INT"), wxT("SMALLINT"), wxT("BIGINT"), wxT("TINYINT"), wxT("VARCHAR"), wxT("DOUBLE"), wxT("FLOAT"),
189-
wxT("DECIMAL"), wxT("BOOL"), wxT("DATETIME"), wxT("CHAR"), wxT("TIMESTAMP"), wxT("ENUM"), wxT("SET"),
190-
wxT("LONGBLOB"), wxT("BLOB"), wxT("MEDIUMTEXT"), wxT("TEXT"), wxT("LONGTEXT") }));
186+
return new wxArrayString{wxT("INT"),
187+
wxT("SMALLINT"),
188+
wxT("BIGINT"),
189+
wxT("TINYINT"),
190+
wxT("VARCHAR"),
191+
wxT("DOUBLE"),
192+
wxT("FLOAT"),
193+
wxT("DECIMAL"),
194+
wxT("BOOL"),
195+
wxT("DATETIME"),
196+
wxT("CHAR"),
197+
wxT("TIMESTAMP"),
198+
wxT("ENUM"),
199+
wxT("SET"),
200+
wxT("LONGBLOB"),
201+
wxT("BLOB"),
202+
wxT("MEDIUMTEXT"),
203+
wxT("TEXT"),
204+
wxT("LONGTEXT")};
191205
}
192206
wxString MySqlDbAdapter::GetDefaultSelect(const wxString& dbName, const wxString& tableName)
193207
{

DatabaseExplorer/PostgreSqlDbAdapter.cpp

Lines changed: 60 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "PostgreSqlDbAdapter.h"
2727

28-
#include "StdToWX.h"
2928
#include "constraint.h"
3029
#include "database.h"
3130
#include "dbconnection.h"
@@ -251,42 +250,66 @@ IDbType* PostgreSqlDbAdapter::GetDbTypeByName(const wxString& typeName)
251250

252251
wxArrayString* PostgreSqlDbAdapter::GetDbTypes()
253252
{
254-
return new wxArrayString(StdToWX::ToArrayString(
255-
{ wxT("SMALLINT"), wxT("INTEGER"), wxT("BIGINT"), wxT("DECIMAL"), wxT("NUMERIC"), wxT("REAL"),
256-
wxT("DOUBLE PRECISION"), wxT("SERIAL"), wxT("BIGSERIAL"),
257-
258-
// Monetary types
259-
wxT("CHARACTER VARYING"),
260-
261-
// Character types
262-
wxT("VARCHAR"), wxT("CHARACTER"), wxT("CHAR"), wxT("TEXT"),
263-
264-
// Binary types
265-
wxT("BYTEA"),
266-
267-
// Date/Time types
268-
wxT("TIMESTAMP"), wxT("DATE"), wxT("TIME"), wxT("INTERVAL"),
269-
270-
// Boolean types
271-
wxT("BOOLEAN"),
272-
273-
// Geometric types
274-
wxT("POINT"), wxT("LINE"), wxT("LSEG"), wxT("BOX"), wxT("PATH"), wxT("POLYGON"), wxT("CIRCLE"),
275-
276-
// Network address types
277-
wxT("CIDR"), wxT("INET"), wxT("MACADDR"),
278-
279-
// Bit String types
280-
wxT("BIT"), wxT("BIT VARYING"),
281-
282-
// UUID type
283-
wxT("UUID"),
284-
285-
// XML type
286-
wxT("XML"),
287-
288-
// OTHER TYPES
289-
wxT("OID"), wxT("XID"), wxT("ARRAY"), wxT("REGPROX") }));
253+
return new wxArrayString{wxT("SMALLINT"),
254+
wxT("INTEGER"),
255+
wxT("BIGINT"),
256+
wxT("DECIMAL"),
257+
wxT("NUMERIC"),
258+
wxT("REAL"),
259+
wxT("DOUBLE PRECISION"),
260+
wxT("SERIAL"),
261+
wxT("BIGSERIAL"),
262+
263+
// Monetary types
264+
wxT("CHARACTER VARYING"),
265+
266+
// Character types
267+
wxT("VARCHAR"),
268+
wxT("CHARACTER"),
269+
wxT("CHAR"),
270+
wxT("TEXT"),
271+
272+
// Binary types
273+
wxT("BYTEA"),
274+
275+
// Date/Time types
276+
wxT("TIMESTAMP"),
277+
wxT("DATE"),
278+
wxT("TIME"),
279+
wxT("INTERVAL"),
280+
281+
// Boolean types
282+
wxT("BOOLEAN"),
283+
284+
// Geometric types
285+
wxT("POINT"),
286+
wxT("LINE"),
287+
wxT("LSEG"),
288+
wxT("BOX"),
289+
wxT("PATH"),
290+
wxT("POLYGON"),
291+
wxT("CIRCLE"),
292+
293+
// Network address types
294+
wxT("CIDR"),
295+
wxT("INET"),
296+
wxT("MACADDR"),
297+
298+
// Bit String types
299+
wxT("BIT"),
300+
wxT("BIT VARYING"),
301+
302+
// UUID type
303+
wxT("UUID"),
304+
305+
// XML type
306+
wxT("XML"),
307+
308+
// OTHER TYPES
309+
wxT("OID"),
310+
wxT("XID"),
311+
wxT("ARRAY"),
312+
wxT("REGPROX")};
290313
}
291314
wxString PostgreSqlDbAdapter::GetDefaultSelect(const wxString& dbName, const wxString& tableName)
292315
{

0 commit comments

Comments
 (0)