Revision: 28360
          http://sourceforge.net/p/bibdesk/svn/28360
Author:   hofman
Date:     2023-09-20 14:09:32 +0000 (Wed, 20 Sep 2023)
Log Message:
-----------
Make sure properties are synthesized. No need for dependent keys, as the 
generic properties are not bound to or observed.

Modified Paths:
--------------
    trunk/bibdesk/BDSKCondition.m

Modified: trunk/bibdesk/BDSKCondition.m
===================================================================
--- trunk/bibdesk/BDSKCondition.m       2023-09-20 09:30:18 UTC (rev 28359)
+++ trunk/bibdesk/BDSKCondition.m       2023-09-20 14:09:32 UTC (rev 28360)
@@ -57,18 +57,9 @@
 
 @implementation BDSKCondition
 
-@synthesize stringComparison, attachmentComparison, countValue, 
dateComparison, numberValue, andNumberValue, periodValue, group;
-@dynamic dictionaryValue, key, value, comparison, stringValue, dateValue, 
toDateValue, dateCondition, attachmentCondition;
+@synthesize key, stringComparison, stringValue, attachmentComparison, 
countValue, dateComparison, numberValue, andNumberValue, periodValue, 
dateValue, toDateValue, group;
+@dynamic dictionaryValue, value, comparison, dateCondition, 
attachmentCondition;
 
-+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
-    NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
-    if ([key isEqualToString:@"comparison"])
-        keyPaths = [keyPaths setByAddingObjectsFromSet:[NSSet 
setWithObjects:@"stringComparison", @"attachmentComparison", @"dateComparison", 
nil]];
-    else if ([key isEqualToString:@"value"])
-        keyPaths = [keyPaths setByAddingObjectsFromSet:[NSSet 
setWithObjects:@"stringValue", @"countValue", @"numberValue", 
@"andNumberValue", @"periodValue", @"dateValue", @"toDateValue", nil]];
-    return keyPaths;
-}
-
 + (NSString *)dictionaryVersion {
     return @"1";
 }
@@ -388,18 +379,13 @@
 
 #pragma mark | generic
 
-- (NSString *)key {
-    return [[key retain] autorelease];
-}
-
 - (void)setKey:(NSString *)newKey {
-    // we never want the key to be nil. It is set to nil sometimes by the 
binding mechanism
     if (key != newKey) {
         [key release];
-        key = [(newKey ?: @"") copy];
+        key = [(newKey ?: @"") retain];
     }
 }
-
+                
 - (NSInteger)comparison {
     return [self isDateCondition] ? dateComparison : [self 
isAttachmentCondition] ? attachmentComparison : stringComparison;
 }
@@ -509,10 +495,6 @@
 
 #pragma mark | strings
 
-- (NSString *)stringValue {
-    return [[stringValue retain] autorelease];
-}
-
 - (void)setStringValue:(NSString *)newValue {
        // we never want the value to be nil. It is set to nil sometimes by the 
binding mechanism
     if (stringValue != newValue) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to