Only show proxy icon if file being edited exists

This commit is contained in:
Bjorn Winckler
2008-06-28 18:07:47 +02:00
parent 6af7bf3d9d
commit 68e5dc4041
+9 -2
View File
@@ -313,8 +313,15 @@
- (void)setDocumentFilename:(NSString *)filename
{
if (filename)
[decoratedWindow setRepresentedFilename:filename];
if (!filename)
return;
// Ensure file really exists or the path to the proxy icon will look weird.
// If the file does not exists, don't show a proxy icon.
if (![[NSFileManager defaultManager] fileExistsAtPath:filename])
filename = @"";
[decoratedWindow setRepresentedFilename:filename];
}
- (void)setToolbar:(NSToolbar *)toolbar