* Source/NSDocument.m (-setFileName:): Set the file name to the

absolute file path.
  Patch by Jonathan Gillaspie <jonathan.gillaspie@testplant.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28418 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-07-28 21:01:53 +00:00
parent 3a16583dcb
commit 1871f18f54
2 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2009-07-28 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSDocument.m (-setFileName:): Set the file name to the
absolute file path.
Patch by Jonathan Gillaspie <jonathan.gillaspie@testplant.com>.
2009-07-27 12:18-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/NSWindow.h: Comment out _attachedSheet ivar.

View file

@ -228,7 +228,19 @@ withContentsOfURL: (NSURL *)url
- (void) setFileName: (NSString *)fileName
{
NSURL *fileUrl = fileName ? [NSURL fileURLWithPath: fileName] : nil;
NSURL *fileUrl;
if (fileName && ![fileName isAbsolutePath])
{
NSString *dir = [[NSFileManager defaultManager] currentDirectoryPath];
if (dir)
{
fileName = [dir stringByAppendingPathComponent: fileName];
}
}
fileUrl = fileName ? [NSURL fileURLWithPath: fileName] : nil;
// This check is to prevent super calls from recursing.
if (!OVERRIDDEN(setFileName:))