diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index c192500b9..33b864803 100755 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -212,14 +212,14 @@ void FeedsView::executeNextAutoUpdate() { void FeedsView::setSelectedFeedsClearStatus(int clear) { m_sourceModel->markFeedsDeleted(selectedFeeds(), clear, 0); - updateCountsOfSelectedFeeds(); + updateCountsOfSelectedFeeds(true); emit feedsNeedToBeReloaded(1); } void FeedsView::setAllFeedsClearStatus(int clear) { m_sourceModel->markFeedsDeleted(allFeeds(), clear, 0); - updateCountsOfAllFeeds(); + updateCountsOfAllFeeds(true); emit feedsNeedToBeReloaded(1); } @@ -348,9 +348,9 @@ void FeedsView::deleteSelectedItem() { if (m_sourceModel->removeItem(m_proxyModel->mapToSource(current_index))) { // Item WAS removed, update counts. - // TODO: I do not need to update counts of all items here. - // Updating counts of parent item (feed) should be enough. - updateCountsOfAllFeeds(true); + // TODO: Apparently, I do not need to update counts of all items here, therefore updateCountsOfAllFeeds(true) + // is not needed probably. We just need to inform other parts of application that number of messages has changed. + notifyWithCounts(); } else { // Item WAS NOT removed, either database-related error occurred @@ -412,7 +412,7 @@ void FeedsView::emptyRecycleBin() { } m_sourceModel->recycleBin()->empty(); - updateCountsOfSelectedFeeds(); + updateCountsOfSelectedFeeds(true); emit feedsNeedToBeReloaded(1); } @@ -459,8 +459,7 @@ void FeedsView::updateCountsOfAllFeeds(bool update_total_too) { notifyWithCounts(); } -void FeedsView::updateCountsOfParticularFeed(FeedsModelFeed *feed, - bool update_total_too) { +void FeedsView::updateCountsOfParticularFeed(FeedsModelFeed *feed, bool update_total_too) { QModelIndex index = m_sourceModel->indexForItem(feed); if (index.isValid()) { diff --git a/src/gui/feedsview.h b/src/gui/feedsview.h index c881cd107..887534bb6 100644 --- a/src/gui/feedsview.h +++ b/src/gui/feedsview.h @@ -112,19 +112,18 @@ class FeedsView : public QTreeView { void editFeed(FeedsModelFeed *feed); // Reloads counts for selected feeds. - void updateCountsOfSelectedFeeds(bool update_total_too = true); + void updateCountsOfSelectedFeeds(bool update_total_too); // Reloads counts for all feeds. - void updateCountsOfAllFeeds(bool update_total_too = true); + void updateCountsOfAllFeeds(bool update_total_too); // Reloads counts for particular feed. - void updateCountsOfParticularFeed(FeedsModelFeed *feed, bool update_total_too = true); + void updateCountsOfParticularFeed(FeedsModelFeed *feed, bool update_total_too); // Notifies other components about messages // counts. inline void notifyWithCounts() { - emit feedCountsChanged(m_sourceModel->countOfUnreadMessages(), - m_sourceModel->countOfAllMessages()); + emit feedCountsChanged(m_sourceModel->countOfUnreadMessages(), m_sourceModel->countOfAllMessages()); } // Selects next/previous item (feed/category) in the list. diff --git a/src/gui/formmain.cpp b/src/gui/formmain.cpp index 78423ca7d..f2f5be2b2 100755 --- a/src/gui/formmain.cpp +++ b/src/gui/formmain.cpp @@ -129,6 +129,7 @@ QList FormMain::allActions() { // Add recycle bin actions. actions << m_ui->m_actionRestoreRecycleBin; actions << m_ui->m_actionEmptyRecycleBin; + actions << m_ui->m_actionRestoreSelectedMessagesFromRecycleBin; return actions; }