mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-25 15:16:02 +00:00
NOISSUE fix fix fix the accounts again
This commit is contained in:
parent
27e328c044
commit
b49987e876
@ -77,6 +77,12 @@ public:
|
|||||||
{
|
{
|
||||||
return m_ptr;
|
return m_ptr;
|
||||||
}
|
}
|
||||||
|
bool operator==(const shared_qobject_ptr<T>& other) {
|
||||||
|
return m_ptr == other.m_ptr;
|
||||||
|
}
|
||||||
|
bool operator!=(const shared_qobject_ptr<T>& other) {
|
||||||
|
return m_ptr != other.m_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr <T> m_ptr;
|
std::shared_ptr <T> m_ptr;
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
@ -18,7 +18,7 @@ void CapeChange::setCape(QString& cape) {
|
|||||||
|
|
||||||
setStatus(tr("Equipping cape"));
|
setStatus(tr("Equipping cape"));
|
||||||
|
|
||||||
m_reply = std::shared_ptr<QNetworkReply>(rep);
|
m_reply = shared_qobject_ptr<QNetworkReply>(rep);
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||||
@ -32,7 +32,7 @@ void CapeChange::clearCape() {
|
|||||||
|
|
||||||
setStatus(tr("Removing cape"));
|
setStatus(tr("Removing cape"));
|
||||||
|
|
||||||
m_reply = std::shared_ptr<QNetworkReply>(rep);
|
m_reply = shared_qobject_ptr<QNetworkReply>(rep);
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <minecraft/auth/AuthSession.h>
|
#include <minecraft/auth/AuthSession.h>
|
||||||
#include "tasks/Task.h"
|
#include "tasks/Task.h"
|
||||||
|
#include "QObjectPtr.h"
|
||||||
|
|
||||||
class CapeChange : public Task
|
class CapeChange : public Task
|
||||||
{
|
{
|
||||||
@ -20,7 +21,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
QString m_capeId;
|
QString m_capeId;
|
||||||
AuthSessionPtr m_session;
|
AuthSessionPtr m_session;
|
||||||
std::shared_ptr<QNetworkReply> m_reply;
|
shared_qobject_ptr<QNetworkReply> m_reply;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void executeTask();
|
virtual void executeTask();
|
||||||
|
@ -15,7 +15,7 @@ void SkinDelete::executeTask()
|
|||||||
QNetworkRequest request(QUrl("https://api.minecraftservices.com/minecraft/profile/skins/active"));
|
QNetworkRequest request(QUrl("https://api.minecraftservices.com/minecraft/profile/skins/active"));
|
||||||
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_session->access_token).toLocal8Bit());
|
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_session->access_token).toLocal8Bit());
|
||||||
QNetworkReply *rep = APPLICATION->network()->deleteResource(request);
|
QNetworkReply *rep = APPLICATION->network()->deleteResource(request);
|
||||||
m_reply = std::shared_ptr<QNetworkReply>(rep);
|
m_reply = shared_qobject_ptr<QNetworkReply>(rep);
|
||||||
|
|
||||||
setStatus(tr("Deleting skin"));
|
setStatus(tr("Deleting skin"));
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
|
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QtNetwork/QtNetwork>
|
#include <QtNetwork/QtNetwork>
|
||||||
#include <memory>
|
|
||||||
#include <minecraft/auth/AuthSession.h>
|
#include <minecraft/auth/AuthSession.h>
|
||||||
#include "tasks/Task.h"
|
#include "tasks/Task.h"
|
||||||
|
|
||||||
typedef std::shared_ptr<class SkinDelete> SkinDeletePtr;
|
typedef shared_qobject_ptr<class SkinDelete> SkinDeletePtr;
|
||||||
|
|
||||||
class SkinDelete : public Task
|
class SkinDelete : public Task
|
||||||
{
|
{
|
||||||
@ -17,7 +16,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
AuthSessionPtr m_session;
|
AuthSessionPtr m_session;
|
||||||
std::shared_ptr<QNetworkReply> m_reply;
|
shared_qobject_ptr<QNetworkReply> m_reply;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void executeTask();
|
virtual void executeTask();
|
||||||
|
@ -40,7 +40,7 @@ void SkinUpload::executeTask()
|
|||||||
multiPart->append(model);
|
multiPart->append(model);
|
||||||
|
|
||||||
QNetworkReply *rep = APPLICATION->network()->post(request, multiPart);
|
QNetworkReply *rep = APPLICATION->network()->post(request, multiPart);
|
||||||
m_reply = std::shared_ptr<QNetworkReply>(rep);
|
m_reply = shared_qobject_ptr<QNetworkReply>(rep);
|
||||||
|
|
||||||
setStatus(tr("Uploading skin"));
|
setStatus(tr("Uploading skin"));
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <minecraft/auth/AuthSession.h>
|
#include <minecraft/auth/AuthSession.h>
|
||||||
#include "tasks/Task.h"
|
#include "tasks/Task.h"
|
||||||
|
|
||||||
typedef std::shared_ptr<class SkinUpload> SkinUploadPtr;
|
typedef shared_qobject_ptr<class SkinUpload> SkinUploadPtr;
|
||||||
|
|
||||||
class SkinUpload : public Task
|
class SkinUpload : public Task
|
||||||
{
|
{
|
||||||
@ -26,7 +26,7 @@ private:
|
|||||||
Model m_model;
|
Model m_model;
|
||||||
QByteArray m_skin;
|
QByteArray m_skin;
|
||||||
AuthSessionPtr m_session;
|
AuthSessionPtr m_session;
|
||||||
std::shared_ptr<QNetworkReply> m_reply;
|
shared_qobject_ptr<QNetworkReply> m_reply;
|
||||||
protected:
|
protected:
|
||||||
virtual void executeTask();
|
virtual void executeTask();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user