FilesystemWidget: Show more information about partitions
This commit is contained in:
parent
8a078ea43a
commit
0b86a03438
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
#include <future>
|
#include <future>
|
||||||
|
|
||||||
|
#include "Common/StringUtil.h"
|
||||||
|
|
||||||
#include "DiscIO/DiscExtractor.h"
|
#include "DiscIO/DiscExtractor.h"
|
||||||
#include "DiscIO/DiscUtils.h"
|
#include "DiscIO/DiscUtils.h"
|
||||||
#include "DiscIO/Filesystem.h"
|
#include "DiscIO/Filesystem.h"
|
||||||
|
@ -101,7 +103,7 @@ void FilesystemWidget::PopulateView()
|
||||||
|
|
||||||
for (size_t i = 0; i < partitions.size(); i++)
|
for (size_t i = 0; i < partitions.size(); i++)
|
||||||
{
|
{
|
||||||
auto* item = new QStandardItem(tr("Partition %1").arg(i));
|
auto* item = new QStandardItem;
|
||||||
item->setEditable(false);
|
item->setEditable(false);
|
||||||
|
|
||||||
item->setIcon(Resources::GetScaledIcon("isoproperties_disc"));
|
item->setIcon(Resources::GetScaledIcon("isoproperties_disc"));
|
||||||
|
@ -123,6 +125,58 @@ void FilesystemWidget::PopulateView()
|
||||||
void FilesystemWidget::PopulateDirectory(int partition_id, QStandardItem* root,
|
void FilesystemWidget::PopulateDirectory(int partition_id, QStandardItem* root,
|
||||||
const DiscIO::Partition& partition)
|
const DiscIO::Partition& partition)
|
||||||
{
|
{
|
||||||
|
auto partition_type = m_volume->GetPartitionType(partition);
|
||||||
|
auto game_id = m_volume->GetGameID(partition);
|
||||||
|
auto title_id = m_volume->GetTitleID(partition);
|
||||||
|
|
||||||
|
QString text = root->text();
|
||||||
|
|
||||||
|
if (!text.isEmpty())
|
||||||
|
text += QStringLiteral(" - ");
|
||||||
|
|
||||||
|
if (partition_type)
|
||||||
|
{
|
||||||
|
QString partition_type_str;
|
||||||
|
switch (partition_type.value())
|
||||||
|
{
|
||||||
|
case DiscIO::PARTITION_DATA:
|
||||||
|
partition_type_str = tr("Data Partition (%1)").arg(partition_type.value());
|
||||||
|
break;
|
||||||
|
case DiscIO::PARTITION_UPDATE:
|
||||||
|
partition_type_str = tr("Update Partition (%1)").arg(partition_type.value());
|
||||||
|
break;
|
||||||
|
case DiscIO::PARTITION_CHANNEL:
|
||||||
|
partition_type_str = tr("Channel Partition (%1)").arg(partition_type.value());
|
||||||
|
break;
|
||||||
|
case DiscIO::PARTITION_INSTALL:
|
||||||
|
partition_type_str = tr("Install Partition (%1)").arg(partition_type.value());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
partition_type_str =
|
||||||
|
tr("Other Partition (%1)").arg(partition_type.value(), 8, 16, QLatin1Char('0'));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
text += partition_type_str + QStringLiteral(" - ");
|
||||||
|
}
|
||||||
|
|
||||||
|
text += QString::fromStdString(game_id);
|
||||||
|
|
||||||
|
if (title_id)
|
||||||
|
{
|
||||||
|
text += QStringLiteral(" - %1 (").arg(title_id.value(), 16, 16, QLatin1Char('0'));
|
||||||
|
for (u32 i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
char c = static_cast<char>(title_id.value() >> 8 * (3 - i));
|
||||||
|
if (IsPrintableCharacter(c))
|
||||||
|
text += QLatin1Char(c);
|
||||||
|
else
|
||||||
|
text += QLatin1Char('.');
|
||||||
|
}
|
||||||
|
text += QLatin1Char(')');
|
||||||
|
}
|
||||||
|
|
||||||
|
root->setText(text);
|
||||||
|
|
||||||
const DiscIO::FileSystem* const file_system = m_volume->GetFileSystem(partition);
|
const DiscIO::FileSystem* const file_system = m_volume->GetFileSystem(partition);
|
||||||
if (file_system)
|
if (file_system)
|
||||||
PopulateDirectory(partition_id, root, file_system->GetRoot());
|
PopulateDirectory(partition_id, root, file_system->GetRoot());
|
||||||
|
|
Loading…
Reference in New Issue