mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-24 23:45:52 +00:00
Fixed: CPProgressIndicator encoder wasted space and caused errors.
The errors would cause exceptions such as "Not allowed to load local resource: file:///<some local path from the machine that ran nib2cib>" when loading cib driven app through a web server.
This commit is contained in:
1 parent
1476efce90
commit
da055f83b3
1 file changed
+11
@@ -481,6 +481,8 @@ var CPProgressIndicatorSpinningStyleColors = nil,
|
||||
_isAnimating = [aCoder decodeObjectForKey:@"_isAnimating"];
|
||||
_isDisplayedWhenStoppedSet = [aCoder decodeObjectForKey:@"_isDisplayedWhenStoppedSet"];
|
||||
_isDisplayedWhenStopped = [aCoder decodeObjectForKey:@"_isDisplayedWhenStopped"];
|
||||
|
||||
[self updateBackgroundColor];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -488,7 +490,16 @@ var CPProgressIndicatorSpinningStyleColors = nil,
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
// Don't encode the subviews or background colour. They can be recreated based on the flags and if encoded cause hardcoded
|
||||
// image paths in the cib while just wasting space.
|
||||
// TODO Maybe just switch them for ephemeral views.
|
||||
var subviews = [self subviews],
|
||||
backgroundColor = [self backgroundColor];
|
||||
[self setSubviews:[]];
|
||||
[self setBackgroundColor:nil];
|
||||
[super encodeWithCoder:aCoder];
|
||||
[self setSubviews:subviews];
|
||||
[self setBackgroundColor:backgroundColor];
|
||||
|
||||
[aCoder encodeObject:_minValue forKey:@"_minValue"];
|
||||
[aCoder encodeObject:_maxValue forKey:@"_maxValue"];
|
||||
|
||||
Reference in new issue
Block a user