Understand GSFilePath and GSTempPath arugments

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4208 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-05-06 09:51:17 +00:00
parent 705a71ed6d
commit 20d88461fb

View file

@ -180,6 +180,8 @@ NSApplication *NSApp = nil;
NSDictionary *infoDict = [mainBundle infoDictionary];
NSString *mainModelFile;
NSString *appIconFile;
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSString *filePath;
mainModelFile = [infoDict objectForKey: @"NSMainNibFile"];
if (mainModelFile && ![mainModelFile isEqual: @""])
@ -210,6 +212,19 @@ NSApplication *NSApp = nil;
/* finish the launching post notification that launching has finished */
[nc postNotificationName: NSApplicationDidFinishLaunchingNotification
object: self];
/*
* Now check to see if we were launched with arguments asking to
* open a file.
*/
if ((filePath = [defs stringForKey: @"GSFilePath"]) != nil)
{
[self application: self openFile: filePath];
}
else if ((filePath = [defs stringForKey: @"GSTempPath"]) != nil)
{
[self application: self openTempFile: filePath];
}
}
- (void) dealloc