forked from organicmaps/organicmaps
[core] Version change tracking.
This commit is contained in:
parent
caf8a3dd49
commit
f14c86dea3
4 changed files with 32 additions and 0 deletions
|
@ -1633,3 +1633,19 @@ string Framework::GenerateApiBackUrl(url_scheme::ApiPoint const & point)
|
|||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
bool Framework::IsDataVersionChanged()
|
||||
{
|
||||
int64_t version;
|
||||
if (Settings::Get("DataVersion", version))
|
||||
{
|
||||
return version != m_storage.GetCurrentDataVersion();
|
||||
}
|
||||
// no key in the settings, assume new version
|
||||
return true;
|
||||
}
|
||||
|
||||
void Framework::UpdateSavedDataVersion()
|
||||
{
|
||||
Settings::Set("DataVersion", m_storage.GetCurrentDataVersion());
|
||||
}
|
||||
|
|
|
@ -445,6 +445,8 @@ private:
|
|||
void SetViewPortASync(m2::RectD const & rect);
|
||||
|
||||
public:
|
||||
/// @name Api
|
||||
//@{
|
||||
void MapApiSetUriAndParse(string const & url);
|
||||
bool GetMapApiPoint(m2::PointD const & pxPoint, url_scheme::ApiPoint & point);
|
||||
vector<url_scheme::ApiPoint> const & GetMapApiPoints() { return m_ParsedMapApi.GetPoints(); }
|
||||
|
@ -455,4 +457,11 @@ public:
|
|||
m2::RectD GetMapApiLatLonRect() const { return m_ParsedMapApi.GetLatLonRect(); }
|
||||
bool IsValidMapApi() const { return m_ParsedMapApi.IsValid(); }
|
||||
string GenerateApiBackUrl(url_scheme::ApiPoint const & point);
|
||||
//@}
|
||||
|
||||
/// @name Map updates
|
||||
//@{
|
||||
bool IsDataVersionChanged();
|
||||
void UpdateSavedDataVersion();
|
||||
//@}
|
||||
};
|
||||
|
|
|
@ -463,4 +463,9 @@ namespace storage
|
|||
|
||||
return fListNoExt.size();
|
||||
}
|
||||
|
||||
int64_t Storage::GetCurrentDataVersion()
|
||||
{
|
||||
return m_currentVersion;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,5 +124,7 @@ namespace storage
|
|||
/// @param list is populated with oudated countries
|
||||
/// @return number of outdated countries in the list
|
||||
int GetOutdatedCountries(vector<Country> & list);
|
||||
|
||||
int64_t GetCurrentDataVersion();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue