mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed comment count in channels
This commit is contained in:
parent
0a6e15c524
commit
542650a919
@ -669,23 +669,20 @@ void GxsCommentTreeWidget::addItem(RsGxsMessageId itemId, RsGxsMessageId parentI
|
||||
int treeCount(QTreeWidget *tree, QTreeWidgetItem *parent = 0)
|
||||
{
|
||||
int count = 0;
|
||||
if (parent == 0) {
|
||||
if (parent == 0)
|
||||
{
|
||||
int topCount = tree->topLevelItemCount();
|
||||
for (int i = 0; i < topCount; i++) {
|
||||
QTreeWidgetItem *item = tree->topLevelItem(i);
|
||||
if (item->isExpanded()) {
|
||||
count += treeCount(tree, item);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < topCount; i++)
|
||||
count += treeCount(tree, tree->topLevelItem(i));
|
||||
|
||||
count += topCount;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
int childCount = parent->childCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
QTreeWidgetItem *item = parent->child(i);
|
||||
if (item->isExpanded()) {
|
||||
count += treeCount(tree, item);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < childCount; i++)
|
||||
count += treeCount(tree, parent->child(i));
|
||||
|
||||
count += childCount;
|
||||
}
|
||||
return count;
|
||||
|
Loading…
Reference in New Issue
Block a user