Qt: Crash fix
This commit is contained in:
parent
3ff5012f50
commit
8438506206
src/duckstation-qt
|
@ -15,8 +15,8 @@
|
||||||
#include <QtGui/QPainter>
|
#include <QtGui/QPainter>
|
||||||
|
|
||||||
static constexpr std::array<const char*, GameListModel::Column_Count> s_column_names = {
|
static constexpr std::array<const char*, GameListModel::Column_Count> s_column_names = {
|
||||||
{"Type", "Serial", "Title", "File Title", "Developer", "Publisher", "Genre", "Year", "Players", "Size", "Region",
|
{"Type", "Serial", "Title", "File Title", "Developer", "Publisher", "Genre", "Year", "Players", "Time Played",
|
||||||
"Compatibility", "Cover"}};
|
"Last Played", "Size", "Region", "Compatibility", "Cover"}};
|
||||||
|
|
||||||
static constexpr int COVER_ART_WIDTH = 512;
|
static constexpr int COVER_ART_WIDTH = 512;
|
||||||
static constexpr int COVER_ART_HEIGHT = 512;
|
static constexpr int COVER_ART_HEIGHT = 512;
|
||||||
|
@ -302,12 +302,12 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||||
return QString("%1 MB").arg(static_cast<double>(ge->total_size) / 1048576.0, 0, 'f', 2);
|
return QString("%1 MB").arg(static_cast<double>(ge->total_size) / 1048576.0, 0, 'f', 2);
|
||||||
|
|
||||||
case Column_TimePlayed:
|
case Column_TimePlayed:
|
||||||
{
|
{
|
||||||
if (ge->total_played_time == 0)
|
if (ge->total_played_time == 0)
|
||||||
return {};
|
return {};
|
||||||
else
|
else
|
||||||
return QtUtils::StringViewToQString(GameList::FormatTimespan(ge->total_played_time));
|
return QtUtils::StringViewToQString(GameList::FormatTimespan(ge->total_played_time));
|
||||||
}
|
}
|
||||||
|
|
||||||
case Column_LastPlayed:
|
case Column_LastPlayed:
|
||||||
return QtUtils::StringViewToQString(GameList::FormatTimestamp(ge->last_played_time));
|
return QtUtils::StringViewToQString(GameList::FormatTimestamp(ge->last_played_time));
|
||||||
|
|
Loading…
Reference in New Issue