forked from organicmaps/organicmaps-tmp
Merge pull request #3009 from igrechuhin/MAPSME-942
[ios] Fixed space check for update maps action.
This commit is contained in:
commit
b6fe93b524
2 changed files with 33 additions and 26 deletions
|
@ -23,14 +23,23 @@ using namespace storage;
|
|||
[ud synchronize];
|
||||
}
|
||||
|
||||
+ (void)downloadNode:(TCountryId const &)countryId alertController:(MWMAlertViewController *)alertController onSuccess:(TMWMVoidBlock)onSuccess
|
||||
+ (void)downloadNode:(TCountryId const &)countryId
|
||||
alertController:(MWMAlertViewController *)alertController
|
||||
onSuccess:(TMWMVoidBlock)onSuccess
|
||||
{
|
||||
[self checkEnoughSpaceFor:countryId andPerformAction:[countryId, onSuccess]
|
||||
if (IsEnoughSpaceForDownload(countryId, GetFramework().Storage()))
|
||||
{
|
||||
GetFramework().Storage().DownloadNode(countryId);
|
||||
if (onSuccess)
|
||||
onSuccess();
|
||||
} alertController:alertController];
|
||||
[self checkConnectionAndPerformAction:[countryId, onSuccess]
|
||||
{
|
||||
GetFramework().Storage().DownloadNode(countryId);
|
||||
if (onSuccess)
|
||||
onSuccess();
|
||||
} alertController:alertController];
|
||||
}
|
||||
else
|
||||
{
|
||||
[alertController presentNotEnoughSpaceAlert];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)retryDownloadNode:(TCountryId const &)countryId
|
||||
|
@ -38,12 +47,20 @@ using namespace storage;
|
|||
GetFramework().Storage().RetryDownloadNode(countryId);
|
||||
}
|
||||
|
||||
+ (void)updateNode:(TCountryId const &)countryId alertController:(MWMAlertViewController *)alertController
|
||||
+ (void)updateNode:(TCountryId const &)countryId
|
||||
alertController:(MWMAlertViewController *)alertController
|
||||
{
|
||||
[self checkEnoughSpaceFor:countryId andPerformAction:[countryId]
|
||||
if (IsEnoughSpaceForUpdate(countryId, GetFramework().Storage()))
|
||||
{
|
||||
GetFramework().Storage().UpdateNode(countryId);
|
||||
} alertController:alertController];
|
||||
[self checkConnectionAndPerformAction:[countryId]
|
||||
{
|
||||
GetFramework().Storage().UpdateNode(countryId);
|
||||
} alertController:alertController];
|
||||
}
|
||||
else
|
||||
{
|
||||
[alertController presentNotEnoughSpaceAlert];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)deleteNode:(TCountryId const &)countryId alertController:(MWMAlertViewController *)alertController
|
||||
|
@ -99,16 +116,6 @@ using namespace storage;
|
|||
}
|
||||
}
|
||||
|
||||
+ (void)checkEnoughSpaceFor:(TCountryId const &)countryId
|
||||
andPerformAction:(TMWMVoidBlock)action
|
||||
alertController:(MWMAlertViewController *)alertController
|
||||
{
|
||||
if (IsEnoughSpaceForDownload(countryId, GetFramework().Storage()))
|
||||
[self checkConnectionAndPerformAction:action alertController:alertController];
|
||||
else
|
||||
[alertController presentNotEnoughSpaceAlert];
|
||||
}
|
||||
|
||||
+ (void)checkConnectionAndPerformAction:(TMWMVoidBlock)action
|
||||
alertController:(MWMAlertViewController *)alertController
|
||||
{
|
||||
|
|
|
@ -4246,7 +4246,7 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 6.0.3;
|
||||
CURRENT_PROJECT_VERSION = 6.1;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Statistics";
|
||||
|
@ -4365,7 +4365,7 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 6.0.3;
|
||||
CURRENT_PROJECT_VERSION = 6.1;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
|
@ -4485,7 +4485,7 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 6.0.3;
|
||||
CURRENT_PROJECT_VERSION = 6.1;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -4609,7 +4609,7 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 6.0.3;
|
||||
CURRENT_PROJECT_VERSION = 6.1;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -4733,7 +4733,7 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 6.0.3;
|
||||
CURRENT_PROJECT_VERSION = 6.1;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Statistics";
|
||||
|
@ -4855,7 +4855,7 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 6.0.3;
|
||||
CURRENT_PROJECT_VERSION = 6.1;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Statistics";
|
||||
|
|
Loading…
Add table
Reference in a new issue