Remove comments and make improvements to code suggested by fred

This commit is contained in:
Gregory John Casamento 2020-07-06 04:40:36 -04:00
parent 596ee3a0b6
commit 73b03350b6
4 changed files with 15 additions and 25 deletions

View file

@ -49,7 +49,7 @@ DEFINE_BLOCK_TYPE(NSStoryboardControllerCreator, NSCoder*, id);
NSString *_applicationSceneId;
}
+ (NSStoryboard *) mainStoryboard; // 10.13
+ (NSStoryboard *) mainStoryboard;
+ (instancetype) storyboardWithName: (NSStoryboardName)name
bundle: (NSBundle *)bundle;
@ -57,14 +57,14 @@ DEFINE_BLOCK_TYPE(NSStoryboardControllerCreator, NSCoder*, id);
- (id) instantiateInitialController;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)
- (id) instantiateInitialControllerWithCreator: (NSStoryboardControllerCreator)block; // 10.15
- (id) instantiateInitialControllerWithCreator: (NSStoryboardControllerCreator)block;
#endif
- (id) instantiateControllerWithIdentifier: (NSStoryboardSceneIdentifier)identifier;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)
- (id) instantiateControllerWithIdentifier: (NSStoryboardSceneIdentifier)identifier
creator: (NSStoryboardControllerCreator)block; // 10.15
creator: (NSStoryboardControllerCreator)block;
#endif
@end

View file

@ -288,15 +288,6 @@ static NSStoryboard *__mainStoryboard = nil;
@implementation NSControllerPlaceholder
- (instancetype) init
{
self = [super init];
if (self != nil)
{
}
return self;
}
- (NSString *) storyboardName
{
return _storyboardName;
@ -384,7 +375,6 @@ static NSStoryboard *__mainStoryboard = nil;
_controllerMap = [[NSMutableDictionary alloc] initWithCapacity: [array count]];
_documentsMap = [[NSMutableDictionary alloc] initWithCapacity: [array count]];
//while ((e = [en nextObject]) != nil)
FOR_IN(NSXMLElement*, e, array)
{
NSXMLElement *doc = [[NSXMLElement alloc] initWithName: @"document"];
@ -393,7 +383,7 @@ static NSStoryboard *__mainStoryboard = nil;
NSString *sceneId = [[e attributeForName: @"sceneID"] stringValue];
NSString *controllerId = nil;
// Copy children...
// Move children...
FOR_IN(NSXMLElement*, child, children)
{
if ([[child name] isEqualToString: @"point"] == YES)
@ -414,7 +404,10 @@ static NSStoryboard *__mainStoryboard = nil;
NSArray *appChildren = [appNode children];
NSEnumerator *ace = [appChildren objectEnumerator];
NSXMLElement *ae = nil;
// Assign application scene...
ASSIGN(_applicationSceneId, sceneId);
// Move all application children to objects...
while ((ae = [ace nextObject]) != nil)
{
@ -425,6 +418,10 @@ static NSStoryboard *__mainStoryboard = nil;
// Remove the appNode
[appNode detach];
// Add it to the document
[objects detach];
[doc addChild: objects];
// create a customObject entry for NSApplication reference...
NSXMLNode *appCustomClass = (NSXMLNode *)[(NSXMLElement *)appNode
attributeForName: @"customClass"];
@ -453,15 +450,7 @@ static NSStoryboard *__mainStoryboard = nil;
[customObject addChild: appCons];
}
[child insertChild: customObject
atIndex: 0];
// Add it to the document
[objects detach];
[doc addChild: objects];
// Assign application scene...
ASSIGN(_applicationSceneId, sceneId);
atIndex: 0];
}
else
{

View file

@ -127,7 +127,6 @@
RETAIN(w);
[w center];
[NSApp runModalForWindow: w];
RELEASE(w);
}
else if ([_kind isEqualToString: @"show"])
{
@ -141,6 +140,7 @@
[w setTitle: [_destinationController title]];
[w center];
[w orderFrontRegardless];
RETAIN(w);
}
}

View file

@ -739,6 +739,7 @@ static NSNotificationCenter *nc = nil;
defer: NO];
[window setTitle: title];
[window setContentView: view];
AUTORELEASE(window);
return window;
}