From 2556681997912bc46d2b2aa29154e3e2d6d35922 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 26 Feb 2024 20:20:39 +0800 Subject: [PATCH] Clarify role of idx in slotUpdateDirectories Signed-off-by: Claudio Cambra --- src/gui/folderstatusmodel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index d974bf0fcd..c8ca8b0bdd 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -688,8 +688,8 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list) { const auto job = qobject_cast(sender()); ASSERT(job); - const auto idx = qvariant_cast(job->property(propertyParentIndexC)); - const auto parentInfo = infoForIndex(idx); + const auto parentIdx = qvariant_cast(job->property(propertyParentIndexC)); + const auto parentInfo = infoForIndex(parentIdx); if (!parentInfo) { return; } @@ -697,7 +697,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list) ASSERT(parentInfo->_subs.isEmpty()); if (parentInfo->hasLabel()) { - beginRemoveRows(idx, 0, 0); + beginRemoveRows(parentIdx, 0, 0); parentInfo->_hasError = false; parentInfo->_fetchingLabel = false; endRemoveRows(); @@ -819,13 +819,13 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list) } if (!newSubs.isEmpty()) { - beginInsertRows(idx, 0, newSubs.size() - 1); + beginInsertRows(parentIdx, 0, newSubs.size() - 1); parentInfo->_subs = std::move(newSubs); endInsertRows(); } for (const auto undecidedIndex : qAsConst(undecidedIndexes)) { - emit suggestExpand(index(undecidedIndex, 0, idx)); + emit suggestExpand(index(undecidedIndex, 0, parentIdx)); } /* Try to remove from the undecided lists the items that are not on the server. */ const auto it = std::remove_if(selectiveSyncUndecidedList.begin(), selectiveSyncUndecidedList.end(),