Fix extracting files from Wii discs

I broke it for individual files but not folders in 4.0-6016.
This commit is contained in:
JosJuice 2015-04-24 22:08:15 +02:00
parent 87a63713f4
commit 2e10a71dcd
1 changed files with 8 additions and 3 deletions

View File

@ -755,7 +755,10 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
if (OpenISO->IsWiiDisc()) if (OpenISO->IsWiiDisc())
{ {
WiiPartition* partition = reinterpret_cast<WiiPartition*>(m_Treectrl->GetItemData(m_Treectrl->GetSelection())); const wxTreeItemId tree_selection = m_Treectrl->GetSelection();
WiiPartition* partition = reinterpret_cast<WiiPartition*>(m_Treectrl->GetItemData(tree_selection));
File.erase(0, m_Treectrl->GetItemText(tree_selection).length() + 1); // Remove "Partition x/"
partition->FileSystem->ExportFile(WxStrToStr(File), WxStrToStr(Path)); partition->FileSystem->ExportFile(WxStrToStr(File), WxStrToStr(Path));
} }
else else
@ -897,8 +900,10 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)
if (OpenISO->IsWiiDisc()) if (OpenISO->IsWiiDisc())
{ {
WiiPartition* partition = reinterpret_cast<WiiPartition*>(m_Treectrl->GetItemData(m_Treectrl->GetSelection())); const wxTreeItemId tree_selection = m_Treectrl->GetSelection();
Directory.erase(0, m_Treectrl->GetItemText(m_Treectrl->GetSelection()).length() + 1); // Remove "Partition x/" WiiPartition* partition = reinterpret_cast<WiiPartition*>(m_Treectrl->GetItemData(tree_selection));
Directory.erase(0, m_Treectrl->GetItemText(tree_selection).length() + 1); // Remove "Partition x/"
ExportDir(WxStrToStr(Directory), WxStrToStr(Path), partition); ExportDir(WxStrToStr(Directory), WxStrToStr(Path), partition);
} }
else else