Revision: 24026
http://sourceforge.net/p/bibdesk/svn/24026
Author: hofman
Date: 2019-07-15 14:41:50 +0000 (Mon, 15 Jul 2019)
Log Message:
-----------
use properties for manager classes
Modified Paths:
--------------
trunk/bibdesk/BDSKAsynchronousDOServer.h
trunk/bibdesk/BDSKAsynchronousDOServer.m
trunk/bibdesk/BDSKDocumentSearch.h
trunk/bibdesk/BDSKDocumentSearch.m
trunk/bibdesk/BDSKFileSearch.h
trunk/bibdesk/BDSKFileSearch.m
trunk/bibdesk/BDSKFileSearchIndex.h
trunk/bibdesk/BDSKFileSearchIndex.m
trunk/bibdesk/BDSKMacroResolver.h
trunk/bibdesk/BDSKMacroResolver.m
trunk/bibdesk/BDSKNotesSearchIndex.h
trunk/bibdesk/BDSKNotesSearchIndex.m
trunk/bibdesk/BDSKSearchGroupServerManager.h
trunk/bibdesk/BDSKSearchGroupServerManager.m
trunk/bibdesk/BDSKSharingBrowser.h
trunk/bibdesk/BDSKSharingBrowser.m
trunk/bibdesk/BDSKSharingClient.h
trunk/bibdesk/BDSKSharingClient.m
trunk/bibdesk/BDSKSharingServer.h
trunk/bibdesk/BDSKSharingServer.m
trunk/bibdesk/BDSKTypeManager.h
trunk/bibdesk/BDSKTypeManager.m
trunk/bibdesk/BDSKTypeSelectHelper.h
trunk/bibdesk/BDSKTypeSelectHelper.m
trunk/bibdesk/BDSKUndoManager.h
trunk/bibdesk/BDSKUndoManager.m
Modified: trunk/bibdesk/BDSKAsynchronousDOServer.h
===================================================================
--- trunk/bibdesk/BDSKAsynchronousDOServer.h 2019-07-15 13:43:32 UTC (rev
24025)
+++ trunk/bibdesk/BDSKAsynchronousDOServer.h 2019-07-15 14:41:50 UTC (rev
24026)
@@ -73,15 +73,15 @@
- (void)serverDidFinish;
// run loop flag; thread safe
-- (BOOL)shouldKeepRunning;
+@property (nonatomic, readonly) BOOL shouldKeepRunning;
// use these proxies to message the server object; do not override; only use
them from the other thread
-- (id)serverOnMainThread;
-- (id)serverOnServerThread;
+@property (nonatomic, readonly) id serverOnMainThread;
+@property (nonatomic, readonly) id serverOnServerThread;
// override to add additional methods adopted by serverOn...Thread objects;
they should always adopt our protocols
-- (Protocol *)protocolForServerThread; // protocol must adopt
<BDSKAsyncDOServerThread>
-- (Protocol *)protocolForMainThread; // protocol must adopt
<BDSKAsyncDOServerMainThread>
+@property (nonatomic, readonly) Protocol *protocolForServerThread; // protocol
must adopt <BDSKAsyncDOServerThread>
+@property (nonatomic, readonly) Protocol *protocolForMainThread; // protocol
must adopt <BDSKAsyncDOServerMainThread>
@end
Modified: trunk/bibdesk/BDSKAsynchronousDOServer.m
===================================================================
--- trunk/bibdesk/BDSKAsynchronousDOServer.m 2019-07-15 13:43:32 UTC (rev
24025)
+++ trunk/bibdesk/BDSKAsynchronousDOServer.m 2019-07-15 14:41:50 UTC (rev
24026)
@@ -64,6 +64,8 @@
@implementation BDSKAsynchronousDOServer
+@dynamic shouldKeepRunning, serverOnMainThread, serverOnServerThread,
protocolForMainThread, protocolForServerThread;
+
#ifdef DEBUG
- (void)checkStartup:(NSTimer *)ignored
{
Modified: trunk/bibdesk/BDSKDocumentSearch.h
===================================================================
--- trunk/bibdesk/BDSKDocumentSearch.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKDocumentSearch.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -56,9 +56,10 @@
// following are all thread safe, aDelegate must implement all delegate methods
- (id)initWithDelegate:(id)aDelegate;
- (void)searchForString:(NSString *)searchString index:(SKIndexRef)index
selectedPublications:(NSArray *)selPubs
scrollPositionAsPercentage:(NSPoint)scrollPoint;
-- (NSArray *)previouslySelectedPublications;
-- (NSPoint)previousScrollPositionAsPercentage;
+@property (nonatomic, readonly) NSArray *previouslySelectedPublications;
+@property (nonatomic, readonly) NSPoint previousScrollPositionAsPercentage;
+
// call when closing the document window; kills the search and prevents
further callbacks
- (void)terminate;
Modified: trunk/bibdesk/BDSKDocumentSearch.m
===================================================================
--- trunk/bibdesk/BDSKDocumentSearch.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKDocumentSearch.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -46,6 +46,8 @@
@implementation BDSKDocumentSearch
+@synthesize previouslySelectedPublications, previousScrollPositionAsPercentage;
+
- (id)initWithDelegate:(id)aDelegate {
self = [super init];
if (self) {
@@ -191,10 +193,6 @@
[self _cancelSearch];
}
-- (NSArray *)previouslySelectedPublications { return
previouslySelectedPublications; }
-
-- (NSPoint)previousScrollPositionAsPercentage { return
previousScrollPositionAsPercentage; }
-
- (void)searchForString:(NSString *)searchString index:(SKIndexRef)skIndex
selectedPublications:(NSArray *)selPubs
scrollPositionAsPercentage:(NSPoint)scrollPoint;
{
[previouslySelectedPublications autorelease];
Modified: trunk/bibdesk/BDSKFileSearch.h
===================================================================
--- trunk/bibdesk/BDSKFileSearch.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKFileSearch.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -116,8 +116,7 @@
// primary entry point for searching; starts the search, which will send
delegate messages
- (void)searchForString:(NSString *)aString withOptions:(SKSearchOptions)opts;
-- (void)setDelegate:(id <BDSKSearchDelegate>)aDelegate;
-- (id <BDSKSearchDelegate>)delegate;
+@property (nonatomic, assign) id <BDSKSearchDelegate> delegate;
// cancels the current search; shouldn't be any further update messages until
another search is performed
- (void)cancel;
Modified: trunk/bibdesk/BDSKFileSearch.m
===================================================================
--- trunk/bibdesk/BDSKFileSearch.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKFileSearch.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -77,6 +77,8 @@
@implementation BDSKFileSearch
+@synthesize delegate;
+
- (id)initWithIndex:(BDSKFileSearchIndex *)anIndex delegate:(id
<BDSKSearchDelegate>)aDelegate;
{
NSParameterAssert(nil != anIndex);
@@ -150,8 +152,6 @@
delegate = aDelegate;
}
-- (id <BDSKSearchDelegate>)delegate { return delegate; }
-
@end
Modified: trunk/bibdesk/BDSKFileSearchIndex.h
===================================================================
--- trunk/bibdesk/BDSKFileSearchIndex.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKFileSearchIndex.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -86,7 +86,7 @@
- (id)initForOwner:(id <BDSKOwner>)owner;
// Warning: it is /not/ safe to write to this SKIndexRef directly; use it
only for reading.
-- (SKIndexRef)index;
+@property (nonatomic, readonly) SKIndexRef index;
- (void)resetWithPublications:(NSArray *)pubs;
@@ -93,14 +93,13 @@
// Required before disposing of the index. After calling cancel, the index is
no longer viable.
- (void)cancelForDocumentURL:(NSURL *)documentURL;
-- (BDSKSearchIndexStatus)status;
+@property (readonly) BDSKSearchIndexStatus status;
-- (id <BDSKFileSearchIndexDelegate>)delegate;
-- (void)setDelegate:(id <BDSKFileSearchIndexDelegate>)anObject;
+@property (nonatomic, assign) id <BDSKFileSearchIndexDelegate> delegate;
- (NSSet *)identifierURLsForURL:(NSURL *)theURL;
// Poll this for progress bar updates during indexing
-- (double)progressValue;
+@property (readonly) double progressValue;
@end
Modified: trunk/bibdesk/BDSKFileSearchIndex.m
===================================================================
--- trunk/bibdesk/BDSKFileSearchIndex.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKFileSearchIndex.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -63,6 +63,9 @@
@implementation BDSKFileSearchIndex
+@synthesize index, delegate;
+@dynamic status, progressValue;
+
// increment if incompatible changes are introduced
#define CACHE_VERSION @"2"
@@ -179,11 +182,6 @@
});
}
-- (SKIndexRef)index
-{
- return skIndex;
-}
-
- (BDSKSearchIndexStatus)status
{
OSMemoryBarrier();
@@ -190,16 +188,6 @@
return flags.status;
}
-- (id)delegate
-{
- return delegate;
-}
-
-- (void)setDelegate:(id <BDSKFileSearchIndexDelegate>)anObject
-{
- delegate = anObject;
-}
-
- (NSSet *)identifierURLsForURL:(NSURL *)theURL
{
[rwLock lockForReading];
Modified: trunk/bibdesk/BDSKMacroResolver.h
===================================================================
--- trunk/bibdesk/BDSKMacroResolver.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKMacroResolver.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -62,14 +62,14 @@
- (id)initWithOwner:(id<BDSKOwner>)anOwner;
-- (id<BDSKOwner>)owner;
+@property (nonatomic, readonly) id<BDSKOwner> owner;
-- (NSUndoManager *)undoManager;
+@property (nonatomic, readonly) NSUndoManager *undoManager;
-- (NSString *)bibTeXString;
+@property (nonatomic, readonly) NSString *bibTeXString;
-- (NSDictionary *)macroDefinitions;
-- (void)setMacroDefinitions:(NSDictionary *)dictionary;
+@property (nonatomic, copy) NSDictionary *macroDefinitions;
+
// returns global definitions + local overrides
- (NSDictionary *)allMacroDefinitions;
@@ -81,6 +81,6 @@
- (BOOL)string:(NSString *)string dependsOnMacro:(NSString *)macro;
- (BOOL)string:(NSString *)string dependsOnMacro:(NSString *)macro
inMacroDefinitions:(NSDictionary *)dictionary;
-- (unsigned long long)modification;
+@property (nonatomic, readonly) unsigned long long modification;
@end
Modified: trunk/bibdesk/BDSKMacroResolver.m
===================================================================
--- trunk/bibdesk/BDSKMacroResolver.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKMacroResolver.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -82,6 +82,9 @@
@implementation BDSKMacroResolver
+@synthesize owner, modification;
+@dynamic undoManager, bibTeXString, macroDefinitions;
+
static BDSKGlobalMacroResolver *defaultMacroResolver = nil;
+ (id)defaultMacroResolver{
@@ -111,18 +114,10 @@
[super dealloc];
}
-- (id<BDSKOwner>)owner{
- return owner;
-}
-
- (NSUndoManager *)undoManager{
return [owner undoManager];
}
-- (unsigned long long)modification {
- return modification;
-}
-
- (NSString *)bibTeXString{
if (macroDefinitions == nil)
return @"";
Modified: trunk/bibdesk/BDSKNotesSearchIndex.h
===================================================================
--- trunk/bibdesk/BDSKNotesSearchIndex.h 2019-07-15 13:43:32 UTC (rev
24025)
+++ trunk/bibdesk/BDSKNotesSearchIndex.h 2019-07-15 14:41:50 UTC (rev
24026)
@@ -56,7 +56,7 @@
- (void)resetWithPublications:(NSArray *)pubs;
// Warning: it is /not/ safe to write to this SKIndexRef directly; use it
only for reading.
-- (SKIndexRef)index;
+@property (nonatomic, readonly) SKIndexRef index;
// call when closing the document window; kills the search and prevents
further callbacks
- (void)terminate;
Modified: trunk/bibdesk/BDSKNotesSearchIndex.m
===================================================================
--- trunk/bibdesk/BDSKNotesSearchIndex.m 2019-07-15 13:43:32 UTC (rev
24025)
+++ trunk/bibdesk/BDSKNotesSearchIndex.m 2019-07-15 14:41:50 UTC (rev
24026)
@@ -55,6 +55,8 @@
@implementation BDSKNotesSearchIndex
+@dynamic index;
+
- (id)initForOwner:(id <BDSKOwner>)owner
{
self = [super init];
Modified: trunk/bibdesk/BDSKSearchGroupServerManager.h
===================================================================
--- trunk/bibdesk/BDSKSearchGroupServerManager.h 2019-07-15 13:43:32 UTC
(rev 24025)
+++ trunk/bibdesk/BDSKSearchGroupServerManager.h 2019-07-15 14:41:50 UTC
(rev 24026)
@@ -53,7 +53,8 @@
- (void)saveServerFile:(BDSKServerInfo *)serverInfo;
- (void)deleteServerFile:(BDSKServerInfo *)serverInfo;
-- (NSArray *)servers;
+@property (nonatomic, readonly) NSArray *servers;
+
- (void)addServer:(BDSKServerInfo *)info;
- (void)setServer:(BDSKServerInfo *)info atIndex:(NSUInteger)index;
- (void)removeServerAtIndex:(NSUInteger)index;
Modified: trunk/bibdesk/BDSKSearchGroupServerManager.m
===================================================================
--- trunk/bibdesk/BDSKSearchGroupServerManager.m 2019-07-15 13:43:32 UTC
(rev 24025)
+++ trunk/bibdesk/BDSKSearchGroupServerManager.m 2019-07-15 14:41:50 UTC
(rev 24026)
@@ -46,6 +46,8 @@
@implementation BDSKSearchGroupServerManager
+@dynamic servers;
+
static BDSKSearchGroupServerManager *sharedManager = nil;
+ (BDSKSearchGroupServerManager *)sharedManager {
Modified: trunk/bibdesk/BDSKSharingBrowser.h
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKSharingBrowser.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -50,9 +50,9 @@
+ (id)sharedBrowser;
+ (NSString *)requiredProtocolVersion;
-- (NSSet *)sharingClients;
+@property (nonatomic, readonly) NSSet *sharingClients;
-- (BOOL)isBrowsing;
+@property (nonatomic, readonly, getter=isBrowsing) BOOL browsing;
- (void)enableSharedBrowsing;
- (void)disableSharedBrowsing;
Modified: trunk/bibdesk/BDSKSharingBrowser.m
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKSharingBrowser.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -50,6 +50,9 @@
@implementation BDSKSharingBrowser
+@synthesize sharingClients;
+@dynamic browsing;
+
static BDSKSharingBrowser *sharedBrowser = nil;
// This is the minimal version for the server that we require
@@ -74,10 +77,6 @@
return self;
}
-- (NSSet *)sharingClients{
- return sharingClients;
-}
-
#pragma mark Reading other data
- (BOOL)shouldAddService:(NSNetService *)aNetService
Modified: trunk/bibdesk/BDSKSharingClient.h
===================================================================
--- trunk/bibdesk/BDSKSharingClient.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKSharingClient.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -50,20 +50,19 @@
- (id)initWithService:(NSNetService *)aService;
-- (NSData *)archivedPublications;
-- (NSData *)archivedMacros;
+@property (nonatomic, readonly) NSData *archivedPublications;
+@property (nonatomic, readonly) NSData *archivedMacros;
-- (BOOL)needsUpdate;
-- (void)setNeedsUpdate:(BOOL)flag;
+@property (nonatomic) BOOL needsUpdate;
-- (BOOL)isRetrieving;
-- (BOOL)failedDownload;
-- (BOOL)needsAuthentication;
-- (BOOL)authenticationFailed;
+@property (nonatomic, readonly, getter=isRetrieving) BOOL retrieving;
+@property (nonatomic, readonly) BOOL failedDownload;
+@property (nonatomic, readonly) BOOL needsAuthentication;
+@property (nonatomic, readonly) BOOL authenticationFailed;
-- (NSString *)errorMessage;
+@property (nonatomic, readonly) NSString *errorMessage;
-- (NSString *)name;
+@property (nonatomic, readonly) NSString *name;
- (void)retrievePublications;
Modified: trunk/bibdesk/BDSKSharingClient.m
===================================================================
--- trunk/bibdesk/BDSKSharingClient.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKSharingClient.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -104,6 +104,9 @@
@implementation BDSKSharingClient
+@synthesize needsUpdate, archivedPublications, archivedMacros, name;
+@dynamic retrieving, failedDownload, needsAuthentication,
authenticationFailed, errorMessage;
+
#pragma mark Init and dealloc
- (id)initWithService:(NSNetService *)aService {
@@ -140,10 +143,6 @@
[server retrievePublicationsInBackground];
}
-- (NSData *)archivedPublications {
- return archivedPublications;
-}
-
- (void)setArchivedPublicationsAndMacros:(NSDictionary *)dictionary {
NSData *newArchivedPublications = [dictionary
objectForKey:BDSKSharedArchivedDataKey];
NSData *newArchivedMacros = [dictionary
objectForKey:BDSKSharedArchivedMacroDataKey];
@@ -165,18 +164,6 @@
[[NSNotificationCenter defaultCenter]
postNotificationName:BDSKSharingClientUpdatedNotification object:self];
}
-- (NSData *)archivedMacros {
- return archivedMacros;
-}
-
-- (BOOL)needsUpdate {
- return needsUpdate;
-}
-
-- (void)setNeedsUpdate:(BOOL)flag {
- needsUpdate = flag;
-}
-
- (BOOL)isRetrieving {
return (BOOL)[server isRetrieving];
}
@@ -193,10 +180,6 @@
return [server authenticationFailed];
}
-- (NSString *)name {
- return name;
-}
-
- (NSString *)errorMessage {
return [server errorMessage];
}
Modified: trunk/bibdesk/BDSKSharingServer.h
===================================================================
--- trunk/bibdesk/BDSKSharingServer.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKSharingServer.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -90,10 +90,10 @@
+ (NSString *)supportedProtocolVersion;
// actual name used for sharing, unique name based on +sharingName
-- (NSString *)sharingName;
-- (BDSKSharingStatus)status;
+@property (nonatomic, readonly) NSString *sharingName;
+@property (nonatomic, readonly) BDSKSharingStatus status;
-- (NSUInteger)numberOfConnections;
+@property (nonatomic, readonly) NSUInteger numberOfConnections;
- (void)enableSharing;
- (void)disableSharing;
Modified: trunk/bibdesk/BDSKSharingServer.m
===================================================================
--- trunk/bibdesk/BDSKSharingServer.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKSharingServer.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -129,8 +129,20 @@
#pragma mark -
+@interface BDSKSharingServer ()
+
+@property (nonatomic, retain) NSString *sharingName;
+@property (nonatomic) BDSKSharingStatus status;
+
+@end
+
+#pragma mark -
+
@implementation BDSKSharingServer
+@synthesize sharingName, status;
+@dynamic numberOfConnections;
+
+ (void)initialize;
{
BDSKINITIALIZE;
@@ -199,21 +211,6 @@
return sharedInstance;
}
-- (NSString *)sharingName {
- return [[sharingName retain] autorelease];
-}
-
-- (void)setSharingName:(NSString *)newName {
- if (sharingName != newName) {
- [sharingName release];
- sharingName = [newName retain];
- }
-}
-
-- (BDSKSharingStatus)status {
- return status;
-}
-
- (void)setStatus:(BDSKSharingStatus)newStatus {
if (status != newStatus) {
status = newStatus;
Modified: trunk/bibdesk/BDSKTypeManager.h
===================================================================
--- trunk/bibdesk/BDSKTypeManager.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKTypeManager.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -61,7 +61,7 @@
NSDictionary *bibTeXTypeForReferTypeDict;
NSDictionary *bibTeXTypeForHCiteTypeDict;
NSDictionary *MODSGenresForBibTeXTypeDict;
- NSDictionary *defaultFieldsForTypesDict;
+ NSDictionary *defaultFieldsForTypes;
NSArray *defaultTypes;
NSSet *standardTypes;
NSSet *allFieldsSet;
@@ -104,25 +104,27 @@
- (NSArray *)requiredFieldsForType:(NSString *)type;
- (NSArray *)optionalFieldsForType:(NSString *)type;
- (NSArray *)userDefaultFieldsForType:(NSString *)type;
-- (NSArray *)types;
-- (NSDictionary *)defaultFieldsForTypes;
-- (NSArray *)defaultTypes;
+
+@property (nonatomic, readonly) NSArray *types;
+@property (nonatomic, readonly) NSDictionary *defaultFieldsForTypes;
+@property (nonatomic, readonly) NSArray *defaultTypes;
+
- (BOOL)isStandardType:(NSString *)type;
// Field types sets
-- (NSSet *)localFileFieldsSet;
-- (NSSet *)remoteURLFieldsSet;
-- (NSSet *)allURLFieldsSet;
-- (NSSet *)noteFieldsSet;
-- (NSSet *)personFieldsSet;
-- (NSSet *)booleanFieldsSet;
-- (NSSet *)triStateFieldsSet;
-- (NSSet *)ratingFieldsSet;
-- (NSSet *)citationFieldsSet;
-- (NSSet *)numericFieldsSet;
-- (NSSet *)invalidGroupFieldsSet;
-- (NSSet *)singleValuedGroupFieldsSet;
-- (NSSet *)allFieldsSet;
+@property (nonatomic, readonly) NSSet *localFileFieldsSet;
+@property (nonatomic, readonly) NSSet *remoteURLFieldsSet;
+@property (nonatomic, readonly) NSSet *allURLFieldsSet;
+@property (nonatomic, readonly) NSSet *noteFieldsSet;
+@property (nonatomic, readonly) NSSet *personFieldsSet;
+@property (nonatomic, readonly) NSSet *booleanFieldsSet;
+@property (nonatomic, readonly) NSSet *triStateFieldsSet;
+@property (nonatomic, readonly) NSSet *ratingFieldsSet;
+@property (nonatomic, readonly) NSSet *citationFieldsSet;
+@property (nonatomic, readonly) NSSet *numericFieldsSet;
+@property (nonatomic, readonly) NSSet *invalidGroupFieldsSet;
+@property (nonatomic, readonly) NSSet *singleValuedGroupFieldsSet;
+@property (nonatomic, readonly) NSSet *allFieldsSet;
- (NSArray *)allFieldNamesIncluding:(NSArray *)include excluding:(NSArray
*)exclude;
@@ -167,15 +169,13 @@
- (NSCharacterSet *)invalidCharactersForField:(NSString *)fieldName;
- (NSCharacterSet *)strictInvalidCharactersForField:(NSString *)fieldName;
- (NSCharacterSet *)veryStrictInvalidCharactersForField:(NSString *)fieldName;
-- (NSCharacterSet *)invalidFieldNameCharacterSet;
-- (NSCharacterSet *)fragileCiteKeyCharacterSet;
+@property (nonatomic, readonly) NSCharacterSet *invalidFieldNameCharacterSet;
+@property (nonatomic, readonly) NSCharacterSet *fragileCiteKeyCharacterSet;
- (NSCharacterSet *)separatorCharacterSetForField:(NSString *)fieldName;
// Fields for autogeneration formats
-- (NSArray *)requiredFieldsForCiteKey;
-- (void)setRequiredFieldsForCiteKey:(NSArray *)newFields;
-- (NSArray *)requiredFieldsForLocalFile;
-- (void)setRequiredFieldsForLocalFile:(NSArray *)newFields;
+@property (nonatomic, copy) NSArray *requiredFieldsForCiteKey;
+@property (nonatomic, copy) NSArray *requiredFieldsForLocalFile;
@end
Modified: trunk/bibdesk/BDSKTypeManager.m
===================================================================
--- trunk/bibdesk/BDSKTypeManager.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKTypeManager.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -68,25 +68,25 @@
#define BIBTEX_TYPES_FOR_HCITE_TYPES_KEY @"BibTeXTypesForHCiteTypes"
-@interface BDSKTypeManager (BDSKPrivate)
+@interface BDSKTypeManager ()
- (void)reloadFieldSets;
-- (void)setFieldsForTypesDict:(NSDictionary *)newFields;
-- (void)setTypes:(NSArray *)newTypes;
+@property (nonatomic, copy) NSDictionary *fieldsForTypesDict;
-- (void)setLocalFileFields:(NSSet *)set;
-- (void)setRemoteURLFields:(NSSet *)set;
-- (void)setAllURLFields:(NSSet *)set;
-- (void)setRatingFields:(NSSet *)set;
-- (void)setTriStateFields:(NSSet *)set;
-- (void)setBooleanFields:(NSSet *)set;
-- (void)setCitationFields:(NSSet *)set;
-- (void)setPersonFields:(NSSet *)set;
-- (void)setSingleValuedGroupFields:(NSSet *)set;
-- (void)setInvalidGroupFields:(NSSet *)set;
+@property (nonatomic, copy) NSArray *types;
-- (void)setAllFieldNames:(NSSet *)newNames;
+@property (nonatomic, copy) NSSet *localFileFieldsSet;
+@property (nonatomic, copy) NSSet *remoteURLFieldsSet;
+@property (nonatomic, copy) NSSet *allURLFieldsSet;
+@property (nonatomic, copy) NSSet *personFieldsSet;
+@property (nonatomic, copy) NSSet *booleanFieldsSet;
+@property (nonatomic, copy) NSSet *triStateFieldsSet;
+@property (nonatomic, copy) NSSet *ratingFieldsSet;
+@property (nonatomic, copy) NSSet *citationFieldsSet;
+@property (nonatomic, copy) NSSet *invalidGroupFieldsSet;
+@property (nonatomic, copy) NSSet *singleValuedGroupFieldsSet;
+@property (nonatomic, copy) NSSet *allFieldsSet;
@end
@@ -94,6 +94,8 @@
@implementation BDSKTypeManager
+@synthesize fieldsForTypesDict, types, defaultFieldsForTypes, defaultTypes,
localFileFieldsSet, remoteURLFieldsSet, allURLFieldsSet, noteFieldsSet,
numericFieldsSet, personFieldsSet, booleanFieldsSet, triStateFieldsSet,
ratingFieldsSet, citationFieldsSet, invalidGroupFieldsSet,
singleValuedGroupFieldsSet, allFieldsSet, requiredFieldsForCiteKey,
requiredFieldsForLocalFile, invalidFieldNameCharacterSet,
fragileCiteKeyCharacterSet;
+
static BDSKTypeManager *sharedManager = nil;
+ (BDSKTypeManager *)sharedManager{
@@ -118,7 +120,7 @@
fieldsForTypesDict = [[userTypeInfoDict
objectForKey:FIELDS_FOR_TYPES_KEY] copy];
types = [[[userTypeInfoDict objectForKey:TYPES_FOR_FILE_TYPE_KEY]
objectForKey:BDSKBibtexString] copy];
- defaultFieldsForTypesDict = [[typeInfoDict
objectForKey:FIELDS_FOR_TYPES_KEY] copy];
+ defaultFieldsForTypes = [[typeInfoDict
objectForKey:FIELDS_FOR_TYPES_KEY] copy];
defaultTypes = [[[typeInfoDict objectForKey:TYPES_FOR_FILE_TYPE_KEY]
objectForKey:BDSKBibtexString] copy];
standardTypes = [[NSSet alloc] initWithArray:[[typeInfoDict
objectForKey:STANDARD_TYPES_FOR_FILE_TYPE_KEY] objectForKey:BDSKBibtexString]];
fieldNameForPubMedTagDict = [[typeInfoDict
objectForKey:BIBTEX_FIELDS_FOR_PUBMED_TAGS_KEY] copy];
@@ -215,7 +217,7 @@
[allFields unionSet:citationFieldsSet];
[allFields unionSet:personFieldsSet];
- [self setAllFieldNames:allFields];
+ [self setAllFieldsSet:allFields];
}
@@ -245,18 +247,18 @@
[singleValuedFields unionSet:booleanFields];
[singleValuedFields unionSet:triStateFields];
- [self setLocalFileFields:localFileFields];
- [self setRemoteURLFields:remoteURLFields];
- [self setAllURLFields:allURLFields];
+ [self setLocalFileFieldsSet:localFileFields];
+ [self setRemoteURLFieldsSet:remoteURLFields];
+ [self setAllURLFieldsSet:allURLFields];
- [self setRatingFields:ratingFields];
- [self setTriStateFields:triStateFields];
- [self setBooleanFields:booleanFields];
- [self setCitationFields:citationFields];
- [self setPersonFields:personFields];
+ [self setRatingFieldsSet:ratingFields];
+ [self setTriStateFieldsSet:triStateFields];
+ [self setBooleanFieldsSet:booleanFields];
+ [self setCitationFieldsSet:citationFields];
+ [self setPersonFieldsSet:personFields];
- [self setInvalidGroupFields:invalidFields];
- [self setSingleValuedGroupFields:singleValuedFields];
+ [self setInvalidGroupFieldsSet:invalidFields];
+ [self setSingleValuedGroupFieldsSet:singleValuedFields];
[self reloadAllFieldNames];
}
@@ -293,113 +295,6 @@
[[NSNotificationCenter defaultCenter]
postNotificationName:BDSKCustomFieldsChangedNotification object:self];
}
-#pragma mark Setters
-
-- (void)setLocalFileFields:(NSSet *)set {
- if (localFileFieldsSet != set) {
- [localFileFieldsSet release];
- localFileFieldsSet = [set copy];
- }
-}
-
-- (void)setRemoteURLFields:(NSSet *)set {
- if (remoteURLFieldsSet != set) {
- [remoteURLFieldsSet release];
- remoteURLFieldsSet = [set copy];
- }
-}
-
-- (void)setAllURLFields:(NSSet *)set {
- if (allURLFieldsSet != set) {
- [allURLFieldsSet release];
- allURLFieldsSet = [set copy];
- }
-}
-
-- (void)setRatingFields:(NSSet *)set {
- if (ratingFieldsSet != set) {
- [ratingFieldsSet release];
- ratingFieldsSet = [set copy];
- }
-}
-
-- (void)setTriStateFields:(NSSet *)set {
- if (triStateFieldsSet != set) {
- [triStateFieldsSet release];
- triStateFieldsSet = [set copy];
- }
-}
-
-- (void)setBooleanFields:(NSSet *)set {
- if (booleanFieldsSet != set) {
- [booleanFieldsSet release];
- booleanFieldsSet = [set copy];
- }
-}
-
-- (void)setCitationFields:(NSSet *)set {
- if (citationFieldsSet != set) {
- [citationFieldsSet release];
- citationFieldsSet = [set copy];
- }
-}
-
-- (void)setPersonFields:(NSSet *)set {
- if (personFieldsSet != set) {
- [personFieldsSet release];
- personFieldsSet = [set copy];
- }
-}
-
-- (void)setSingleValuedGroupFields:(NSSet *)set {
- if (singleValuedGroupFieldsSet != set) {
- [singleValuedGroupFieldsSet release];
- singleValuedGroupFieldsSet = [set copy];
- }
-}
-
-- (void)setInvalidGroupFields:(NSSet *)set {
- if (invalidGroupFieldsSet != set) {
- [invalidGroupFieldsSet release];
- invalidGroupFieldsSet = [set copy];
- }
-}
-
-- (void)setAllFieldNames:(NSSet *)newNames{
- if (allFieldsSet != newNames) {
- [allFieldsSet release];
- allFieldsSet = [newNames copy];
- }
-}
-
-- (void)setFieldsForTypesDict:(NSDictionary *)newFields{
- if (fieldsForTypesDict != newFields) {
- [fieldsForTypesDict release];
- fieldsForTypesDict = [newFields copy];
- }
-}
-
-- (void)setTypes:(NSArray *)newTypes{
- if (types != newTypes) {
- [types release];
- types = [newTypes copy];
- }
-}
-
-- (void)setRequiredFieldsForCiteKey:(NSArray *)newFields{
- if (requiredFieldsForCiteKey != newFields) {
- [requiredFieldsForCiteKey release];
- requiredFieldsForCiteKey = [newFields copy];
- }
-}
-
-- (void)setRequiredFieldsForLocalFile:(NSArray *)newFields{
- if (requiredFieldsForLocalFile != newFields) {
- [requiredFieldsForLocalFile release];
- requiredFieldsForLocalFile = [newFields copy];
- }
-}
-
#pragma mark Getters
// BibTeX
@@ -416,18 +311,6 @@
return [[NSUserDefaults standardUserDefaults]
stringArrayForKey:BDSKDefaultFieldsKey];
}
-- (NSArray *)types{
- return types;
-}
-
-- (NSDictionary *)defaultFieldsForTypes{
- return defaultFieldsForTypesDict;
-}
-
-- (NSArray *)defaultTypes{
- return defaultTypes;
-}
-
- (BOOL)isStandardType:(NSString *)type{
return [standardTypes containsObject:type];
}
@@ -434,58 +317,6 @@
// Field types and sets
-- (NSSet *)localFileFieldsSet{
- return localFileFieldsSet;
-}
-
-- (NSSet *)remoteURLFieldsSet{
- return remoteURLFieldsSet;
-}
-
-- (NSSet *)allURLFieldsSet{
- return allURLFieldsSet;
-}
-
-- (NSSet *)booleanFieldsSet{
- return booleanFieldsSet;
-}
-
-- (NSSet *)triStateFieldsSet{
- return triStateFieldsSet;
-}
-
-- (NSSet *)ratingFieldsSet{
- return ratingFieldsSet;
-}
-
-- (NSSet *)citationFieldsSet{
- return citationFieldsSet;
-}
-
-- (NSSet *)personFieldsSet{
- return personFieldsSet;
-}
-
-- (NSSet *)noteFieldsSet{
- return noteFieldsSet;
-}
-
-- (NSSet *)numericFieldsSet{
- return numericFieldsSet;
-}
-
-- (NSSet *)invalidGroupFieldsSet{
- return invalidGroupFieldsSet;
-}
-
-- (NSSet *)singleValuedGroupFieldsSet{
- return singleValuedGroupFieldsSet;
-}
-
-- (NSSet *)allFieldsSet{
- return allFieldsSet;
-}
-
- (NSArray *)allFieldNamesIncluding:(NSArray *)include excluding:(NSArray
*)exclude{
NSMutableArray *fieldNames = [[[self allFieldsSet] allObjects]
mutableCopy];
if ([include count])
@@ -677,26 +508,10 @@
return characterSet;
}
-- (NSCharacterSet *)invalidFieldNameCharacterSet{
- return invalidCiteKeyCharSet;
-}
-
-- (NSCharacterSet *)fragileCiteKeyCharacterSet{
- return fragileCiteKeyCharSet;
-}
-
- (NSCharacterSet *)separatorCharacterSetForField:(NSString *)fieldName{
return [fieldName isCitationField] ? [NSCharacterSet commaCharacterSet]
: separatorCharSet;
}
-- (NSArray *)requiredFieldsForCiteKey{
- return requiredFieldsForCiteKey;
-}
-
-- (NSArray *)requiredFieldsForLocalFile{
- return requiredFieldsForLocalFile;
-}
-
@end
#pragma mark -
Modified: trunk/bibdesk/BDSKTypeSelectHelper.h
===================================================================
--- trunk/bibdesk/BDSKTypeSelectHelper.h 2019-07-15 13:43:32 UTC (rev
24025)
+++ trunk/bibdesk/BDSKTypeSelectHelper.h 2019-07-15 14:41:50 UTC (rev
24026)
@@ -70,15 +70,11 @@
BOOL processing;
}
-- (id<BDSKTypeSelectDelegate>)delegate;
-- (void)setDelegate:(id<BDSKTypeSelectDelegate>)anObject;
+@property (nonatomic, assign) id<BDSKTypeSelectDelegate> delegate;
-- (BOOL)cyclesSimilarResults;
-- (void)setCyclesSimilarResults:(BOOL)newValue;
+@property (nonatomic) BOOL cyclesSimilarResults;
+@property (nonatomic) BOOL matchesPrefix;
-- (BOOL)matchesPrefix;
-- (void)setMatchesPrefix:(BOOL)newValue;
-
- (void)rebuildTypeSelectSearchCache;
- (BOOL)handleEvent:(NSEvent *)keyEvent;
Modified: trunk/bibdesk/BDSKTypeSelectHelper.m
===================================================================
--- trunk/bibdesk/BDSKTypeSelectHelper.m 2019-07-15 13:43:32 UTC (rev
24025)
+++ trunk/bibdesk/BDSKTypeSelectHelper.m 2019-07-15 14:41:50 UTC (rev
24026)
@@ -67,6 +67,8 @@
@implementation BDSKTypeSelectHelper
+@synthesize delegate, cyclesSimilarResults=cycleResults,
matchesPrefix=matchPrefix;
+
// Init and dealloc
- init;
@@ -95,40 +97,14 @@
#pragma mark Accessors
-- (id)delegate;
-{
- return delegate;
-}
-
- (void)setDelegate:(id)newDelegate;
{
- if (delegate == newDelegate)
- return;
-
- delegate = newDelegate;
- [self rebuildTypeSelectSearchCache];
+ if (delegate != newDelegate) {
+ delegate = newDelegate;
+ [self rebuildTypeSelectSearchCache];
+ }
}
-- (BOOL)cyclesSimilarResults;
-{
- return cycleResults;
-}
-
-- (void)setCyclesSimilarResults:(BOOL)newValue;
-{
- cycleResults = newValue;
-}
-
-- (BOOL)matchesPrefix;
-{
- return matchPrefix;
-}
-
-- (void)setMatchesPrefix:(BOOL)newValue;
-{
- matchPrefix = newValue;
-}
-
#pragma mark API
- (void)rebuildTypeSelectSearchCache;
Modified: trunk/bibdesk/BDSKUndoManager.h
===================================================================
--- trunk/bibdesk/BDSKUndoManager.h 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKUndoManager.h 2019-07-15 14:41:50 UTC (rev 24026)
@@ -49,7 +49,6 @@
id<BDSKUndoManagerDelegate> delegate;
}
-- (id<BDSKUndoManagerDelegate>)delegate;
-- (void)setDelegate:(id<BDSKUndoManagerDelegate>)newDelegate;
+@property (nonatomic, assign) id<BDSKUndoManagerDelegate> delegate;
@end
Modified: trunk/bibdesk/BDSKUndoManager.m
===================================================================
--- trunk/bibdesk/BDSKUndoManager.m 2019-07-15 13:43:32 UTC (rev 24025)
+++ trunk/bibdesk/BDSKUndoManager.m 2019-07-15 14:41:50 UTC (rev 24026)
@@ -41,6 +41,8 @@
@implementation BDSKUndoManager
+@synthesize delegate;
+
- (id)init
{
self = [super init];
@@ -56,16 +58,6 @@
[super dealloc];
}
-- (id<BDSKUndoManagerDelegate>)delegate
-{
- return delegate;
-}
-
-- (void)setDelegate:(id<BDSKUndoManagerDelegate>)newDelegate
-{
- delegate = newDelegate;
-}
-
- (void)undo
{
if (delegate && [delegate
respondsToSelector:@selector(undoManagerShouldUndoChange:)] &&
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