aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/PackProfile.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-11-14 14:15:46 -0800
committerGitHub <noreply@github.com>2022-11-14 14:15:46 -0800
commitfece9e207bdae16574f450593346e80f50702b00 (patch)
tree030dd7d9d47fe1dc47e76059f612e89004146836 /launcher/minecraft/PackProfile.cpp
parentf60b09568c503fc52204ad3411d8ae0091d4877b (diff)
parentaef5349aee82922fb7cedab7489bc84766453700 (diff)
downloadPrismLauncher-fece9e207bdae16574f450593346e80f50702b00.tar.gz
PrismLauncher-fece9e207bdae16574f450593346e80f50702b00.tar.bz2
PrismLauncher-fece9e207bdae16574f450593346e80f50702b00.zip
Merge pull request #448 from TheLastRar/fixup-warnings
Diffstat (limited to 'launcher/minecraft/PackProfile.cpp')
-rw-r--r--launcher/minecraft/PackProfile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp
index 1618458f..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;
}
@@ -675,12 +675,12 @@ Qt::ItemFlags PackProfile::flags(const QModelIndex &index) const
int PackProfile::rowCount(const QModelIndex &parent) const
{
- return d->components.size();
+ return parent.isValid() ? 0 : d->components.size();
}
int PackProfile::columnCount(const QModelIndex &parent) const
{
- return NUM_COLUMNS;
+ return parent.isValid() ? 0 : NUM_COLUMNS;
}
void PackProfile::move(const int index, const MoveDirection direction)