diff options
| author | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-27 20:41:56 +0300 |
|---|---|---|
| committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-27 20:41:56 +0300 |
| commit | 0680d2dceb27f18b1c888bf16079dfd00d07b3ca (patch) | |
| tree | 6874b9733973fc6488a8ebe8bd394f73593b41a7 /launcher/minecraft/auth | |
| parent | ab6301d5a1a2a77d12d73f4ff7088551d6b8aa2e (diff) | |
| parent | 9110fbf2829a48c36fe37cabfb438e165956bbcf (diff) | |
| download | PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.tar.gz PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.tar.bz2 PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.zip | |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
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)); |
