diff options
author | Jordan Kiley <jmkiley@users.noreply.github.com> | 2019-02-13 13:20:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-13 13:20:48 -0800 |
commit | 5d8505603099cad3334dc95297f9ca8dd2e103a0 (patch) | |
tree | 0a9ed3129a1896d6ac2ebedef04f19b1321785f5 /platform/darwin/src/MGLOfflineStorage.mm | |
parent | 98eac18a2133a7beda12fdfc27d6f88217d800cf (diff) | |
download | qtlocation-mapboxgl-5d8505603099cad3334dc95297f9ca8dd2e103a0.tar.gz |
[ios, macos] Move `apiBaseURL` to `MGLAccountManager`` (#13754)
[ios, macos] Move `apiBaseURL` to `MGLAccountManager`
Diffstat (limited to 'platform/darwin/src/MGLOfflineStorage.mm')
-rw-r--r-- | platform/darwin/src/MGLOfflineStorage.mm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm index 17c1ff3d29..4613b402fd 100644 --- a/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/darwin/src/MGLOfflineStorage.mm @@ -3,7 +3,6 @@ #import "MGLFoundation_Private.h" #import "MGLAccountManager_Private.h" #import "MGLGeometry_Private.h" -#import "MGLNetworkConfiguration.h" #import "MGLOfflinePack_Private.h" #import "MGLOfflineRegion_Private.h" #import "MGLTilePyramidOfflineRegion.h" @@ -227,11 +226,11 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio _mbglFileSource = new mbgl::DefaultFileSource(cachePath.UTF8String, [NSBundle mainBundle].resourceURL.path.UTF8String); // Observe for changes to the API base URL (and find out the current one). - [[MGLNetworkConfiguration sharedManager] addObserver:self - forKeyPath:@"apiBaseURL" - options:(NSKeyValueObservingOptionInitial | + [[MGLAccountManager sharedManager] addObserver:self + forKeyPath:@"apiBaseURL" + options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) - context:NULL]; + context:NULL]; // Observe for changes to the global access token (and find out the current one). [[MGLAccountManager sharedManager] addObserver:self @@ -245,7 +244,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [[MGLNetworkConfiguration sharedManager] removeObserver:self forKeyPath:@"apiBaseURL"]; + [[MGLAccountManager sharedManager] removeObserver:self forKeyPath:@"apiBaseURL"]; [[MGLAccountManager sharedManager] removeObserver:self forKeyPath:@"accessToken"]; for (MGLOfflinePack *pack in self.packs) { @@ -263,7 +262,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio if (![accessToken isKindOfClass:[NSNull class]]) { self.mbglFileSource->setAccessToken(accessToken.UTF8String); } - } else if ([keyPath isEqualToString:@"apiBaseURL"] && object == [MGLNetworkConfiguration sharedManager]) { + } else if ([keyPath isEqualToString:@"apiBaseURL"] && object == [MGLAccountManager sharedManager]) { NSURL *apiBaseURL = change[NSKeyValueChangeNewKey]; if ([apiBaseURL isKindOfClass:[NSNull class]]) { self.mbglFileSource->setAPIBaseURL(mbgl::util::API_BASE_URL); |