mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 17:12:50 +00:00
Updated -displayName to return the lastpathcomponent of fileURL when available.
Reviewed by tom.
This commit is contained in:
1 parent
f636491e75
commit
77dae63cb9
1 file changed
+5
-3
+5
-3
@@ -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)];
|
||||
|
||||
Reference in new issue
Block a user