diff options
author | Sky <git@bunnies.cc> | 2013-11-27 22:51:45 +0000 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2013-11-27 22:51:45 +0000 |
commit | d32cb1c95d5c1a50c322085cdfe4bf3f991431e7 (patch) | |
tree | 8a31c6ed1c2da0513596d8bb82dc439101a7aec9 /logic/lists | |
parent | 70973d111a35c65072b9431420d3d854bd82e8f5 (diff) | |
parent | a4c5f0135ef8e3671f54cf56b1aa8766ee4b4a20 (diff) | |
download | MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar.gz MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar.lz MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar.xz MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.zip |
Merge remote-tracking branch 'upstream/feature_yggdrasil' into develop
Diffstat (limited to 'logic/lists')
-rw-r--r-- | logic/lists/MojangAccountList.cpp | 13 | ||||
-rw-r--r-- | logic/lists/MojangAccountList.h | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/logic/lists/MojangAccountList.cpp b/logic/lists/MojangAccountList.cpp index 1d67c70f..a30ef4ab 100644 --- a/logic/lists/MojangAccountList.cpp +++ b/logic/lists/MojangAccountList.cpp @@ -93,9 +93,16 @@ MojangAccountPtr MojangAccountList::activeAccount() const void MojangAccountList::setActiveAccount(const QString& username) { beginResetModel(); - for (MojangAccountPtr account : m_accounts) - if (account->username() == username) - m_activeAccount = username; + if (username.isEmpty()) + { + m_activeAccount = ""; + } + else + { + for (MojangAccountPtr account : m_accounts) + if (account->username() == username) + m_activeAccount = username; + } endResetModel(); onListChanged(); } diff --git a/logic/lists/MojangAccountList.h b/logic/lists/MojangAccountList.h index 71f472f7..cfe96c11 100644 --- a/logic/lists/MojangAccountList.h +++ b/logic/lists/MojangAccountList.h @@ -122,6 +122,7 @@ public: /*! * Sets the given account as the current active account. + * If the username given is an empty string, sets the active account to nothing. */ virtual void setActiveAccount(const QString& username); |