From b0aed198231568dccf781a4f77a117a6396a1cdf Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Mon, 17 Sep 2018 17:16:01 +0200 Subject: [PATCH] Address a bunch of review comments --- src/citra_qt/compatdb.cpp | 6 +++++- src/citra_qt/compatdb.h | 1 - src/citra_qt/configuration/configure_web.cpp | 2 +- src/citra_qt/discord_impl.h | 2 +- src/citra_qt/main.cpp | 2 +- src/core/telemetry_session.cpp | 2 +- src/core/telemetry_session.h | 2 +- src/web_service/telemetry_json.cpp | 5 +++++ src/web_service/telemetry_json.h | 5 ++--- src/web_service/web_backend.cpp | 8 ++++---- 10 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/citra_qt/compatdb.cpp b/src/citra_qt/compatdb.cpp index fb0042b3c..d6712338c 100644 --- a/src/citra_qt/compatdb.cpp +++ b/src/citra_qt/compatdb.cpp @@ -25,7 +25,11 @@ CompatDB::CompatDB(QWidget* parent) CompatDB::~CompatDB() = default; -enum class CompatDBPage { Intro = 0, Selection = 1, Final = 2 }; +enum class CompatDBPage { + Intro = 0, + Selection = 1, + Final = 2, +}; void CompatDB::Submit() { QButtonGroup* compatibility = new QButtonGroup(this); diff --git a/src/citra_qt/compatdb.h b/src/citra_qt/compatdb.h index 0a0f27cca..ca0dd11d6 100644 --- a/src/citra_qt/compatdb.h +++ b/src/citra_qt/compatdb.h @@ -21,7 +21,6 @@ public: private: std::unique_ptr ui; -private slots: void Submit(); void EnableNext(); }; diff --git a/src/citra_qt/configuration/configure_web.cpp b/src/citra_qt/configuration/configure_web.cpp index cf1daf76b..b0d45527c 100644 --- a/src/citra_qt/configuration/configure_web.cpp +++ b/src/citra_qt/configuration/configure_web.cpp @@ -25,7 +25,7 @@ ConfigureWeb::ConfigureWeb(QWidget* parent) this->setConfiguration(); } -ConfigureWeb::~ConfigureWeb() {} +ConfigureWeb::~ConfigureWeb() = default; void ConfigureWeb::setConfiguration() { ui->web_credentials_disclaimer->setWordWrap(true); diff --git a/src/citra_qt/discord_impl.h b/src/citra_qt/discord_impl.h index e714ae6d9..067cf2e3d 100644 --- a/src/citra_qt/discord_impl.h +++ b/src/citra_qt/discord_impl.h @@ -11,7 +11,7 @@ namespace DiscordRPC { class DiscordImpl : public DiscordInterface { public: DiscordImpl(); - ~DiscordImpl(); + ~DiscordImpl() override; void Pause() override; void Update() override; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 9bdcc06a8..ffc838ea3 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -92,7 +92,7 @@ void GMainWindow::ShowTelemetryCallout() { } UISettings::values.callout_flags |= static_cast(CalloutFlag::Telemetry); - static const QString telemetry_message = + const QString telemetry_message = tr("Anonymous " "data is collected to help improve Citra. " "

Would you like to share your usage data with us?"); diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 015a837f7..94270dbfe 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -82,7 +82,7 @@ u64 RegenerateTelemetryId() { return new_telemetry_id; } -bool VerifyLogin(std::string username, std::string token) { +bool VerifyLogin(const std::string& username, const std::string& token) { #ifdef ENABLE_WEB_SERVICE return WebService::VerifyLogin(Settings::values.web_api_url, username, token); #else diff --git a/src/core/telemetry_session.h b/src/core/telemetry_session.h index 127b6fe5e..bcf206b1b 100644 --- a/src/core/telemetry_session.h +++ b/src/core/telemetry_session.h @@ -56,6 +56,6 @@ u64 RegenerateTelemetryId(); * @param func A function that gets exectued when the verification is finished * @returns Future with bool indicating whether the verification succeeded */ -bool VerifyLogin(std::string username, std::string token); +bool VerifyLogin(const std::string& username, const std::string& token); } // namespace Core diff --git a/src/web_service/telemetry_json.cpp b/src/web_service/telemetry_json.cpp index a0b7f9c4e..033ea1ea4 100644 --- a/src/web_service/telemetry_json.cpp +++ b/src/web_service/telemetry_json.cpp @@ -10,6 +10,11 @@ namespace WebService { +TelemetryJson::TelemetryJson(const std::string& host, const std::string& username, + const std::string& token) + : host(std::move(host)), username(std::move(username)), token(std::move(token)) {} +TelemetryJson::~TelemetryJson() = default; + template void TelemetryJson::Serialize(Telemetry::FieldType type, const std::string& name, T value) { sections[static_cast(type)][name] = value; diff --git a/src/web_service/telemetry_json.h b/src/web_service/telemetry_json.h index 4335ade59..4efef86a4 100644 --- a/src/web_service/telemetry_json.h +++ b/src/web_service/telemetry_json.h @@ -18,9 +18,8 @@ namespace WebService { */ class TelemetryJson : public Telemetry::VisitorInterface { public: - TelemetryJson(const std::string& host, const std::string& username, const std::string& token) - : host(host), username(username), token(token) {} - ~TelemetryJson() = default; + TelemetryJson(const std::string& host, const std::string& username, const std::string& token); + ~TelemetryJson(); void Visit(const Telemetry::Field& field) override; void Visit(const Telemetry::Field& field) override; diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 3c5d278e8..289896165 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -13,12 +13,12 @@ namespace WebService { -static constexpr char API_VERSION[]{"1"}; +constexpr char API_VERSION[]{"1"}; -constexpr int HTTP_PORT = 80; -constexpr int HTTPS_PORT = 443; +constexpr u32 HTTP_PORT = 80; +constexpr u32 HTTPS_PORT = 443; -constexpr int TIMEOUT_SECONDS = 30; +constexpr u32 TIMEOUT_SECONDS = 30; Client::JWTCache Client::jwt_cache{};