From 420bf78c93ba938c552e618713362d9e0c7eaa59 Mon Sep 17 00:00:00 2001 From: ExMix Date: Tue, 21 Oct 2014 17:29:17 +0300 Subject: [PATCH] [core] special method for get OutOfDate country count --- map/active_maps_layout.cpp | 14 ++++++++++++++ map/active_maps_layout.hpp | 2 ++ 2 files changed, 16 insertions(+) diff --git a/map/active_maps_layout.cpp b/map/active_maps_layout.cpp index 18809398ec..42c52fb577 100644 --- a/map/active_maps_layout.cpp +++ b/map/active_maps_layout.cpp @@ -133,6 +133,19 @@ void ActiveMapsLayout::CancelAll() st.DeleteFromDownloader(index); } +int ActiveMapsLayout::GetOutOfDateCount() const +{ + int result = 0; + for (size_t i = m_split.first; i < m_split.second; ++i) + { + Item const & item = m_items[i]; + if (item.m_status != TStatus::ENotDownloaded) + ++result; + } + + return result; +} + int ActiveMapsLayout::GetCountInGroup(TGroup const & group) const { int result = 0; @@ -423,6 +436,7 @@ void ActiveMapsLayout::StatusChangedCallback(TIndex const & index) { // "Actual of not map been deleted" // We not notify about options changed! + NotifyStatusChanged(group, position, oldStatus, item.m_status); DeleteFromGroup(group, position); NotifyDeletion(group, position); } diff --git a/map/active_maps_layout.hpp b/map/active_maps_layout.hpp index 434d6782c2..8d7904f705 100644 --- a/map/active_maps_layout.hpp +++ b/map/active_maps_layout.hpp @@ -47,6 +47,8 @@ public: void UpdateAll(); void CancelAll(); + int GetOutOfDateCount() const; + int GetCountInGroup(TGroup const & group) const; bool IsEmpty() const; string const & GetCountryName(TGroup const & group, int position) const;