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