Qt: Fix CRC in game list showing in lowercase

This commit is contained in:
Connor McLaughlin 2022-07-17 23:39:01 +10:00 committed by refractionpcsx2
parent b36b4e4ad1
commit 1767213321
2 changed files with 6 additions and 10 deletions

View File

@ -17,9 +17,11 @@
#include "GameListModel.h"
#include "QtHost.h"
#include "QtUtils.h"
#include "common/FileSystem.h"
#include "common/Path.h"
#include "common/StringUtil.h"
#include "fmt/format.h"
#include <QtCore/QDate>
#include <QtCore/QDateTime>
#include <QtGui/QGuiApplication>
@ -202,13 +204,10 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
return QString::fromStdString(ge->title);
case Column_FileTitle:
{
const std::string_view file_title(Path::GetFileTitle(ge->path));
return QString::fromUtf8(file_title.data(), static_cast<int>(file_title.length()));
}
return QtUtils::StringViewToQString(Path::GetFileTitle(ge->path));
case Column_CRC:
return QStringLiteral("%1").arg(ge->crc, 8, 16, QChar('0'));
return QString::fromStdString(fmt::format("{:08X}", ge->crc));
case Column_Size:
return QString("%1 MB").arg(static_cast<double>(ge->total_size) / 1048576.0, 0, 'f', 2);
@ -241,10 +240,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
return QString::fromStdString(ge->title);
case Column_FileTitle:
{
const std::string_view file_title(Path::GetFileTitle(ge->path));
return QString::fromUtf8(file_title.data(), static_cast<int>(file_title.length()));
}
return QtUtils::StringViewToQString(Path::GetFileTitle(ge->path));
case Column_CRC:
return static_cast<int>(ge->crc);

View File

@ -464,7 +464,7 @@ void GameListWidget::resizeTableViewColumnsToFit()
80, // code
-1, // title
-1, // file title
60, // crc
65, // crc
80, // size
60, // region
100 // compatibility