DiscExtractor: Don't create extra folders when extracting a folder
Before, if you extracted a directory like /map/Final/Release/, Dolphin would create the nested folders map, Final and Release in the output directory and put the files in Release instead of just putting the files directly in the output directory.
This commit is contained in:
parent
6d51992648
commit
39ff203c1e
|
@ -76,11 +76,13 @@ void ExportDirectory(const Volume& volume, const Partition partition, const File
|
||||||
const std::string& export_folder,
|
const std::string& export_folder,
|
||||||
const std::function<bool(const std::string& path)>& update_progress)
|
const std::function<bool(const std::string& path)>& update_progress)
|
||||||
{
|
{
|
||||||
|
File::CreateFullPath(export_folder + '/');
|
||||||
|
|
||||||
for (const FileInfo& file_info : directory)
|
for (const FileInfo& file_info : directory)
|
||||||
{
|
{
|
||||||
const std::string path =
|
const std::string name = file_info.GetName() + (file_info.IsDirectory() ? "/" : "");
|
||||||
filesystem_path + file_info.GetName() + (file_info.IsDirectory() ? "/" : "");
|
const std::string path = filesystem_path + name;
|
||||||
const std::string export_path = export_folder + '/' + path;
|
const std::string export_path = export_folder + '/' + name;
|
||||||
|
|
||||||
if (update_progress(path))
|
if (update_progress(path))
|
||||||
return;
|
return;
|
||||||
|
@ -96,9 +98,7 @@ void ExportDirectory(const Volume& volume, const Partition partition, const File
|
||||||
}
|
}
|
||||||
else if (recursive)
|
else if (recursive)
|
||||||
{
|
{
|
||||||
File::CreateFullPath(export_path);
|
ExportDirectory(volume, partition, file_info, recursive, path, export_path, update_progress);
|
||||||
ExportDirectory(volume, partition, file_info, recursive, path, export_folder,
|
|
||||||
update_progress);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,7 +387,6 @@ void FilesystemPanel::ExtractDirectories(const std::string& full_path,
|
||||||
wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_CAN_ABORT | wxPD_ELAPSED_TIME |
|
wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_CAN_ABORT | wxPD_ELAPSED_TIME |
|
||||||
wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | wxPD_SMOOTH);
|
wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | wxPD_SMOOTH);
|
||||||
|
|
||||||
File::CreateFullPath(output_folder + "/" + full_path);
|
|
||||||
DiscIO::ExportDirectory(
|
DiscIO::ExportDirectory(
|
||||||
*m_opened_iso, filesystem.GetPartition(), *file_info, true, full_path, output_folder,
|
*m_opened_iso, filesystem.GetPartition(), *file_info, true, full_path, output_folder,
|
||||||
[&](const std::string& path) {
|
[&](const std::string& path) {
|
||||||
|
|
Loading…
Reference in New Issue