From c2522f3e433021b4cea27bdbba61965e89a19310 Mon Sep 17 00:00:00 2001 From: Godkratos Date: Mon, 18 May 2020 00:55:32 +1200 Subject: [PATCH] Move new method into anonymous namespace --- src/yuzu/main.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 92f2d2e70e..c10f77d2fe 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -135,6 +135,24 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif +namespace { + + QString GetAccountUsername() { + Service::Account::ProfileManager manager; + const auto current_user = manager.GetUser(Settings::values.current_user); + ASSERT(current_user); + Service::Account::ProfileBase profile; + if (!manager.GetProfileBase(*current_user, profile)) { + return {}; + } + + const auto text = Common::StringFromFixedZeroTerminatedBuffer( + reinterpret_cast(profile.username.data()), profile.username.size()); + return QString::fromStdString(text); + } + +} + constexpr int default_mouse_timeout = 2500; constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000; @@ -441,20 +459,6 @@ void GMainWindow::WebBrowserOpenPage(std::string_view filename, std::string_view #endif -QString GetAccountUsername() { - Service::Account::ProfileManager manager; - const auto current_user = manager.GetUser(Settings::values.current_user); - ASSERT(current_user); - Service::Account::ProfileBase profile; - if (!manager.GetProfileBase(*current_user, profile)) { - return {}; - } - - const auto text = Common::StringFromFixedZeroTerminatedBuffer( - reinterpret_cast(profile.username.data()), profile.username.size()); - return QString::fromStdString(text); -} - void GMainWindow::InitializeWidgets() { #ifdef YUZU_ENABLE_COMPATIBILITY_REPORTING ui.action_Report_Compatibility->setVisible(true);