Mercurial > minori
diff src/services/anilist.cpp @ 36:2743011a6042
*: mass update
formatted all source files, converted ALL instances of setStyleSheet() to
palettes and fonts (stylesheets suck), and I changed the clang-format file because
it wasn't working on my laptop for some reason.
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Thu, 21 Sep 2023 15:17:47 -0400 |
parents | cde8f67a7c7d |
children | 619cbd6e69f9 |
line wrap: on
line diff
--- a/src/services/anilist.cpp Thu Sep 21 11:43:24 2023 -0400 +++ b/src/services/anilist.cpp Thu Sep 21 15:17:47 2023 -0400 @@ -14,7 +14,6 @@ #include <chrono> #include <curl/curl.h> #include <exception> -#include <format> #define CLIENT_ID "13706" using nlohmann::literals::operator"" _json_pointer; @@ -24,17 +23,13 @@ class Account { public: std::string Username() const { return session.config.anilist.username; } - void SetUsername(std::string const& username) { - session.config.anilist.username = username; - } + void SetUsername(std::string const& username) { session.config.anilist.username = username; } int UserId() const { return session.config.anilist.user_id; } void SetUserId(const int id) { session.config.anilist.user_id = id; } std::string AuthToken() const { return session.config.anilist.auth_token; } - void SetAuthToken(std::string const& auth_token) { - session.config.anilist.auth_token = auth_token; - } + void SetAuthToken(std::string const& auth_token) { session.config.anilist.auth_token = auth_token; } bool Authenticated() const { return !AuthToken().empty(); } }; @@ -68,8 +63,7 @@ curl_easy_cleanup(curl); if (res != CURLE_OK) { QMessageBox box(QMessageBox::Icon::Critical, "", - QString("curl_easy_perform(curl) failed!: ") + - QString(curl_easy_strerror(res))); + QString("curl_easy_perform(curl) failed!: ") + QString(curl_easy_strerror(res))); box.exec(); return ""; } @@ -317,13 +311,12 @@ int AuthorizeUser() { /* Prompt for PIN */ - QDesktopServices::openUrl(QUrl("https://anilist.co/api/v2/oauth/authorize?client_id=" CLIENT_ID - "&response_type=token")); + QDesktopServices::openUrl( + QUrl("https://anilist.co/api/v2/oauth/authorize?client_id=" CLIENT_ID "&response_type=token")); bool ok; QString token = QInputDialog::getText( - 0, "Credentials needed!", - "Please enter the code given to you after logging in to AniList:", QLineEdit::Normal, "", - &ok); + 0, "Credentials needed!", "Please enter the code given to you after logging in to AniList:", QLineEdit::Normal, + "", &ok); if (ok && !token.isEmpty()) account.SetAuthToken(token.toStdString()); else // fail