Show a document's represented file name in the title of its window

also when its display name is equal to the last path component of the
file name, since that is what NSDocument uses by default for
compatibility with OS X.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30052 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-03-27 21:06:45 +00:00
parent 4dd7da00e0
commit 04e0376187
2 changed files with 10 additions and 1 deletions

View file

@ -1,5 +1,10 @@
2010-03-27 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSWindowController.m (-synchronizeWindowTitleWithDocumentName):
Show a document's represented file name also when its display name
is equal to the last path component of the file name, since that
is what NSDocument uses by default for compatibility with OS X.
* Source/NSWindowController.m (-_windowWillClose:): Extend
lifetime of the window controller to the end of the current event
cycle to prevent crashes due to a premature release after the

View file

@ -399,7 +399,11 @@
NSString *title = [self windowTitleForDocumentDisplayName: displayName];
/* If they just want to display the filename, use the fancy method */
if (filename != nil && [title isEqualToString: filename])
/* NB For compatibility with Mac OS X, a document display name is equal
to its last path component, so we check for that here too */
if (filename != nil &&
([title isEqualToString: filename] ||
[title isEqualToString: [filename lastPathComponent]]))
{
[_window setTitleWithRepresentedFilename: filename];
}