forked from organicmaps/organicmaps
refactored storage to load countries file during construction.
This commit is contained in:
parent
4e453342fe
commit
e93f68939a
3 changed files with 12 additions and 10 deletions
|
@ -46,9 +46,6 @@ namespace android
|
|||
size_t const measurementsCount = 5;
|
||||
m_sensors[0].SetCount(measurementsCount);
|
||||
m_sensors[1].SetCount(measurementsCount);
|
||||
|
||||
// @TODO refactor storage
|
||||
m_work.Storage().ReInitCountries(false);
|
||||
}
|
||||
|
||||
void Framework::SetEmptyModelMessage(string const & emptyModelMsg)
|
||||
|
|
|
@ -56,11 +56,14 @@ namespace storage
|
|||
// return "Unknown error";
|
||||
// }
|
||||
|
||||
Storage::Storage()
|
||||
{
|
||||
LoadCountriesFile(false);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void Storage::Init(TAddMapFunction addFunc, TRemoveMapFunction removeFunc, TUpdateRectFunction updateRectFunc)
|
||||
{
|
||||
m_currentVersion = static_cast<uint32_t>(Version::BUILD);
|
||||
|
||||
m_addMap = addFunc;
|
||||
m_removeMap = removeFunc;
|
||||
m_updateRect = updateRectFunc;
|
||||
|
@ -302,7 +305,7 @@ namespace storage
|
|||
m_updateRect(bounds);
|
||||
}
|
||||
|
||||
void Storage::ReInitCountries(bool forceReload)
|
||||
void Storage::LoadCountriesFile(bool forceReload)
|
||||
{
|
||||
if (forceReload)
|
||||
m_countries.Clear();
|
||||
|
@ -322,8 +325,6 @@ namespace storage
|
|||
{
|
||||
m_observerChange = change;
|
||||
m_observerProgress = progress;
|
||||
|
||||
ReInitCountries(false);
|
||||
}
|
||||
|
||||
void Storage::Unsubscribe()
|
||||
|
|
|
@ -108,10 +108,12 @@ namespace storage
|
|||
void GenerateSearchIndex(TIndex const & index, string const & fName);
|
||||
void UpdateAfterSearchIndex(TIndex const & index, string const & fName);
|
||||
|
||||
/// @TODO temporarily made public for Android, refactor
|
||||
void LoadCountriesFile(bool forceReload);
|
||||
|
||||
public:
|
||||
|
||||
/// @TODO temporarily made public for Android, refactor
|
||||
void ReInitCountries(bool forceReload);
|
||||
Storage();
|
||||
|
||||
void Init(TAddMapFunction addFunc,
|
||||
TRemoveMapFunction removeFunc,
|
||||
|
@ -145,4 +147,6 @@ namespace storage
|
|||
|
||||
void NotifyStatusChanhed(TIndex const & index) const;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue