Yet another fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4802 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-09-02 15:54:40 +00:00
parent 1696cafb2e
commit 4d34c6f02e
2 changed files with 16 additions and 4 deletions

View file

@ -3,6 +3,7 @@ Thu Sep 2 16:42:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* NSWorkspace.m: Trivial fix to pass app when opening files. * NSWorkspace.m: Trivial fix to pass app when opening files.
* GSServicesManager.m: Fix to send open commands to app delegate * GSServicesManager.m: Fix to send open commands to app delegate
rather than to application object itsself. rather than to application object itsself.
* NSApplication.m: Fix to recognise file open request on commandline.
Thu Sep 2 12:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Thu Sep 2 12:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>

View file

@ -209,18 +209,29 @@ NSApplication *NSApp = nil;
/* /*
* Now check to see if we were launched with arguments asking to * Now check to see if we were launched with arguments asking to
* open a file. * open a file. We permit some variations on the default name.
*/ */
if ((filePath = [defs stringForKey: @"GSFilePath"]) != nil) filePath = [defs stringForKey: @"-GSFilePath"];
if (filePath == nil)
filePath = [defs stringForKey: @"--GSFilePath"];
if (filePath == nil)
filePath = [defs stringForKey: @"GSFilePath"];
if (filePath != nil)
{ {
if ([delegate respondsToSelector: @selector(application:openFile:)]) if ([delegate respondsToSelector: @selector(application:openFile:)])
{ {
[delegate application: self openFile: filePath]; [delegate application: self openFile: filePath];
} }
} }
else if ((filePath = [defs stringForKey: @"GSTempPath"]) != nil) else
{ {
if ([delegate respondsToSelector: @selector(application:openTempFile:)]) filePath = [defs stringForKey: @"-GSTempPath"];
if (filePath == nil)
filePath = [defs stringForKey: @"--GSTempPath"];
if (filePath == nil)
filePath = [defs stringForKey: @"GSTempPath"];
if (filePath != nil
&& [delegate respondsToSelector: @selector(application:openTempFile:)])
{ {
[delegate application: self openTempFile: filePath]; [delegate application: self openTempFile: filePath];
} }