diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-10-05 20:22:19 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:29:24 +0300 |
commit | 9da05125fa619e33fc03adedc7e1947d18dc9c01 (patch) | |
tree | 25acc314cf1aa305463e0cb0ef030e8a84d97362 /map/country_tree.cpp | |
parent | 311958b82b9ce888da47c608f748dd4b12c63ad6 (diff) |
[core] active maps layout implementation
Diffstat (limited to 'map/country_tree.cpp')
-rw-r--r-- | map/country_tree.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/map/country_tree.cpp b/map/country_tree.cpp index a2a534f2c0..49fde20510 100644 --- a/map/country_tree.cpp +++ b/map/country_tree.cpp @@ -41,6 +41,7 @@ inline TIndex GetIndexParent(TIndex const & index) CountryTree::CountryTree(Framework * framework) : m_framework(framework) + , m_layout(framework) { m_subscribeSlotID = m_framework->Storage().Subscribe(bind(&CountryTree::NotifyStatusChanged, this, _1), bind(&CountryTree::NotifyProgressChanged, this, _1, _2)); @@ -53,6 +54,7 @@ CountryTree::~CountryTree() ActiveMapsLayout & CountryTree::GetActiveMapLayout() { + m_layout.Init(); return m_layout; } @@ -120,13 +122,13 @@ TMapOptions CountryTree::GetLeafOptions(int position) const void CountryTree::DownloadCountry(int childPosition, TMapOptions const & options) { ASSERT(IsLeaf(childPosition), ()); - m_framework->DownloadCountry(GetChild(childPosition), options); + GetActiveMapLayout().DownloadMap(GetChild(childPosition), options); } void CountryTree::DeleteCountry(int childPosition, TMapOptions const & options) { ASSERT(IsLeaf(childPosition), ()); - m_framework->DeleteCountry(GetChild(childPosition), options); + GetActiveMapLayout().DeleteMap(GetChild(childPosition), options); } void CountryTree::CancelDownloading(int childPosition) @@ -174,7 +176,7 @@ int CountryTree::GetChildPosition(TIndex const & index) { auto iter = find(m_levelItems.begin(), m_levelItems.end(), index); if (iter != m_levelItems.end()) - result = distance(m_levelItems.begin(), iter) - ChildItemsOffset - 1; + result = distance(m_levelItems.begin(), iter) - ChildItemsOffset; } return result; |