diff options
author | Yuri Gorshenin <y@maps.me> | 2015-07-01 16:55:50 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:53:33 +0300 |
commit | 54e5990c7e4c65b0749c21ce4fe3866909a29668 (patch) | |
tree | ec9f80550c7402b7d5f577773353c0d7eb6fb0a7 /map/active_maps_layout.cpp | |
parent | 025f73ad85d489c4ea143b9d95dde4d308daf89b (diff) |
Revert "Merge pull request #1068 from maps/revert-929-abstract-country-file"
This reverts commit 66aac38c3004d261ee06a16f7e9db372f67614df, reversing
changes made to ad8708944070f6b32a17fbb944d3c493b3fb2a24.
Diffstat (limited to 'map/active_maps_layout.cpp')
-rw-r--r-- | map/active_maps_layout.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/map/active_maps_layout.cpp b/map/active_maps_layout.cpp index 8dc200ded3..090cef36b5 100644 --- a/map/active_maps_layout.cpp +++ b/map/active_maps_layout.cpp @@ -36,14 +36,14 @@ ActiveMapsLayout::~ActiveMapsLayout() #endif } -void ActiveMapsLayout::Init(vector<string> const & maps) +void ActiveMapsLayout::Init(vector<platform::CountryFile> const & files) { Clear(); Storage & storage = GetStorage(); - for (auto const & file : maps) + for (auto const & file : files) { - vector<TIndex> arr = storage.FindAllIndexesByFile(Storage::MapWithoutExt(file)); + vector<TIndex> arr = storage.FindAllIndexesByFile(file.GetNameWithoutExt()); if (!arr.empty()) { TStatus status; @@ -53,7 +53,9 @@ void ActiveMapsLayout::Init(vector<string> const & maps) m_items.push_back({ arr, status, options, options }); } else + { LOG(LWARNING, ("Can't find map index for", file)); + } } auto const comparatorFn = [&storage] (Item const & lhs, Item const & rhs) @@ -237,7 +239,7 @@ LocalAndRemoteSizeT const ActiveMapsLayout::GetRemoteCountrySizes(TGroup const & LocalAndRemoteSizeT const ActiveMapsLayout::GetRemoteCountrySizes(TIndex const & index) const { - CountryFile const & c = GetStorage().CountryByIndex(index).GetFile(); + platform::CountryFile const & c = GetStorage().CountryByIndex(index).GetFile(); size_t const mapSize = c.GetRemoteSize(TMapOptions::EMap); return { mapSize, c.GetRemoteSize(TMapOptions::ECarRouting) }; } @@ -265,7 +267,7 @@ void ActiveMapsLayout::DownloadMap(TIndex const & index, TMapOptions const & opt else { Storage const & s = GetStorage(); - vector<TIndex> arr = s.FindAllIndexesByFile(s.CountryFileNameWithoutExt(index)); + vector<TIndex> arr = s.FindAllIndexesByFile(s.GetCountryFile(index).GetNameWithoutExt()); int position = InsertInGroup(TGroup::ENewMap, { arr, TStatus::ENotDownloaded, validOptions, validOptions }); NotifyInsertion(TGroup::ENewMap, position); } |