Revision: 29728
          http://sourceforge.net/p/bibdesk/svn/29728
Author:   hofman
Date:     2025-10-14 16:22:56 +0000 (Tue, 14 Oct 2025)
Log Message:
-----------
declare group as __kindof BDSKGroup * in getters or add/remove methods

Modified Paths:
--------------
    trunk/bibdesk/BDSKGroupsArray.h
    trunk/bibdesk/BDSKGroupsArray.m
    trunk/bibdesk/BDSKParentGroup.h
    trunk/bibdesk/BDSKParentGroup.m

Modified: trunk/bibdesk/BDSKGroupsArray.h
===================================================================
--- trunk/bibdesk/BDSKGroupsArray.h     2025-10-14 16:01:52 UTC (rev 29727)
+++ trunk/bibdesk/BDSKGroupsArray.h     2025-10-14 16:22:56 UTC (rev 29728)
@@ -78,8 +78,8 @@
 - (void)addCategoryParent:(BDSKCategoryParentGroup *)group;
 - (void)removeCategoryParent:(BDSKCategoryParentGroup *)group;
 
-- (void)addChildGroup:(BDSKGroup *)group;
-- (void)removeChildGroup:(BDSKGroup *)group;
+- (void)addChildGroup:(__kindof BDSKGroup *)group;
+- (void)removeChildGroup:(__kindof BDSKGroup *)group;
 
 - (void)removeAllUndoableGroups;
 

Modified: trunk/bibdesk/BDSKGroupsArray.m
===================================================================
--- trunk/bibdesk/BDSKGroupsArray.m     2025-10-14 16:01:52 UTC (rev 29727)
+++ trunk/bibdesk/BDSKGroupsArray.m     2025-10-14 16:22:56 UTC (rev 29728)
@@ -181,7 +181,7 @@
 
 #pragma mark Mutable accessors
 
-- (void)addChildGroup:(BDSKGroup *)group {
+- (void)addChildGroup:(__kindof BDSKGroup *)group {
     BDSKGroupType groupType = [group groupType];
     BDSKParentGroup *parent = nil;
     if (groupType == BDSKStaticGroupType)
@@ -199,7 +199,7 @@
     [[self document] reloadParentGroup:parent withSelection:selectedGroups];
 }
 
-- (void)removeChildGroup:(BDSKGroup *)group {
+- (void)removeChildGroup:(__kindof BDSKGroup *)group {
     BDSKParentGroup *parent = [group parent];
     NSArray *groupsToRemove = @[group];
     if (([group groupType] & BDSKExternalGroupType) != 0)

Modified: trunk/bibdesk/BDSKParentGroup.h
===================================================================
--- trunk/bibdesk/BDSKParentGroup.h     2025-10-14 16:01:52 UTC (rev 29727)
+++ trunk/bibdesk/BDSKParentGroup.h     2025-10-14 16:22:56 UTC (rev 29728)
@@ -53,7 +53,7 @@
 @property (nonatomic, readonly) NSString *identifier;
 
 - (NSUInteger)numberOfChildren;
-- (id)childAtIndex:(NSUInteger)anIndex;
+- (__kindof BDSKGroup *)childAtIndex:(NSUInteger)anIndex;
 - (NSArray *)children;
 
 - (void)sortUsingDescriptors:(nullable NSArray *)sortDescriptors;
@@ -61,8 +61,8 @@
 
 - (void)removeAllUndoableChildren;
 
-- (void)addChildGroup:(BDSKGroup *)group;
-- (void)removeChildGroup:(BDSKGroup *)group;
+- (void)addChildGroup:(__kindof BDSKGroup *)group;
+- (void)removeChildGroup:(__kindof BDSKGroup *)group;
 
 @end
 

Modified: trunk/bibdesk/BDSKParentGroup.m
===================================================================
--- trunk/bibdesk/BDSKParentGroup.m     2025-10-14 16:01:52 UTC (rev 29727)
+++ trunk/bibdesk/BDSKParentGroup.m     2025-10-14 16:22:56 UTC (rev 29728)
@@ -120,12 +120,12 @@
         [children sortUsingDescriptors:sortDescriptors];
 }
 
-- (id)childAtIndex:(NSUInteger)anIndex {
+- (__kindof BDSKGroup *)childAtIndex:(NSUInteger)anIndex {
     NSParameterAssert(nil != children);
     return [children objectAtIndex:anIndex];
 }
 
-- (void)insertChild:(id)child inRange:(NSRange)range {
+- (void)insertChild:(__kindof BDSKGroup *)child inRange:(NSRange)range {
     [children insertObject:child atIndex:NSMaxRange(range)];
     [child setParent:self];
     [child setDocument:[self document]];
@@ -133,7 +133,7 @@
     [self resortInRange:range];
 }
 
-- (void)removeChild:(id)child {
+- (void)removeChild:(__kindof BDSKGroup *)child {
     // -[NSMutableArray removeObject:] removes all occurrences, which is not 
what we want here
     NSUInteger idx = [children indexOfObjectIdenticalTo:child];
     if (NSNotFound != idx) {
@@ -181,11 +181,11 @@
     [self removeAllChildren];
 }
 
-- (void)addChildGroup:(BDSKGroup *)group {
+- (void)addChildGroup:(__kindof BDSKGroup *)group {
     [self insertChild:group inRange:NSMakeRange(0, [self numberOfChildren])];
 }
 
-- (void)removeChildGroup:(BDSKGroup *)group {
+- (void)removeChildGroup:(__kindof BDSKGroup *)group {
     [self removeChild:group];
 }
 
@@ -274,7 +274,7 @@
     return [self childrenAtIndex:scriptGroupLocation count:scriptGroupCount];
 }
 
-- (void)addChildGroup:(BDSKGroup *)group {
+- (void)addChildGroup:(__kindof BDSKGroup *)group {
     NSRange range;
     switch ([group groupType]) {
         case BDSKWebGroupType:
@@ -291,7 +291,7 @@
     [self insertChild:group inRange:range];
 }
 
-- (void)removeChildGroup:(BDSKGroup *)group {
+- (void)removeChildGroup:(__kindof BDSKGroup *)group {
     switch ([group groupType]) {
         case BDSKWebGroupType:    webGroupCount--; break;
         case BDSKSearchGroupType: searchGroupCount--; break;
@@ -410,7 +410,7 @@
 
 - (BDSKGroupType)groupType { return BDSKStaticParentGroupType; }
 
-- (void)addChildGroup:(BDSKGroup *)group {
+- (void)addChildGroup:(__kindof BDSKGroup *)group {
     if ([group groupType] == BDSKStaticGroupType)
         [self insertChild:group inRange:NSMakeRange(0, [self 
numberOfChildren])];
 }
@@ -436,7 +436,7 @@
     return [self children];
 }
 
-- (void)addChildGroup:(BDSKGroup *)group {
+- (void)addChildGroup:(__kindof BDSKGroup *)group {
     NSRange range = NSMakeRange(0, [self numberOfChildren]);
     if ([group groupType] == BDSKLastImportGroupType) {
         BDSKLastImportGroup *lastImportGroup = [self lastImportGroup];

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