Skip to content

Commit

Permalink
Fix return value for subfolders
Browse files Browse the repository at this point in the history
Might be the better solution overall
  • Loading branch information
Fabian Müller committed Aug 24, 2022
1 parent ed7b4eb commit 355129a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gui/folderstatusmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
return QVariant();
return QVariant(f->path() + x._path);
}
case FolderStatusDelegate::IsReady: {
return QVariant(true);
}
}
}
return QVariant();
Expand Down Expand Up @@ -571,9 +574,11 @@ bool FolderStatusModel::canFetchMore(const QModelIndex &parent) const
void FolderStatusModel::fetchMore(const QModelIndex &parent)
{
{
// TODO: investigate why data(...) returns a QVariant(Invalid) for subfolders
const auto isReady = data(parent, FolderStatusDelegate::IsReady);
if (isReady.isValid() && !isReady.toBool()) {

Q_ASSERT(isReady.isValid());

if (!isReady.toBool()) {
return;
}
}
Expand Down

0 comments on commit 355129a

Please sign in to comment.