diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-08-21 15:33:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-21 15:33:16 +0100 |
commit | fff378b643dfb4403c2994bbb47976263b146c20 (patch) | |
tree | a89003f9ef7246e589cb601d1ffd274012833f0e /launcher/minecraft/auth | |
parent | fcb436f1f469d6de09a334f3e131b87b09c9821e (diff) | |
parent | d7dadabfbf61a46996d13894ed591d057bb8c1b3 (diff) | |
download | PrismLauncher-fff378b643dfb4403c2994bbb47976263b146c20.tar.gz PrismLauncher-fff378b643dfb4403c2994bbb47976263b146c20.tar.bz2 PrismLauncher-fff378b643dfb4403c2994bbb47976263b146c20.zip |
Merge pull request #1553 from TheKodeToad/list-fixes
A few boring list-related fixes
Diffstat (limited to 'launcher/minecraft/auth')
-rw-r--r-- | launcher/minecraft/auth/AccountList.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/launcher/minecraft/auth/AccountList.cpp b/launcher/minecraft/auth/AccountList.cpp index c534ea3b..84dbd841 100644 --- a/launcher/minecraft/auth/AccountList.cpp +++ b/launcher/minecraft/auth/AccountList.cpp @@ -415,7 +415,7 @@ Qt::ItemFlags AccountList::flags(const QModelIndex& index) const bool AccountList::setData(const QModelIndex& idx, const QVariant& value, int role) { - if (idx.row() < 0 || idx.row() >= rowCount(idx) || !idx.isValid()) { + if (idx.row() < 0 || idx.row() >= rowCount(idx.parent()) || !idx.isValid()) { return false; } @@ -423,7 +423,8 @@ bool AccountList::setData(const QModelIndex& idx, const QVariant& value, int rol if (value == Qt::Checked) { MinecraftAccountPtr account = at(idx.row()); setDefaultAccount(account); - } + } else if (m_defaultAccount == at(idx.row())) + setDefaultAccount(nullptr); } emit dataChanged(idx, index(idx.row(), columnCount(QModelIndex()) - 1)); |