Bugfixes for auto login

This commit is contained in:
Sky 2013-10-21 22:08:09 +01:00
parent 003fedde01
commit 867efd53a2

View File

@ -461,14 +461,15 @@ void MainWindow::on_actionLaunchInstance_triggered()
{ {
if (m_selectedInstance) if (m_selectedInstance)
{ {
bool autoLogin = MMC->settings()->get("AutoLogin").toBool(); doLogin();
if(autoLogin) doAutoLogin();
else doLogin();
} }
} }
void MainWindow::doAutoLogin() void MainWindow::doAutoLogin()
{ {
if (!m_selectedInstance)
return;
Keyring * k = Keyring::instance(); Keyring * k = Keyring::instance();
QStringList accounts = k->getStoredAccounts("minecraft"); QStringList accounts = k->getStoredAccounts("minecraft");
@ -480,6 +481,7 @@ void MainWindow::doAutoLogin()
if(!password.isEmpty()) if(!password.isEmpty())
{ {
QLOG_INFO() << "Automatically logging in with stored account: " << username; QLOG_INFO() << "Automatically logging in with stored account: " << username;
m_activeInst = m_selectedInstance;
doLogin(username, password); doLogin(username, password);
} }
else else