From e17e27fb0ee84454ee04622b28710d527c1e6a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 25 Dec 2015 00:47:23 -0800 Subject: [PATCH] [osx] Corrected initial title for restored windows --- platform/osx/app/MapDocument.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/platform/osx/app/MapDocument.m b/platform/osx/app/MapDocument.m index ddc9ff767..3aa3f9f29 100644 --- a/platform/osx/app/MapDocument.m +++ b/platform/osx/app/MapDocument.m @@ -68,13 +68,6 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { [self applyPendingState]; } -- (NSString *)displayName { - // Temporarily set the display name to the default center coordinate instead - // of “Untitled” until the binding kicks in. - NSValue *nullIsland = [NSValue valueWithCLLocationCoordinate2D:CLLocationCoordinate2DMake(0, 0)]; - return [[NSValueTransformer valueTransformerForName:@"LocationCoordinate2DTransformer"] transformedValue:nullIsland]; -} - - (NSWindow *)window { return self.windowControllers.firstObject.window; } @@ -213,6 +206,12 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { if (appDelegate.pendingDebugMask) { self.mapView.debugMask = appDelegate.pendingDebugMask; } + + // Temporarily set the display name to the default center coordinate instead + // of “Untitled” until the binding kicks in. + NSValue *coordinateValue = [NSValue valueWithCLLocationCoordinate2D:self.mapView.centerCoordinate]; + self.displayName = [[NSValueTransformer valueTransformerForName:@"LocationCoordinate2DTransformer"] + transformedValue:coordinateValue]; } #pragma mark Debug methods