From edb86ebeeb40df6899032414fb6ddd4f95df850b Mon Sep 17 00:00:00 2001 From: cacaodev Date: Thu, 26 Apr 2012 16:09:32 +0200 Subject: [PATCH] CPPredicateEditorValueBinder cleaning, conforms to recent CPBinder updates --- AppKit/CPRuleEditor/CPPredicateEditor.j | 29 ++++--------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/AppKit/CPRuleEditor/CPPredicateEditor.j b/AppKit/CPRuleEditor/CPPredicateEditor.j index 64fc86604..f05d5650d 100644 --- a/AppKit/CPRuleEditor/CPPredicateEditor.j +++ b/AppKit/CPRuleEditor/CPPredicateEditor.j @@ -540,35 +540,14 @@ var CPPredicateTemplatesKey = @"CPPredicateTemplates"; { } -- (void)setValueFor:(CPString)aBinding +- (void)setPlaceholderValue:(id)aValue withMarker:(CPString)aMarker forBinding:(CPString)aBinding { - var destination = [_info objectForKey:CPObservedObjectKey], - keyPath = [_info objectForKey:CPObservedKeyPathKey], - options = [_info objectForKey:CPOptionsKey], - newValue = [destination valueForKeyPath:keyPath]; - - var isMarker = CPIsControllerMarker(newValue); - if (isMarker) - newValue = [options objectForKey:newValue]; - - if (!isMarker || newValue == nil) - newValue = [self transformValue:newValue withOptions:options]; - - [_source _reflectPredicate:newValue]; + [_source _reflectPredicate:nil]; } -- (void)reverseSetValueFor:(CPString)aBinding +- (void)setValue:(id)aValue forBinding:(CPString)aBinding { - var destination = [_info objectForKey:CPObservedObjectKey], - keyPath = [_info objectForKey:CPObservedKeyPathKey], - options = [_info objectForKey:CPOptionsKey], - newValue = [_source valueForKeyPath:aBinding]; - - newValue = [self reverseTransformValue:newValue withOptions:options]; - - [destination removeObserver:self forKeyPath:keyPath]; - [destination setValue:newValue forKeyPath:keyPath]; - [destination addObserver:self forKeyPath:keyPath options:CPKeyValueObservingOptionNew context:aBinding]; + [_source _reflectPredicate:aValue]; } @end