DolphinWX: Remove the use of some wx 1.0 compatibility functions.
Uses the recommended replacements.
This commit is contained in:
parent
16582a0459
commit
5c57a1ef4b
|
@ -220,7 +220,9 @@ void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX);
|
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX);
|
||||||
wxString txt = pAddrCtrl->GetValue().Strip(wxString::stripType::both);
|
|
||||||
|
// Trim leading and trailing whitespace.
|
||||||
|
wxString txt = pAddrCtrl->GetValue().Trim().Trim(false);
|
||||||
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
|
|
|
@ -464,13 +464,13 @@ void FifoPlayerDlg::OnBeginSearch(wxCommandEvent& event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: Limited to even str lengths...
|
// TODO: Limited to even str lengths...
|
||||||
if (str_search_val.Length() && str_search_val.Length() % 2)
|
if (!str_search_val.empty() && str_search_val.length() % 2)
|
||||||
{
|
{
|
||||||
m_numResultsText->SetLabel(_("Invalid search string (only even string lengths supported)"));
|
m_numResultsText->SetLabel(_("Invalid search string (only even string lengths supported)"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int const val_length = str_search_val.Length() / 2;
|
unsigned int const val_length = str_search_val.length() / 2;
|
||||||
std::vector<u8> search_val(val_length);
|
std::vector<u8> search_val(val_length);
|
||||||
for (unsigned int i = 0; i < val_length; ++i)
|
for (unsigned int i = 0; i < val_length; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -753,7 +753,7 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
|
||||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||||
{
|
{
|
||||||
int partitionNum = wxAtoi(File.Mid(File.find_first_of("/") - 1, 1));
|
int partitionNum = wxAtoi(File.Mid(File.find_first_of("/") - 1, 1));
|
||||||
File.Remove(0, File.find_first_of("/") + 1); // Remove "Partition x/"
|
File.erase(0, File.find_first_of("/") + 1); // Remove "Partition x/"
|
||||||
WiiDisc.at(partitionNum).FileSystem->ExportFile(WxStrToStr(File), WxStrToStr(Path));
|
WiiDisc.at(partitionNum).FileSystem->ExportFile(WxStrToStr(File), WxStrToStr(Path));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -886,7 +886,7 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)
|
||||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||||
{
|
{
|
||||||
int partitionNum = wxAtoi(Directory.Mid(Directory.find_first_of("/") - 1, 1));
|
int partitionNum = wxAtoi(Directory.Mid(Directory.find_first_of("/") - 1, 1));
|
||||||
Directory.Remove(0, Directory.find_first_of("/") + 1); // Remove "Partition x/"
|
Directory.erase(0, Directory.find_first_of("/") + 1); // Remove "Partition x/"
|
||||||
ExportDir(WxStrToStr(Directory), WxStrToStr(Path), partitionNum);
|
ExportDir(WxStrToStr(Directory), WxStrToStr(Path), partitionNum);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -428,14 +428,15 @@ NetPlayDiag::~NetPlayDiag()
|
||||||
|
|
||||||
void NetPlayDiag::OnChat(wxCommandEvent&)
|
void NetPlayDiag::OnChat(wxCommandEvent&)
|
||||||
{
|
{
|
||||||
wxString s = m_chat_msg_text->GetValue();
|
wxString text = m_chat_msg_text->GetValue();
|
||||||
|
|
||||||
if (s.Length())
|
if (!text.empty())
|
||||||
{
|
{
|
||||||
if (s.Length() > 2000)
|
if (text.length() > 2000)
|
||||||
s.erase(2000);
|
text.erase(2000);
|
||||||
netplay_client->SendChatMessage(WxStrToStr(s));
|
|
||||||
m_chat_text->AppendText(s.Prepend(" >> ").Append('\n'));
|
netplay_client->SendChatMessage(WxStrToStr(text));
|
||||||
|
m_chat_text->AppendText(text.Prepend(" >> ").Append('\n'));
|
||||||
m_chat_msg_text->Clear();
|
m_chat_msg_text->Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -557,11 +558,11 @@ void NetPlayDiag::OnThread(wxCommandEvent& event)
|
||||||
// remove ping from selection string, in case it has changed
|
// remove ping from selection string, in case it has changed
|
||||||
selection.erase(selection.find_last_of("|") + 1);
|
selection.erase(selection.find_last_of("|") + 1);
|
||||||
|
|
||||||
if (selection.Length() > 0)
|
if (!selection.empty())
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < m_player_lbox->GetCount(); ++i)
|
for (unsigned int i = 0; i < m_player_lbox->GetCount(); ++i)
|
||||||
{
|
{
|
||||||
if (selection == m_player_lbox->GetString(i).Mid(0, selection.Length()))
|
if (selection == m_player_lbox->GetString(i).Mid(0, selection.length()))
|
||||||
{
|
{
|
||||||
m_player_lbox->SetSelection(i);
|
m_player_lbox->SetSelection(i);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue