forked from organicmaps/organicmaps
[MAPSME-3810] Review fixes.
This commit is contained in:
parent
0ffbea93c3
commit
1b251a1415
2 changed files with 13 additions and 10 deletions
|
@ -81,13 +81,17 @@ np::Stage GetStage()
|
|||
|
||||
bool CanUseNetwork()
|
||||
{
|
||||
auto const connectionType = GetPlatform().ConnectionStatus();
|
||||
if (connectionType == Platform::EConnectionType::CONNECTION_NONE)
|
||||
return false;
|
||||
if (connectionType == Platform::EConnectionType::CONNECTION_WIFI)
|
||||
return true;
|
||||
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
|
||||
NSDate * policyDate = [ud objectForKey:kNetworkingPolicyTimeStamp];
|
||||
return [policyDate compare:[NSDate date]] == NSOrderedDescending;
|
||||
using ct = Platform::EConnectionType;
|
||||
switch (GetPlatform().ConnectionStatus())
|
||||
{
|
||||
case ct::CONNECTION_NONE: return false;
|
||||
case ct::CONNECTION_WIFI: return true;
|
||||
case ct::CONNECTION_WWAN:
|
||||
{
|
||||
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
|
||||
NSDate * policyDate = [ud objectForKey:kNetworkingPolicyTimeStamp];
|
||||
return [policyDate compare:[NSDate date]] == NSOrderedDescending;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace network_policy
|
||||
|
|
|
@ -78,8 +78,7 @@ using namespace place_page;
|
|||
|
||||
NSAssert(!m_previewRows.empty(), @"Preview row's can't be empty!");
|
||||
m_previewRows.push_back(PreviewRows::Space);
|
||||
BOOL const hasBanner = m_info.GetBanner().m_type != banners::Banner::Type::None;
|
||||
if (hasBanner && network_policy::CanUseNetwork() && ![MWMSettings adForbidden])
|
||||
if (network_policy::CanUseNetwork() && ![MWMSettings adForbidden] && m_info.HasBanner())
|
||||
m_previewRows.push_back(PreviewRows::Banner);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue