diff --git a/storage/storage.cpp b/storage/storage.cpp index 823ac194dd..22a4272c82 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -149,7 +149,7 @@ void Storage::RegisterAllLocalMaps() } } -void Storage::GetLocalMaps(vector & maps) +void Storage::GetLocalMaps(vector & maps) const { for (auto const & p : m_localFiles) { @@ -160,6 +160,11 @@ void Storage::GetLocalMaps(vector & maps) maps.push_back(p.second->GetCountryFile()); } +size_t Storage::GetDownloadedFilesCount() const +{ + return m_localFiles.size(); +} + CountriesContainerT const & NodeFromIndex(CountriesContainerT const & root, TIndex const & index) { // complex logic to avoid [] out_of_bounds exceptions diff --git a/storage/storage.hpp b/storage/storage.hpp index 553e387f3e..8a448779c1 100644 --- a/storage/storage.hpp +++ b/storage/storage.hpp @@ -48,6 +48,7 @@ private: using TLocalFilePtr = shared_ptr; map> m_localFiles; + // Our World.mwm and WorldCoasts.mwm are fake countries, together with any custom mwm in data folder. map m_localFilesForFakeCountries; /// used to correctly calculate total country download progress with more than 1 file @@ -114,8 +115,10 @@ public: // *NOTE* storage will forget all already known local maps. void RegisterAllLocalMaps(); - // Returns list of all local maps, including fake countries. - void GetLocalMaps(vector & maps); + // Returns list of all local maps, including fake countries (World*.mwm). + void GetLocalMaps(vector & maps) const; + // Returns number of downloaded maps (files), excluding fake countries (World*.mwm). + size_t GetDownloadedFilesCount() const; /// @return unique identifier that should be used with Unsubscribe function int Subscribe(TChangeCountryFunction const & change, TProgressFunction const & progress);