mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-10-13 14:01:03 -04:00
fixed comment count in channels
This commit is contained in:
parent
0a6e15c524
commit
542650a919
1 changed files with 11 additions and 14 deletions
|
@ -669,23 +669,20 @@ void GxsCommentTreeWidget::addItem(RsGxsMessageId itemId, RsGxsMessageId parentI
|
||||||
int treeCount(QTreeWidget *tree, QTreeWidgetItem *parent = 0)
|
int treeCount(QTreeWidget *tree, QTreeWidgetItem *parent = 0)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (parent == 0) {
|
if (parent == 0)
|
||||||
|
{
|
||||||
int topCount = tree->topLevelItemCount();
|
int topCount = tree->topLevelItemCount();
|
||||||
for (int i = 0; i < topCount; i++) {
|
for (int i = 0; i < topCount; i++)
|
||||||
QTreeWidgetItem *item = tree->topLevelItem(i);
|
count += treeCount(tree, tree->topLevelItem(i));
|
||||||
if (item->isExpanded()) {
|
|
||||||
count += treeCount(tree, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
count += topCount;
|
count += topCount;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
int childCount = parent->childCount();
|
int childCount = parent->childCount();
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++)
|
||||||
QTreeWidgetItem *item = parent->child(i);
|
count += treeCount(tree, parent->child(i));
|
||||||
if (item->isExpanded()) {
|
|
||||||
count += treeCount(tree, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
count += childCount;
|
count += childCount;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue