Use wxString instead of wxChar* where necessary

This eliminates compiler errors with wxUSE_STL=1. It's probably also a
cleaner way to pass strings around.
This commit is contained in:
Aaron Puchert 2016-04-12 23:19:04 +02:00
parent 960456627d
commit b7cc65ae85
4 changed files with 10 additions and 11 deletions

View File

@ -913,11 +913,11 @@ void CBOINCBaseView::AppendColumn(int){
} }
void CBOINCBaseView::append_to_status(wxString& existing, const wxChar* additional) { void CBOINCBaseView::append_to_status(wxString& existing, const wxString& additional) {
if (existing.size() == 0) { if (existing.size() == 0) {
existing = additional; existing = additional;
} else { } else {
existing = existing + wxT(", ") + additional; existing += wxT(", ") + additional;
} }
} }

View File

@ -193,7 +193,7 @@ protected:
bool _EnsureLastItemVisible(); bool _EnsureLastItemVisible();
virtual bool EnsureLastItemVisible(); virtual bool EnsureLastItemVisible();
static void append_to_status(wxString& existing, const wxChar* additional); static void append_to_status(wxString& existing, const wxString& additional);
static wxString HtmlEntityEncode(wxString strRaw); static wxString HtmlEntityEncode(wxString strRaw);
static wxString HtmlEntityDecode(wxString strRaw); static wxString HtmlEntityDecode(wxString strRaw);

View File

@ -274,7 +274,7 @@ bool CNetworkConnection::IsComputerNameLocal(const wxString& strMachine) {
int CNetworkConnection::SetComputer( int CNetworkConnection::SetComputer(
const wxChar* szComputer, const int iPort, const wxChar* szPassword, const wxString& szComputer, const int iPort, const wxString& szPassword,
const bool bUseDefaultPassword const bool bUseDefaultPassword
) { ) {
m_strNewComputerName.Empty(); m_strNewComputerName.Empty();
@ -642,7 +642,7 @@ int CMainDocument::ResetState() {
} }
int CMainDocument::Connect(const wxChar* szComputer, int iPort, const wxChar* szComputerPassword, const bool bDisconnect, const bool bUseDefaultPassword) { int CMainDocument::Connect(const wxString& szComputer, int iPort, const wxString& szComputerPassword, const bool bDisconnect, const bool bUseDefaultPassword) {
if (IsComputerNameLocal(szComputer)) { if (IsComputerNameLocal(szComputer)) {
// Restart client if not already running // Restart client if not already running
m_pClientManager->AutoRestart(); m_pClientManager->AutoRestart();
@ -688,7 +688,7 @@ int CMainDocument::GetConnectingComputerName(wxString& strMachine) {
} }
bool CMainDocument::IsComputerNameLocal(const wxString strMachine) { bool CMainDocument::IsComputerNameLocal(const wxString& strMachine) {
return m_pNetworkConnection->IsComputerNameLocal(strMachine); return m_pNetworkConnection->IsComputerNameLocal(strMachine);
} }

View File

@ -75,8 +75,7 @@ public:
bool IsComputerNameLocal(const wxString& strMachine); bool IsComputerNameLocal(const wxString& strMachine);
int GetLocalPassword(wxString& strPassword); int GetLocalPassword(wxString& strPassword);
int SetComputer( int SetComputer(
const wxChar* szComputer, const int iPort, const wxChar* szPassword, const wxString& szComputer, const int iPort, const wxString& szPassword, const bool bUseDefaultPassword
const bool bUseDefaultPassword
); );
void SetStateError(); void SetStateError();
void SetStateErrorAuthentication(); void SetStateErrorAuthentication();
@ -134,9 +133,9 @@ public:
int ResetState(); int ResetState();
int Connect( int Connect(
const wxChar* szComputer, const wxString& szComputer,
const int iPort, const int iPort,
const wxChar* szComputerPassword = wxEmptyString, const wxString& szComputerPassword = wxEmptyString,
const bool bDisconnect = FALSE, const bool bDisconnect = FALSE,
const bool bUseDefaultPassword = FALSE const bool bUseDefaultPassword = FALSE
); );
@ -152,7 +151,7 @@ public:
int GetConnectedComputerName(wxString& strMachine); int GetConnectedComputerName(wxString& strMachine);
int GetConnectedComputerVersion(wxString& strVersion); int GetConnectedComputerVersion(wxString& strVersion);
int GetConnectingComputerName(wxString& strMachine); int GetConnectingComputerName(wxString& strMachine);
bool IsComputerNameLocal(const wxString strMachine); bool IsComputerNameLocal(const wxString& strMachine);
bool IsConnected(); bool IsConnected();
bool IsReconnecting(); bool IsReconnecting();