diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2012-05-16 14:59:34 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:38:29 +0300 |
commit | addec4f2f2e365e2776148d826db9100f8ec203e (patch) | |
tree | 672935bdd3b968a8c3296c576f339b4edce690fd /storage | |
parent | 9ba77a08daa4ab7383b28c3ed03fc86a5fae313b (diff) |
added MapStorage class. refactored DownloadUI.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/storage.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/storage/storage.cpp b/storage/storage.cpp index 1ff85d3cdb..2a08f057cb 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -327,7 +327,7 @@ namespace storage obs.m_changeCountryFn = change; obs.m_progressFn = progress; - obs.m_slotId = m_currentSlotId++; + obs.m_slotId = ++m_currentSlotId; m_observers.push_back(obs); @@ -492,10 +492,22 @@ namespace storage TIndex const Storage::FindIndexByName(string const & name) const { for (unsigned i = 0; i < m_countries.SiblingsCount(); ++i) + { + if (m_countries[i].Value().Name() == name) + return TIndex(i); + for (unsigned j = 0; j < m_countries[i].SiblingsCount(); ++j) + { + if (m_countries[i][j].Value().Name() == name) + return TIndex(i, j); + for (unsigned k = 0; k < m_countries[i][j].SiblingsCount(); ++k) + { if (m_countries[i][j][k].Value().Name() == name) return TIndex(i, j, k); + } + } + } return TIndex(); } |