Updated -displayName to return the lastpathcomponent of fileURL when available.

Reviewed by tom.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2008-10-01 23:57:47 -07:00
1 parent f636491e75
commit 77dae63cb9
1 file changed
+5 -3
+5 -3
View File
@@ -267,13 +267,15 @@ var CPDocumentUntitledCount = 0;
*/
- (CPString)displayName
{
// FIXME: By default, return last path component of fileURL
if (_fileURL)
return [_fileURL lastPathComponent];
if (!_untitledDocumentIndex)
_untitledDocumentIndex = ++CPDocumentUntitledCount;
if (_untitledDocumentIndex == 1)
return @"Untitled";
return @"Untitled " + _untitledDocumentIndex;
}
@@ -336,7 +338,7 @@ var CPDocumentUntitledCount = 0;
{
if (_fileURL == aFileURL)
return;
_fileURL = aFileURL;
[_windowControllers makeObjectsPerformSelector:@selector(synchronizeWindowTitleWithDocumentName)];