mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-27 03:14:49 +00:00
NOISSUE fix account re-adding not updating current account
This commit is contained in:
parent
25fbeb265a
commit
6c82883206
@ -69,14 +69,17 @@ void AccountList::addAccount(const MinecraftAccountPtr account)
|
||||
// override/replace existing account with the same profileId
|
||||
auto existingAccount = findAccountByProfileId(profileId);
|
||||
if(existingAccount != -1) {
|
||||
MinecraftAccountPtr existingAccountPtr = m_accounts[existingAccount];
|
||||
m_accounts[existingAccount] = account;
|
||||
if(m_activeAccount == existingAccountPtr) {
|
||||
m_activeAccount = account;
|
||||
}
|
||||
emit dataChanged(index(existingAccount), index(existingAccount, columnCount(QModelIndex()) - 1));
|
||||
onListChanged();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if we don't have this porfileId yet, add the account to the end
|
||||
int row = m_accounts.count();
|
||||
beginInsertRows(QModelIndex(), row, row);
|
||||
|
@ -89,7 +89,7 @@ void AuthRequest::onUploadProgress(qint64 uploaded, qint64 total) {
|
||||
emit uploadProgress(uploaded, total);
|
||||
}
|
||||
|
||||
void AuthRequest::setup(const QNetworkRequest &req, QNetworkAccessManager::Operation operation, const QByteArray &verb) {
|
||||
void AuthRequest::setup(const QNetworkRequest &req, QNetworkAccessManager::Operation operation) {
|
||||
request_ = req;
|
||||
operation_ = operation;
|
||||
url_ = req.url();
|
||||
@ -97,10 +97,6 @@ void AuthRequest::setup(const QNetworkRequest &req, QNetworkAccessManager::Opera
|
||||
QUrl url = url_;
|
||||
request_.setUrl(url);
|
||||
|
||||
if (!verb.isEmpty()) {
|
||||
request_.setRawHeader(Katabasis::HTTP_HTTP_HEADER, verb);
|
||||
}
|
||||
|
||||
status_ = Requesting;
|
||||
error_ = QNetworkReply::NoError;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ protected slots:
|
||||
void onUploadProgress(qint64 uploaded, qint64 total);
|
||||
|
||||
protected:
|
||||
void setup(const QNetworkRequest &request, QNetworkAccessManager::Operation operation, const QByteArray &verb = QByteArray());
|
||||
void setup(const QNetworkRequest &request, QNetworkAccessManager::Operation operation);
|
||||
|
||||
enum Status {
|
||||
Idle, Requesting, ReRequesting
|
||||
|
Loading…
Reference in New Issue
Block a user