aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/auth
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/auth')
-rw-r--r--launcher/minecraft/auth/AccountData.cpp4
-rw-r--r--launcher/minecraft/auth/AccountList.cpp7
-rw-r--r--launcher/minecraft/auth/MinecraftAccount.cpp6
-rw-r--r--launcher/minecraft/auth/Parsers.cpp8
-rw-r--r--launcher/minecraft/auth/steps/EntitlementsStep.cpp4
5 files changed, 19 insertions, 10 deletions
diff --git a/launcher/minecraft/auth/AccountData.cpp b/launcher/minecraft/auth/AccountData.cpp
index b56f49cb..474bf7c6 100644
--- a/launcher/minecraft/auth/AccountData.cpp
+++ b/launcher/minecraft/auth/AccountData.cpp
@@ -311,7 +311,7 @@ bool AccountData::resumeStateFromV2(QJsonObject data)
QJsonObject profileObject = profileVal.toObject();
QString id = profileObject.value("id").toString("");
QString name = profileObject.value("name").toString("");
- bool legacy = profileObject.value("legacy").toBool(false);
+ bool legacy_ = profileObject.value("legacy").toBool(false);
if (id.isEmpty() || name.isEmpty()) {
qWarning() << "Unable to load a profile" << name << "because it was missing an ID or a name.";
continue;
@@ -319,7 +319,7 @@ bool AccountData::resumeStateFromV2(QJsonObject data)
if (id == currentProfile) {
currentProfileIndex = index;
}
- profiles.append({ id, name, legacy });
+ profiles.append({ id, name, legacy_ });
}
auto& profile = profiles[currentProfileIndex];
diff --git a/launcher/minecraft/auth/AccountList.cpp b/launcher/minecraft/auth/AccountList.cpp
index 317af714..84dbd841 100644
--- a/launcher/minecraft/auth/AccountList.cpp
+++ b/launcher/minecraft/auth/AccountList.cpp
@@ -353,7 +353,7 @@ QVariant AccountList::data(const QModelIndex& index, int role) const
}
}
-QVariant AccountList::headerData(int section, Qt::Orientation orientation, int role) const
+QVariant AccountList::headerData(int section, [[maybe_unused]] Qt::Orientation orientation, int role) const
{
switch (role) {
case Qt::DisplayRole:
@@ -415,7 +415,7 @@ Qt::ItemFlags AccountList::flags(const QModelIndex& index) const
bool AccountList::setData(const QModelIndex& idx, const QVariant& value, int role)
{
- if (idx.row() < 0 || idx.row() >= rowCount(idx) || !idx.isValid()) {
+ if (idx.row() < 0 || idx.row() >= rowCount(idx.parent()) || !idx.isValid()) {
return false;
}
@@ -423,7 +423,8 @@ bool AccountList::setData(const QModelIndex& idx, const QVariant& value, int rol
if (value == Qt::Checked) {
MinecraftAccountPtr account = at(idx.row());
setDefaultAccount(account);
- }
+ } else if (m_defaultAccount == at(idx.row()))
+ setDefaultAccount(nullptr);
}
emit dataChanged(idx, index(idx.row(), columnCount(QModelIndex()) - 1));
diff --git a/launcher/minecraft/auth/MinecraftAccount.cpp b/launcher/minecraft/auth/MinecraftAccount.cpp
index 1dcea207..6c2f0805 100644
--- a/launcher/minecraft/auth/MinecraftAccount.cpp
+++ b/launcher/minecraft/auth/MinecraftAccount.cpp
@@ -37,6 +37,7 @@
#include "MinecraftAccount.h"
+#include <QColor>
#include <QCryptographicHash>
#include <QJsonArray>
#include <QJsonDocument>
@@ -126,6 +127,11 @@ QPixmap MinecraftAccount::getFace() const
return QPixmap();
}
QPixmap skin = QPixmap(8, 8);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+ skin.fill(QColorConstants::Transparent);
+#else
+ skin.fill(QColor(0, 0, 0, 0));
+#endif
QPainter painter(&skin);
painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8));
painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8));
diff --git a/launcher/minecraft/auth/Parsers.cpp b/launcher/minecraft/auth/Parsers.cpp
index 8dbe446a..f6179a93 100644
--- a/launcher/minecraft/auth/Parsers.cpp
+++ b/launcher/minecraft/auth/Parsers.cpp
@@ -113,16 +113,16 @@ bool parseXTokenResponse(QByteArray& data, Katabasis::Token& output, QString nam
if (!item.isObject()) {
continue;
}
- auto obj = item.toObject();
- if (obj.contains("uhs")) {
+ auto obj_ = item.toObject();
+ if (obj_.contains("uhs")) {
foundUHS = true;
} else {
continue;
}
// consume all 'display claims' ... whatever that means
- for (auto iter = obj.begin(); iter != obj.end(); iter++) {
+ for (auto iter = obj_.begin(); iter != obj_.end(); iter++) {
QString claim;
- if (!getString(obj.value(iter.key()), claim)) {
+ if (!getString(obj_.value(iter.key()), claim)) {
qWarning() << "display claim " << iter.key() << " is not a string...";
return false;
}
diff --git a/launcher/minecraft/auth/steps/EntitlementsStep.cpp b/launcher/minecraft/auth/steps/EntitlementsStep.cpp
index e942db52..0573dcb6 100644
--- a/launcher/minecraft/auth/steps/EntitlementsStep.cpp
+++ b/launcher/minecraft/auth/steps/EntitlementsStep.cpp
@@ -36,7 +36,9 @@ void EntitlementsStep::rehydrate()
// NOOP, for now. We only save bools and there's nothing to check.
}
-void EntitlementsStep::onRequestDone(QNetworkReply::NetworkError error, QByteArray data, QList<QNetworkReply::RawHeaderPair> headers)
+void EntitlementsStep::onRequestDone([[maybe_unused]] QNetworkReply::NetworkError error,
+ QByteArray data,
+ [[maybe_unused]] QList<QNetworkReply::RawHeaderPair> headers)
{
auto requestor = qobject_cast<AuthRequest*>(QObject::sender());
requestor->deleteLater();