Revision: 22927
          http://sourceforge.net/p/bibdesk/svn/22927
Author:   hofman
Date:     2018-11-04 19:05:34 +0000 (Sun, 04 Nov 2018)
Log Message:
-----------
revert check change for delete of pubs and groups, instead fix allowsRemoval 
for static and library group, which should return YES

Modified Paths:
--------------
    trunk/bibdesk/BDSKLibraryGroup.m
    trunk/bibdesk/BDSKStaticGroup.m
    trunk/bibdesk/BibDocument_DataSource.m

Modified: trunk/bibdesk/BDSKLibraryGroup.m
===================================================================
--- trunk/bibdesk/BDSKLibraryGroup.m    2018-11-04 18:06:19 UTC (rev 22926)
+++ trunk/bibdesk/BDSKLibraryGroup.m    2018-11-04 19:05:34 UTC (rev 22927)
@@ -63,7 +63,7 @@
 
 - (BDSKGroupType)groupType { return BDSKLibraryGroupType; }
 
-- (BOOL)allowsRemoval { return NO; }
+- (BOOL)allowsRemoval { return YES; }
 
 - (NSArray *)publications {
     return [[self document] publications];

Modified: trunk/bibdesk/BDSKStaticGroup.m
===================================================================
--- trunk/bibdesk/BDSKStaticGroup.m     2018-11-04 18:06:19 UTC (rev 22926)
+++ trunk/bibdesk/BDSKStaticGroup.m     2018-11-04 19:05:34 UTC (rev 22927)
@@ -125,7 +125,7 @@
 
 - (BDSKGroupType)groupType { return BDSKStaticGroupType; }
 
-- (BOOL)allowsRemoval { return NO; }
+- (BOOL)allowsRemoval { return YES; }
 
 - (NSArray *)publications {
     return publications;

Modified: trunk/bibdesk/BibDocument_DataSource.m
===================================================================
--- trunk/bibdesk/BibDocument_DataSource.m      2018-11-04 18:06:19 UTC (rev 
22926)
+++ trunk/bibdesk/BibDocument_DataSource.m      2018-11-04 19:05:34 UTC (rev 
22927)
@@ -884,7 +884,7 @@
 
 - (BOOL)tableView:(NSTableView *)tv canDeleteRowsWithIndexes:(NSIndexSet 
*)rowIndexes {
        if (tv == tableView || tv == [fileSearchController tableView]) {
-        return [self hasGroupTypeSelected:BDSKExternalGroupType] == NO && 
[rowIndexes count] > 0;
+        return NSNotFound == [[self selectedGroups] 
indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop){ return [obj 
allowsRemoval] == NO; }];
        }
     return NO;
 }
@@ -1412,7 +1412,9 @@
 
 - (BOOL)outlineView:(NSOutlineView *)ov canDeleteItems:(NSArray *)items {
        if (ov == groupOutlineView) {
-        return NSNotFound == [items indexOfObjectPassingTest:^BOOL(id obj, 
NSUInteger idx, BOOL *stop){ return [obj allowsRemoval] == NO; }];
+        return NSNotFound != [items indexOfObjectPassingTest:^BOOL(id obj, 
NSUInteger idx, BOOL *stop){
+            return 0 != ([obj groupType] & BDSKRemovableGroupType);
+        }];
        }
     return NO;
 }

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to