Revision: 29868
          http://sourceforge.net/p/bibdesk/svn/29868
Author:   hofman
Date:     2025-11-21 17:45:19 +0000 (Fri, 21 Nov 2025)
Log Message:
-----------
add some lightweight generics to pref pane classes

Modified Paths:
--------------
    trunk/bibdesk/BibPref_Crossref.h
    trunk/bibdesk/BibPref_Defaults.h
    trunk/bibdesk/BibPref_Defaults.m
    trunk/bibdesk/BibPref_Export.h
    trunk/bibdesk/BibPref_Export.m
    trunk/bibdesk/BibPref_ScriptHooks.h

Modified: trunk/bibdesk/BibPref_Crossref.h
===================================================================
--- trunk/bibdesk/BibPref_Crossref.h    2025-11-21 17:32:13 UTC (rev 29867)
+++ trunk/bibdesk/BibPref_Crossref.h    2025-11-21 17:45:19 UTC (rev 29868)
@@ -49,7 +49,7 @@
     NSButton *forceDuplicateBooktitleCheckButton;
     NSSegmentedControl *addRemoveTypeButton;
     NSTableView *tableView;
-       NSMutableArray *typesArray;
+       NSMutableArray<NSString *> *typesArray;
 }
 
 @property (nonatomic, nullable, strong) IBOutlet NSButton *autoSortCheckButton;

Modified: trunk/bibdesk/BibPref_Defaults.h
===================================================================
--- trunk/bibdesk/BibPref_Defaults.h    2025-11-21 17:32:13 UTC (rev 29867)
+++ trunk/bibdesk/BibPref_Defaults.h    2025-11-21 17:45:19 UTC (rev 29868)
@@ -54,9 +54,9 @@
     NSPopUpButton *localFileOptionPopup;
     NSPopUpButton *pdfViewerPopup;
     NSPopUpButton *downloadsFolderPopUp;
-    NSMutableArray *customFieldsArray;
-    NSMutableSet *customFieldsSet;
-    NSMutableArray *globalMacroFiles;
+    NSMutableArray<NSMutableDictionary<NSString *, id> *> *customFieldsArray;
+    NSMutableSet<NSString *> *customFieldsSet;
+    NSMutableArray<NSString *> *globalMacroFiles;
     BDSKMacroWindowController *macroWC;
 }
 

Modified: trunk/bibdesk/BibPref_Defaults.m
===================================================================
--- trunk/bibdesk/BibPref_Defaults.m    2025-11-21 17:32:13 UTC (rev 29867)
+++ trunk/bibdesk/BibPref_Defaults.m    2025-11-21 17:45:19 UTC (rev 29868)
@@ -170,7 +170,6 @@
         globalMacroFiles = [[NSMutableArray alloc] initWithArray:[sud 
stringArrayForKey:BDSKGlobalMacroFilesKey]];
        
         customFieldsArray = [[NSMutableArray alloc] initWithCapacity:6];
-        customFieldsArray = [[NSMutableArray alloc] initWithCapacity:6];
                customFieldsSet = [[NSMutableSet alloc] initWithCapacity:6];
                
                // initialize the default fields from the prefs
@@ -542,7 +541,7 @@
     if ([field isEqualToString:oldField])
         return;
     
-    [customFieldsSet removeObject:[customFieldsArray objectAtIndex:row]];
+    [customFieldsSet removeObject:[[customFieldsArray objectAtIndex:row] 
objectForKey:FIELD_KEY]];
     if ([field isEqualToString:@""]) {
         [customFieldsArray removeObjectAtIndex:row];
     } else {

Modified: trunk/bibdesk/BibPref_Export.h
===================================================================
--- trunk/bibdesk/BibPref_Export.h      2025-11-21 17:32:13 UTC (rev 29867)
+++ trunk/bibdesk/BibPref_Export.h      2025-11-21 17:45:19 UTC (rev 29868)
@@ -51,9 +51,9 @@
 
 @interface BibPref_Export : BDSKPreferencePane <BDSKOutlineViewDelegate, 
NSOutlineViewDataSource> {
     BDSKOutlineView *outlineView;
-    NSMutableArray *itemNodes;
-    NSMutableArray *roles;    
-    NSArray *fileTypes;    
+    NSMutableArray<BDSKTemplate *> *itemNodes;
+    NSMutableArray<NSString *> *roles;
+    NSArray<NSString *> *fileTypes;
     BDSKTemplateListType templatePrefList;
     BDSKTemplate *draggedTemplate;
     NSSegmentedControl *addRemoveButton;

Modified: trunk/bibdesk/BibPref_Export.m
===================================================================
--- trunk/bibdesk/BibPref_Export.m      2025-11-21 17:32:13 UTC (rev 29867)
+++ trunk/bibdesk/BibPref_Export.m      2025-11-21 17:45:19 UTC (rev 29868)
@@ -176,7 +176,7 @@
     } else { // remove
         
         NSInteger row = [outlineView selectedRow];
-        BDSKTreeNode *selectedNode = row == -1 ? nil : [outlineView 
itemAtRow:row];
+        BDSKTemplate *selectedNode = row == -1 ? nil : [outlineView 
itemAtRow:row];
         if(nil != selectedNode){
             if([selectedNode isLeaf])
                 [[[selectedNode parent] mutableArrayValueForKey:@"children"] 
removeObject:selectedNode];
@@ -341,7 +341,7 @@
 - (void)outlineView:(NSOutlineView *)ov deleteItems:(NSArray *)items;
 {
     // currently we don't allow multiple selection
-    BDSKTreeNode *item = [items lastObject];
+    BDSKTemplate *item = [items lastObject];
     if(item && [self canDeleteItem:item]) {
         [self addRemoveNode:nil];
         if ([item isLeaf])

Modified: trunk/bibdesk/BibPref_ScriptHooks.h
===================================================================
--- trunk/bibdesk/BibPref_ScriptHooks.h 2025-11-21 17:32:13 UTC (rev 29867)
+++ trunk/bibdesk/BibPref_ScriptHooks.h 2025-11-21 17:45:19 UTC (rev 29868)
@@ -41,16 +41,18 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class BDSKScriptHookFile;
+
 @interface BibPref_ScriptHooks : BDSKPreferencePane <NSTableViewDelegate, 
NSTableViewDataSource, NSMenuDelegate> {
     NSTableView *tableView;
     NSSegmentedControl *addRemoveButton;
-    NSArray *scriptHookFiles;
+    NSArray<BDSKScriptHookFile *> *scriptHookFiles;
 }
 
 @property (nonatomic, nullable, strong) IBOutlet NSTableView *tableView;
 @property (nonatomic, nullable, strong) IBOutlet NSSegmentedControl 
*addRemoveButton;
 
-@property (nonatomic, readonly) NSArray *scriptHookFiles;
+@property (nonatomic, readonly) NSArray<BDSKScriptHookFile *> *scriptHookFiles;
 
 - (IBAction)addRemoveScriptHook:(nullable id)sender;
 - (void)showOrChooseScriptFile:(nullable id)sender;

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