DolphinQt2: Fix the file structure of extracted discs

Now all the partitions won't be all jumbled up in one folder,
and the filesystem contents won't be mixed with system data.
This commit is contained in:
JosJuice 2018-05-05 16:27:36 +02:00
parent cf40ebf16a
commit 1a74de6462
1 changed files with 10 additions and 3 deletions

View File

@ -181,8 +181,15 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
}
else
{
for (auto& p : m_volume->GetPartitions())
ExtractPartition(p, folder);
for (DiscIO::Partition& p : m_volume->GetPartitions())
{
if (const std::optional<u32> partition_type = m_volume->GetPartitionType(p))
{
const std::string partition_name =
DiscIO::DirectoryNameForPartitionType(*partition_type);
ExtractPartition(p, folder + QChar(u'/') + QString::fromStdString(partition_name));
}
}
}
});
break;
@ -224,7 +231,7 @@ DiscIO::Partition FilesystemWidget::GetPartitionFromID(int id)
void FilesystemWidget::ExtractPartition(const DiscIO::Partition& partition, const QString& out)
{
ExtractDirectory(partition, QStringLiteral(""), out);
ExtractDirectory(partition, QStringLiteral(""), out + QStringLiteral("/files"));
ExtractSystemData(partition, out);
}