diff --git a/src/yuzu/game/game_list_p.h b/src/yuzu/game/game_list_p.h index f03509d7ef..95f5f7eb78 100644 --- a/src/yuzu/game/game_list_p.h +++ b/src/yuzu/game/game_list_p.h @@ -75,13 +75,17 @@ public: GameListItemPath() = default; GameListItemPath(const QString& game_path, const std::vector& picture_data, - const QString& game_name, const QString& game_type, u64 program_id) { + const QString& game_name, const QString& game_type, u64 program_id, + u64 play_time) { setData(type(), TypeRole); setData(game_path, FullPathRole); setData(game_name, TitleRole); setData(qulonglong(program_id), ProgramIdRole); setData(game_type, FileTypeRole); + setData(QString::fromStdString(PlayTime::PlayTimeManager::GetReadablePlayTime(play_time)), + Qt::ToolTipRole); + const u32 size = UISettings::values.game_icon_size.GetValue(); QPixmap picture; @@ -252,7 +256,9 @@ public: void setData(const QVariant& value, int role) override { qulonglong time_seconds = value.toULongLong(); - GameListItem::setData(QString::fromStdString(PlayTime::PlayTimeManager::GetReadablePlayTime(time_seconds)), Qt::DisplayRole); + GameListItem::setData( + QString::fromStdString(PlayTime::PlayTimeManager::GetReadablePlayTime(time_seconds)), + Qt::DisplayRole); GameListItem::setData(value, PlayTimeRole); } diff --git a/src/yuzu/game/game_list_worker.cpp b/src/yuzu/game/game_list_worker.cpp index 3eb5233dfb..d9c91334e1 100644 --- a/src/yuzu/game/game_list_worker.cpp +++ b/src/yuzu/game/game_list_worker.cpp @@ -214,11 +214,14 @@ QList MakeGameListEntry(const std::string& path, QString patch_versions = GetGameListCachedObject(fmt::format("{:016X}", patch.GetTitleID()), "pv.txt", [&patch, &loader] { return FormatPatchNameVersions(patch, loader, loader.IsRomFSUpdatable()); }); + + u64 play_time = play_time_manager.GetPlayTime(program_id); return QList{ - new GameListItemPath(FormatGameName(path), icon, QString::fromStdString(name), file_type_string, program_id), + new GameListItemPath(FormatGameName(path), icon, QString::fromStdString(name), + file_type_string, program_id, play_time), new GameListItem(file_type_string), new GameListItemSize(size), - new GameListItemPlayTime(play_time_manager.GetPlayTime(program_id)), + new GameListItemPlayTime(play_time), new GameListItem(patch_versions), new GameListItemCompat(compatibility), };