From 867efd53a29ace0d2f09bcdde08edb4b571a4bd1 Mon Sep 17 00:00:00 2001 From: Sky Date: Mon, 21 Oct 2013 22:08:09 +0100 Subject: Bugfixes for auto login --- gui/mainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index d602efcf..cce16a93 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -461,14 +461,15 @@ void MainWindow::on_actionLaunchInstance_triggered() { if (m_selectedInstance) { - bool autoLogin = MMC->settings()->get("AutoLogin").toBool(); - if(autoLogin) doAutoLogin(); - else doLogin(); + doLogin(); } } void MainWindow::doAutoLogin() { + if (!m_selectedInstance) + return; + Keyring * k = Keyring::instance(); QStringList accounts = k->getStoredAccounts("minecraft"); @@ -480,6 +481,7 @@ void MainWindow::doAutoLogin() if(!password.isEmpty()) { QLOG_INFO() << "Automatically logging in with stored account: " << username; + m_activeInst = m_selectedInstance; doLogin(username, password); } else -- cgit v1.2.3