summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/dialogs/AccountListDialog.cpp7
-rw-r--r--gui/dialogs/AccountListDialog.h5
2 files changed, 8 insertions, 4 deletions
diff --git a/gui/dialogs/AccountListDialog.cpp b/gui/dialogs/AccountListDialog.cpp
index 86d34de8..5a73cb18 100644
--- a/gui/dialogs/AccountListDialog.cpp
+++ b/gui/dialogs/AccountListDialog.cpp
@@ -23,13 +23,16 @@
#include <gui/dialogs/LoginDialog.h>
#include <gui/dialogs/ProgressDialog.h>
+#include <MultiMC.h>
+
AccountListDialog::AccountListDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AccountListDialog)
{
ui->setupUi(this);
- ui->listView->setModel(&m_accounts);
+ m_accounts = MMC->accounts();
+ ui->listView->setModel(m_accounts.get());
}
AccountListDialog::~AccountListDialog()
@@ -84,7 +87,7 @@ void AccountListDialog::onLoginComplete()
{
// Add the authenticated account to the accounts list.
MojangAccountPtr account = m_authTask->getMojangAccount();
- m_accounts.addAccount(account);
+ m_accounts->addAccount(account);
//ui->listView->update();
}
diff --git a/gui/dialogs/AccountListDialog.h b/gui/dialogs/AccountListDialog.h
index 442834ef..57c8b460 100644
--- a/gui/dialogs/AccountListDialog.h
+++ b/gui/dialogs/AccountListDialog.h
@@ -17,6 +17,8 @@
#include <QDialog>
+#include <memory>
+
#include "logic/lists/MojangAccountList.h"
namespace Ui {
@@ -44,8 +46,7 @@ slots:
void on_closedBtnBox_rejected();
protected:
- // Temporarily putting this here...
- MojangAccountList m_accounts;
+ std::shared_ptr<MojangAccountList> m_accounts;
AuthenticateTask* m_authTask;