Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2015-08-10 20:40:05 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:00:43 +0300
commitb95fc5602c66aaa060b6b40985ebbc71a7cc245a (patch)
tree3213cb4e6bc4c0724bf2ed0d66f46b737b601f0e /map
parent1b27253169d6a1fa61a61f3b638a0bc9c452440f (diff)
[storage] Fixed migrating bug with multiple Index for one mwm local country file.
Diffstat (limited to 'map')
-rw-r--r--map/active_maps_layout.cpp4
-rw-r--r--map/active_maps_layout.hpp10
-rw-r--r--map/country_tree.cpp2
-rw-r--r--map/country_tree.hpp7
-rw-r--r--map/framework.cpp10
5 files changed, 16 insertions, 17 deletions
diff --git a/map/active_maps_layout.cpp b/map/active_maps_layout.cpp
index 3755cc3b9d..5d735aacf6 100644
--- a/map/active_maps_layout.cpp
+++ b/map/active_maps_layout.cpp
@@ -36,14 +36,14 @@ ActiveMapsLayout::~ActiveMapsLayout()
#endif
}
-void ActiveMapsLayout::Init(vector<platform::CountryFile> const & files)
+void ActiveMapsLayout::Init(vector<TLocalFilePtr> const & files)
{
Clear();
Storage & storage = GetStorage();
for (auto const & file : files)
{
- vector<TIndex> arr = storage.FindAllIndexesByFile(file.GetNameWithoutExt());
+ vector<TIndex> arr = storage.FindAllIndexesByFile(file->GetCountryName());
if (!arr.empty())
{
TStatus status;
diff --git a/map/active_maps_layout.hpp b/map/active_maps_layout.hpp
index 81367527ae..5d62bbc2fe 100644
--- a/map/active_maps_layout.hpp
+++ b/map/active_maps_layout.hpp
@@ -4,14 +4,15 @@
#include "storage/storage_defines.hpp"
#include "platform/country_defines.hpp"
-#include "platform/country_file.hpp"
+#include "platform/local_country_file.hpp"
#include "base/buffer_vector.hpp"
+#include "std/function.hpp"
+#include "std/map.hpp"
+#include "std/shared_ptr.hpp"
#include "std/string.hpp"
#include "std/vector.hpp"
-#include "std/map.hpp"
-#include "std/function.hpp"
class Framework;
@@ -99,7 +100,8 @@ private:
Storage const & GetStorage() const;
Storage & GetStorage();
- void Init(vector<platform::CountryFile> const & files);
+ using TLocalFilePtr = shared_ptr<platform::LocalCountryFile>;
+ void Init(vector<TLocalFilePtr> const & files);
void Clear();
void ShowMap(TIndex const & index);
diff --git a/map/country_tree.cpp b/map/country_tree.cpp
index 0af4952864..2b3d3d81a0 100644
--- a/map/country_tree.cpp
+++ b/map/country_tree.cpp
@@ -65,7 +65,7 @@ CountryTree & CountryTree::operator=(CountryTree const & other)
return *this;
}
-void CountryTree::Init(vector<platform::CountryFile> const & maps)
+void CountryTree::Init(vector<ActiveMapsLayout::TLocalFilePtr> const & maps)
{
ASSERT(IsValid(), ());
m_layout->Init(maps);
diff --git a/map/country_tree.hpp b/map/country_tree.hpp
index 54d0259486..68f3d460f1 100644
--- a/map/country_tree.hpp
+++ b/map/country_tree.hpp
@@ -5,13 +5,14 @@
#include "storage/index.hpp"
#include "storage/storage_defines.hpp"
-#include "platform/country_file.hpp"
+#include "platform/local_country_file.hpp"
#include "base/buffer_vector.hpp"
-#include "std/string.hpp"
#include "std/function.hpp"
#include "std/shared_ptr.hpp"
+#include "std/string.hpp"
+
class Framework;
@@ -38,7 +39,7 @@ public:
CountryTree & operator=(CountryTree const & other);
/// @param[in] Sorted vector of current .mwm files.
- void Init(vector<platform::CountryFile> const & maps);
+ void Init(vector<ActiveMapsLayout::TLocalFilePtr> const & maps);
void Clear();
ActiveMapsLayout & GetActiveMapLayout();
diff --git a/map/framework.cpp b/map/framework.cpp
index ef8296b018..a3f655c432 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -473,15 +473,11 @@ void Framework::RegisterAllMaps()
m_storage.RegisterAllLocalMaps();
int minFormat = numeric_limits<int>::max();
- vector<CountryFile> maps;
- m_storage.GetLocalMaps(maps);
- for (CountryFile const & countryFile : maps)
+ vector<shared_ptr<LocalCountryFile>> maps;
+ m_storage.GetLocalMaps(maps);
+ for (auto const & localFile : maps)
{
- shared_ptr<LocalCountryFile> localFile = m_storage.GetLatestLocalFile(countryFile);
- if (!localFile)
- continue;
-
auto p = RegisterMap(*localFile);
if (p.second != MwmSet::RegResult::Success)
continue;