From c8258421d590469b0edb2e81bdae61dd3717b73e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 17 Dec 2023 11:05:57 -0500 Subject: [PATCH] Change Account::m_url to QString and rename to m_avatarUrl --- launcher/include/account.h | 2 +- launcher/src/account.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/launcher/include/account.h b/launcher/include/account.h index 3a500a8..1fd0ae8 100644 --- a/launcher/include/account.h +++ b/launcher/include/account.h @@ -110,6 +110,6 @@ private: AccountConfig m_config; QString m_key; - QUrl m_url; + QString m_avatarUrl; LauncherCore &m_launcher; }; \ No newline at end of file diff --git a/launcher/src/account.cpp b/launcher/src/account.cpp index c08bd5e..f0518fb 100644 --- a/launcher/src/account.cpp +++ b/launcher/src/account.cpp @@ -73,7 +73,7 @@ void Account::setLodestoneId(const QString &id) QString Account::avatarUrl() const { - return m_url.toString(); + return m_avatarUrl; } bool Account::isSapphire() const @@ -221,12 +221,12 @@ void Account::fetchAvatar() return; } - const auto cacheLocation = QStandardPaths::standardLocations(QStandardPaths::CacheLocation)[0] + QStringLiteral("/avatars"); + const QString cacheLocation = QStandardPaths::standardLocations(QStandardPaths::CacheLocation)[0] + QStringLiteral("/avatars"); if (!QDir().exists(cacheLocation)) { QDir().mkpath(cacheLocation); } - const QString filename(QStringLiteral("%1/%2.jpg").arg(cacheLocation, lodestoneId())); + const QString filename = QStringLiteral("%1/%2.jpg").arg(cacheLocation, lodestoneId()); if (!QFile(filename).exists()) { qDebug() << "Did not find lodestone character " << lodestoneId() << " in cache, fetching from xivapi."; @@ -252,13 +252,13 @@ void Account::fetchAvatar() file.write(avatarReply->readAll()); file.close(); - m_url = QUrl(QStringLiteral("file:///%1").arg(filename)); + m_avatarUrl = QStringLiteral("file:///%1").arg(filename); Q_EMIT avatarUrlChanged(); }); } }); } else { - m_url = QUrl(QStringLiteral("file:///%1").arg(filename)); + m_avatarUrl = QStringLiteral("file:///%1").arg(filename); Q_EMIT avatarUrlChanged(); } }