aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft
diff options
context:
space:
mode:
authorTheLastRar <TheLastRar@users.noreply.github.com>2022-11-14 19:04:41 +0000
committerTheLastRar <TheLastRar@users.noreply.github.com>2022-11-14 19:05:57 +0000
commitaef5349aee82922fb7cedab7489bc84766453700 (patch)
tree2305fc20ad37f2f665b5b8f1d1bd477124efcea4 /launcher/minecraft
parentac993aa31fcab79473f62c2d958b91e921b6930e (diff)
downloadPrismLauncher-aef5349aee82922fb7cedab7489bc84766453700.tar.gz
PrismLauncher-aef5349aee82922fb7cedab7489bc84766453700.tar.bz2
PrismLauncher-aef5349aee82922fb7cedab7489bc84766453700.zip
Pass index.parent() as parent parameter for rowCount
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft')
-rw-r--r--launcher/minecraft/PackProfile.cpp2
-rw-r--r--launcher/minecraft/auth/AccountList.cpp2
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp
index 89b85d6a..6ce525eb 100644
--- a/launcher/minecraft/PackProfile.cpp
+++ b/launcher/minecraft/PackProfile.cpp
@@ -613,7 +613,7 @@ QVariant PackProfile::data(const QModelIndex &index, int role) const
bool PackProfile::setData(const QModelIndex& index, const QVariant& value, int role)
{
- if (!index.isValid() || index.row() < 0 || index.row() >= rowCount(index))
+ if (!index.isValid() || index.row() < 0 || index.row() >= rowCount(index.parent()))
{
return false;
}
diff --git a/launcher/minecraft/auth/AccountList.cpp b/launcher/minecraft/auth/AccountList.cpp
index 6ea62a50..9e2fd111 100644
--- a/launcher/minecraft/auth/AccountList.cpp
+++ b/launcher/minecraft/auth/AccountList.cpp
@@ -421,7 +421,7 @@ int AccountList::columnCount(const QModelIndex &parent) const
Qt::ItemFlags AccountList::flags(const QModelIndex &index) const
{
- if (index.row() < 0 || index.row() >= rowCount(index) || !index.isValid())
+ if (index.row() < 0 || index.row() >= rowCount(index.parent()) || !index.isValid())
{
return Qt::NoItemFlags;
}
diff --git a/launcher/minecraft/mod/ResourceFolderModel.cpp b/launcher/minecraft/mod/ResourceFolderModel.cpp
index b2356309..0310c8f6 100644
--- a/launcher/minecraft/mod/ResourceFolderModel.cpp
+++ b/launcher/minecraft/mod/ResourceFolderModel.cpp
@@ -426,7 +426,7 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
bool ResourceFolderModel::setData(const QModelIndex& index, const QVariant& value, int role)
{
int row = index.row();
- if (row < 0 || row >= rowCount(index) || !index.isValid())
+ if (row < 0 || row >= rowCount(index.parent()) || !index.isValid())
return false;
if (role == Qt::CheckStateRole)