Revision: 24023
          http://sourceforge.net/p/bibdesk/svn/24023
Author:   hofman
Date:     2019-07-14 17:10:37 +0000 (Sun, 14 Jul 2019)
Log Message:
-----------
use properties for author

Modified Paths:
--------------
    trunk/bibdesk/BibAuthor.h
    trunk/bibdesk/BibAuthor.m

Modified: trunk/bibdesk/BibAuthor.h
===================================================================
--- trunk/bibdesk/BibAuthor.h   2019-07-14 16:59:32 UTC (rev 24022)
+++ trunk/bibdesk/BibAuthor.h   2019-07-14 17:10:37 UTC (rev 24023)
@@ -93,42 +93,41 @@
 - (NSComparisonResult)sortCompare:(BibAuthor *)otherAuth;
 
 // The basic parts as interpreted by btparse
-- (NSString *)firstName;
-- (NSString *)vonPart;
-- (NSString *)lastName;
-- (NSString *)jrPart;
+@property (nonatomic, readonly) NSString *firstName;
+@property (nonatomic, readonly) NSString *vonPart;
+@property (nonatomic, readonly) NSString *lastName;
+@property (nonatomic, readonly) NSString *jrPart;
 
 // name used to create the BibAuthor instance
-- (NSString *)originalName;
+@property (nonatomic, readonly) NSString *originalName;
 
 // First von Last, Jr
-- (NSString *)name;
+@property (nonatomic, readonly) NSString *name;
 // von Last, Jr, First
-- (NSString *)normalizedName;
+@property (nonatomic, readonly) NSString *normalizedName;
 // According to user preferences
-- (NSString *)displayName;
+@property (nonatomic, readonly) NSString *displayName;
 // von Last, Jr
-- (NSString *)fullLastName;
+@property (nonatomic, readonly) NSString *fullLastName;
 // Last First
-- (NSString *)sortableName;
+@property (nonatomic, readonly) NSString *sortableName;
 // F. von Last, Jr
-- (NSString *)abbreviatedName;
+@property (nonatomic, readonly) NSString *abbreviatedName;
 // von Last, Jr, F.
-- (NSString *)abbreviatedNormalizedName;
+@property (nonatomic, readonly) NSString *abbreviatedNormalizedName;
 // von Last, Jr, F
-- (NSString *)unpunctuatedAbbreviatedNormalizedName;
+@property (nonatomic, readonly) NSString 
*unpunctuatedAbbreviatedNormalizedName;
 
-- (NSArray *)firstNames;
+@property (nonatomic, readonly) NSArray *firstNames;
 
 - (NSXMLElement *)MODSXMLElementWithRole:(NSString *)rel;
 
-- (BibItem *)publication;
-- (void)setPublication:(BibItem *)pub;
+@property (nonatomic, assign) BibItem *publication;
 
-- (NSString *)field;
+@property (nonatomic, readonly) NSString *field;
 
-- (NSData *)imageData;
-- (NSData *)vCardRepresentation;
+@property (nonatomic, readonly) NSData *imageData;
+@property (nonatomic, readonly) NSData *vCardRepresentation;
 
 @end
 

Modified: trunk/bibdesk/BibAuthor.m
===================================================================
--- trunk/bibdesk/BibAuthor.m   2019-07-14 16:59:32 UTC (rev 24022)
+++ trunk/bibdesk/BibAuthor.m   2019-07-14 17:10:37 UTC (rev 24023)
@@ -58,6 +58,10 @@
 
 @implementation BibAuthor
 
+@synthesize firstName, vonPart, lastName, jrPart, originalName, name, 
normalizedName, fullLastName, sortableName, firstNames, publication, field;
+
+@dynamic displayName, abbreviatedName, abbreviatedNormalizedName, 
unpunctuatedAbbreviatedNormalizedName, imageData, vCardRepresentation;
+
 + (void)initialize{
     
     BDSKINITIALIZE;
@@ -86,8 +90,6 @@
     
     return author;
 }
-    
-    
 
 + (id)emptyAuthor{
     BDSKASSERT(emptyAuthorInstance != nil);
@@ -180,11 +182,6 @@
 
 #pragma mark Comparison
 
-// returns an array of first names, assuming that words and initials are 
separated by whitespace or '.'
-- (NSArray *)firstNames{
-    return firstNames;
-}    
-
 //
 // Examples of the various cases we need to handle in comparing first names 
(for /fuzzy/ matching)
 //
@@ -286,42 +283,6 @@
 
 #pragma mark Component Accessors
 
-- (NSString *)normalizedName{
-       return normalizedName;
-}
-
-- (NSString *)fullLastName{
-    return fullLastName;
-}
-
-- (NSString *)sortableName{
-    return sortableName;
-}
-
-- (NSString *)originalName{
-    return originalName;
-}
-
-- (NSString *)name{
-    return name;
-}
-
-- (NSString *)firstName{
-    return firstName;
-}
-
-- (NSString *)vonPart{
-    return vonPart;
-}
-
-- (NSString *)lastName{
-    return lastName;
-}
-
-- (NSString *)jrPart{
-    return jrPart;
-}
-
 // Given a normalized name of "von Last, Jr, First Middle", this will return 
"F. M. von Last, Jr"
 - (NSString *)abbreviatedName{
     if(abbreviatedName == nil)
@@ -380,18 +341,6 @@
     return element;
 }
 
-- (BibItem *)publication{
-    return publication;
-}
-
-- (void)setPublication:(BibItem *)pub {
-    publication = pub;
-}
-
-- (NSString *)field{
-    return field;
-}
-
 - (ABPerson *)personFromAddressBook{
     ABSearchElement *lastNameSearch = [ABPerson 
searchElementForProperty:kABLastNameProperty label:nil key:nil value:lastName 
comparison:kABEqualCaseInsensitive];
     ABSearchElement *firstNameSearch = [ABPerson 
searchElementForProperty:kABFirstNameProperty label:nil key:nil 
value:([firstNames count] ? [firstNames objectAtIndex:0] : @"") 
comparison:kABPrefixMatch];

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