diff options
| author | 2019-01-10 21:53:07 -0500 | |
|---|---|---|
| committer | 2019-04-25 08:13:11 -0400 | |
| commit | 851c01c45eac863359869ab82eea976cc365104d (patch) | |
| tree | 03883d80754d5d7beb1b9f45e6bb5c28d5fbc33b /src/core | |
| parent | mii: Implement Delete and Destroy file (diff) | |
| download | yuzu-851c01c45eac863359869ab82eea976cc365104d.tar.gz yuzu-851c01c45eac863359869ab82eea976cc365104d.tar.xz yuzu-851c01c45eac863359869ab82eea976cc365104d.zip | |
profile_select: Port Service::Account::UUID to Common::UUID
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/frontend/applets/profile_select.cpp | 5 | ||||
| -rw-r--r-- | src/core/frontend/applets/profile_select.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/profile_select.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/profile_select.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii_manager.cpp | 2 |
5 files changed, 12 insertions, 13 deletions
diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp index fbf5f2a9e..4df3574d2 100644 --- a/src/core/frontend/applets/profile_select.cpp +++ b/src/core/frontend/applets/profile_select.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/frontend/applets/profile_select.h" | 5 | #include "core/frontend/applets/profile_select.h" |
| 6 | #include "core/hle/service/acc/profile_manager.h" | ||
| 6 | #include "core/settings.h" | 7 | #include "core/settings.h" |
| 7 | 8 | ||
| 8 | namespace Core::Frontend { | 9 | namespace Core::Frontend { |
| @@ -10,9 +11,9 @@ namespace Core::Frontend { | |||
| 10 | ProfileSelectApplet::~ProfileSelectApplet() = default; | 11 | ProfileSelectApplet::~ProfileSelectApplet() = default; |
| 11 | 12 | ||
| 12 | void DefaultProfileSelectApplet::SelectProfile( | 13 | void DefaultProfileSelectApplet::SelectProfile( |
| 13 | std::function<void(std::optional<Service::Account::UUID>)> callback) const { | 14 | std::function<void(std::optional<Common::UUID>)> callback) const { |
| 14 | Service::Account::ProfileManager manager; | 15 | Service::Account::ProfileManager manager; |
| 15 | callback(manager.GetUser(Settings::values.current_user).value_or(Service::Account::UUID{})); | 16 | callback(manager.GetUser(Settings::values.current_user).value_or(Common::UUID{})); |
| 16 | LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); | 17 | LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); |
| 17 | } | 18 | } |
| 18 | 19 | ||
diff --git a/src/core/frontend/applets/profile_select.h b/src/core/frontend/applets/profile_select.h index fc8f7ae94..3506b9885 100644 --- a/src/core/frontend/applets/profile_select.h +++ b/src/core/frontend/applets/profile_select.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <functional> | 7 | #include <functional> |
| 8 | #include <optional> | 8 | #include <optional> |
| 9 | #include "core/hle/service/acc/profile_manager.h" | 9 | #include "common/uuid.h" |
| 10 | 10 | ||
| 11 | namespace Core::Frontend { | 11 | namespace Core::Frontend { |
| 12 | 12 | ||
| @@ -14,14 +14,12 @@ class ProfileSelectApplet { | |||
| 14 | public: | 14 | public: |
| 15 | virtual ~ProfileSelectApplet(); | 15 | virtual ~ProfileSelectApplet(); |
| 16 | 16 | ||
| 17 | virtual void SelectProfile( | 17 | virtual void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const = 0; |
| 18 | std::function<void(std::optional<Service::Account::UUID>)> callback) const = 0; | ||
| 19 | }; | 18 | }; |
| 20 | 19 | ||
| 21 | class DefaultProfileSelectApplet final : public ProfileSelectApplet { | 20 | class DefaultProfileSelectApplet final : public ProfileSelectApplet { |
| 22 | public: | 21 | public: |
| 23 | void SelectProfile( | 22 | void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const override; |
| 24 | std::function<void(std::optional<Service::Account::UUID>)> callback) const override; | ||
| 25 | }; | 23 | }; |
| 26 | 24 | ||
| 27 | } // namespace Core::Frontend | 25 | } // namespace Core::Frontend |
diff --git a/src/core/hle/service/am/applets/profile_select.cpp b/src/core/hle/service/am/applets/profile_select.cpp index d113bd2eb..3c184859d 100644 --- a/src/core/hle/service/am/applets/profile_select.cpp +++ b/src/core/hle/service/am/applets/profile_select.cpp | |||
| @@ -56,16 +56,16 @@ void ProfileSelect::Execute() { | |||
| 56 | frontend.SelectProfile([this](std::optional<Account::UUID> uuid) { SelectionComplete(uuid); }); | 56 | frontend.SelectProfile([this](std::optional<Account::UUID> uuid) { SelectionComplete(uuid); }); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | void ProfileSelect::SelectionComplete(std::optional<Account::UUID> uuid) { | 59 | void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) { |
| 60 | UserSelectionOutput output{}; | 60 | UserSelectionOutput output{}; |
| 61 | 61 | ||
| 62 | if (uuid.has_value() && uuid->uuid != Account::INVALID_UUID) { | 62 | if (uuid.has_value() && uuid->uuid != Common::INVALID_UUID) { |
| 63 | output.result = 0; | 63 | output.result = 0; |
| 64 | output.uuid_selected = uuid->uuid; | 64 | output.uuid_selected = uuid->uuid; |
| 65 | } else { | 65 | } else { |
| 66 | status = ERR_USER_CANCELLED_SELECTION; | 66 | status = ERR_USER_CANCELLED_SELECTION; |
| 67 | output.result = ERR_USER_CANCELLED_SELECTION.raw; | 67 | output.result = ERR_USER_CANCELLED_SELECTION.raw; |
| 68 | output.uuid_selected = Account::INVALID_UUID; | 68 | output.uuid_selected = Common::INVALID_UUID; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | final_data = std::vector<u8>(sizeof(UserSelectionOutput)); | 71 | final_data = std::vector<u8>(sizeof(UserSelectionOutput)); |
diff --git a/src/core/hle/service/am/applets/profile_select.h b/src/core/hle/service/am/applets/profile_select.h index a2ac6cf50..f99630158 100644 --- a/src/core/hle/service/am/applets/profile_select.h +++ b/src/core/hle/service/am/applets/profile_select.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "common/common_funcs.h" | 9 | #include "common/common_funcs.h" |
| 10 | #include "core/hle/service/acc/profile_manager.h" | 10 | #include "common/uuid.h" |
| 11 | #include "core/hle/service/am/applets/applets.h" | 11 | #include "core/hle/service/am/applets/applets.h" |
| 12 | 12 | ||
| 13 | namespace Service::AM::Applets { | 13 | namespace Service::AM::Applets { |
| @@ -38,7 +38,7 @@ public: | |||
| 38 | void ExecuteInteractive() override; | 38 | void ExecuteInteractive() override; |
| 39 | void Execute() override; | 39 | void Execute() override; |
| 40 | 40 | ||
| 41 | void SelectionComplete(std::optional<Account::UUID> uuid); | 41 | void SelectionComplete(std::optional<Common::UUID> uuid); |
| 42 | 42 | ||
| 43 | private: | 43 | private: |
| 44 | const Core::Frontend::ProfileSelectApplet& frontend; | 44 | const Core::Frontend::ProfileSelectApplet& frontend; |
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 04fc2180b..a526e4440 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp | |||
| @@ -174,7 +174,7 @@ MiiStoreData ConvertInfoToStoreData(const MiiInfo& info) { | |||
| 174 | 174 | ||
| 175 | } // namespace | 175 | } // namespace |
| 176 | 176 | ||
| 177 | std::ostream& operator<<(std::ostream& os,Source source) { | 177 | std::ostream& operator<<(std::ostream& os, Source source) { |
| 178 | os << SOURCE_NAMES.at(static_cast<std::size_t>(source)); | 178 | os << SOURCE_NAMES.at(static_cast<std::size_t>(source)); |
| 179 | return os; | 179 | return os; |
| 180 | } | 180 | } |