moved to QueuedConnection to update the feed count

This commit is contained in:
csoler 2019-12-19 21:04:18 +01:00
parent 93cd6a5df1
commit 856d1b62a7
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
5 changed files with 21 additions and 25 deletions

View file

@ -392,9 +392,20 @@ void RSFeedWidget::removeFeedItem(FeedItem *feedItem)
QTreeWidgetItem *treeItem = findTreeWidgetItem(feedItem);
feedRemoved(feedItem);
if (treeItem) {
if (treeItem)
{
int treeItem_index = ui->treeWidget->indexOfTopLevelItem(treeItem);
if(treeItem_index < 0)
{
std::cerr << "(EE) Cannot remove designated item \"" << feedItem->uniqueIdentifier() << "\": not found!" << std::endl;
return ;
}
ui->treeWidget->takeTopLevelItem(treeItem_index);
delete(treeItem);
}
}
if (!mCountChangedDisabled) {
emit feedCountChanged();
@ -498,6 +509,9 @@ FeedItem *RSFeedWidget::findFeedItem(const std::string& identifier)
std::string id = feedItem->uniqueIdentifier();
std::cerr << "Comparing \"" << id << "\"";
std::cerr << " to " << identifier << "\"" << " pthread_t = " << pthread_self() << std::endl;
if (id == identifier)
return feedItem;
}