diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2023-12-12 11:06:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-12 11:06:37 -0500 |
| commit | 15bebf1695246c85852835b0fae58d795626dc39 (patch) | |
| tree | 03de654621e65cb185b2a2e3511f71b933b005ef /src/yuzu/play_time_manager.h | |
| parent | 5c840334b8c1fae4e54986768a46e46a350b6318 (diff) | |
| parent | a22a025c5bd579d782225cafba1b56896d22e4cd (diff) | |
Merge pull request #12328 from german77/profile_manager
core: Use single instance of profile manager
Diffstat (limited to 'src/yuzu/play_time_manager.h')
| -rw-r--r-- | src/yuzu/play_time_manager.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/yuzu/play_time_manager.h b/src/yuzu/play_time_manager.h index 5f96f3447..1714b9131 100644 --- a/src/yuzu/play_time_manager.h +++ b/src/yuzu/play_time_manager.h @@ -11,6 +11,10 @@ #include "common/common_types.h" #include "common/polyfill_thread.h" +namespace Service::Account { +class ProfileManager; +} + namespace PlayTime { using ProgramId = u64; @@ -19,7 +23,7 @@ using PlayTimeDatabase = std::map<ProgramId, PlayTime>; class PlayTimeManager { public: - explicit PlayTimeManager(); + explicit PlayTimeManager(Service::Account::ProfileManager& profile_manager); ~PlayTimeManager(); YUZU_NON_COPYABLE(PlayTimeManager); @@ -32,11 +36,13 @@ public: void Stop(); private: + void AutoTimestamp(std::stop_token stop_token); + void Save(); + PlayTimeDatabase database; u64 running_program_id; std::jthread play_time_thread; - void AutoTimestamp(std::stop_token stop_token); - void Save(); + Service::Account::ProfileManager& manager; }; QString ReadablePlayTime(qulonglong time_seconds); |
