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
diff options
context:
space:
mode:
authorYuri Gorshenin <y@mmaps.me>2015-03-30 14:26:48 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:41:35 +0300
commit25f7a7f2f32cc4db8a5bd0106ae4c8f6c6292201 (patch)
treebe1b14a86fe2f34445e488c128eaad7b1d0aeece /indexer/mwm_set.cpp
parentf6bba24d00706065ddacf7e983fc4cf9ede8b7ab (diff)
Review fixes.
Diffstat (limited to 'indexer/mwm_set.cpp')
-rw-r--r--indexer/mwm_set.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp
index 46d9bea017..359640066d 100644
--- a/indexer/mwm_set.cpp
+++ b/indexer/mwm_set.cpp
@@ -102,7 +102,8 @@ MwmSet::MwmId MwmSet::GetIdByName(string const & name)
return INVALID_MWM_ID;
}
-int MwmSet::Register(string const & fileName, m2::RectD & rect)
+bool MwmSet::Register(string const & fileName, m2::RectD & rect,
+ feature::DataHeader::Version & version)
{
lock_guard<mutex> lock(m_lock);
@@ -110,23 +111,23 @@ int MwmSet::Register(string const & fileName, m2::RectD & rect)
if (id != INVALID_MWM_ID)
{
if (m_info[id].IsRegistered())
- LOG(LWARNING, ("Trying to add already added map", fileName));
+ LOG(LWARNING, ("Trying to add already registered map", fileName));
else
m_info[id].SetStatus(MwmInfo::STATUS_UP_TO_DATE);
- return -1;
+ return false;
}
- return RegisterImpl(fileName, rect);
+ return RegisterImpl(fileName, rect, version);
}
-int MwmSet::RegisterImpl(string const & fileName, m2::RectD & rect)
+bool MwmSet::RegisterImpl(string const & fileName, m2::RectD & rect,
+ feature::DataHeader::Version & version)
{
// this function can throw an exception for bad mwm file
MwmInfo info;
- int const version = GetInfo(fileName, info);
- if (version == -1)
- return -1;
+ if (!GetVersion(fileName, info, version))
+ return false;
info.SetStatus(MwmInfo::STATUS_UP_TO_DATE);
@@ -135,8 +136,8 @@ int MwmSet::RegisterImpl(string const & fileName, m2::RectD & rect)
m_info[id] = info;
rect = info.m_limitRect;
- ASSERT ( rect.IsValid(), () );
- return version;
+ ASSERT(rect.IsValid(), ());
+ return true;
}
bool MwmSet::DeregisterImpl(MwmId id)