mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-24 23:45:52 +00:00
Merge pull request #1741 from ahankinson/fix-issue1633
Fix for #1633: setRepresentedFilename
This commit is contained in:
commit
fb577f8b70
2 files changed
+21
-2
No files matched your search
@@ -1467,7 +1467,7 @@ CPTexturedBackgroundWindowMask
|
||||
- (void)setRepresentedFilename:(CPString)aFilePath
|
||||
{
|
||||
// FIXME: urls vs filepaths and all.
|
||||
[self setRepresentedURL:aFilePath];
|
||||
[self setRepresentedURL:[CPURL URLWithString:aFilePath]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1475,7 +1475,7 @@ CPTexturedBackgroundWindowMask
|
||||
*/
|
||||
- (CPString)representedFilename
|
||||
{
|
||||
return _representedURL;
|
||||
return [_representedURL absoluteString];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
@import <AppKit/CPWindow.j>
|
||||
@import <AppKit/_CPBorderlessWindowView.j>
|
||||
@import <Foundation/CPURL.j>
|
||||
|
||||
[CPApplication sharedApplication];
|
||||
|
||||
@@ -109,4 +110,22 @@
|
||||
message:@"nextTextField should be the previous valid key view of contentView"];
|
||||
}
|
||||
|
||||
- (void)testRepresentedFilename
|
||||
{
|
||||
/*
|
||||
representedURL and representedFilename
|
||||
are drawn from the _representedURL variable.
|
||||
*/
|
||||
var aURL = @"http://www.cappuccino-project.org";
|
||||
|
||||
[[self window] setRepresentedURL:[CPURL URLWithString:aURL]];
|
||||
[self assertTrue:[[[self window] representedURL] class] === [CPURL class]];
|
||||
/*
|
||||
Test for Issue 1633
|
||||
Make sure that changing it via setRepresentedFilename doesn't change the type
|
||||
*/
|
||||
[[self window] setRepresentedFilename:aURL];
|
||||
[self assertTrue:[[[self window] representedURL] class] === [CPURL class]];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user