Revision: 29671
          http://sourceforge.net/p/bibdesk/svn/29671
Author:   hofman
Date:     2025-10-05 15:41:28 +0000 (Sun, 05 Oct 2025)
Log Message:
-----------
better group initializers

Modified Paths:
--------------
    trunk/bibdesk/BDSKExternalGroup.h
    trunk/bibdesk/BDSKScriptGroup.h
    trunk/bibdesk/BDSKSharedGroup.m
    trunk/bibdesk/BDSKURLGroup.h
    trunk/bibdesk/BDSKURLGroup.m
    trunk/bibdesk/BDSKWebGroup.h
    trunk/bibdesk/BDSKWebGroup.m
    trunk/bibdesk/BibDocument.m

Modified: trunk/bibdesk/BDSKExternalGroup.h
===================================================================
--- trunk/bibdesk/BDSKExternalGroup.h   2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BDSKExternalGroup.h   2025-10-05 15:41:28 UTC (rev 29671)
@@ -51,9 +51,6 @@
     BDSKMacroResolver *macroResolver;
 }
 
-- (instancetype)initWithName:(id)aName NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
-
 - (void)refresh;
 
 - (void)wantsPublicationsImmediately:(BOOL)immediate;

Modified: trunk/bibdesk/BDSKScriptGroup.h
===================================================================
--- trunk/bibdesk/BDSKScriptGroup.h     2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BDSKScriptGroup.h     2025-10-05 15:41:28 UTC (rev 29671)
@@ -61,7 +61,7 @@
 }
 
 - (instancetype)initWithScriptPath:(NSString *)path scriptArguments:(nullable 
NSString *)arguments;
-- (instancetype)initWithName:(nullable NSString *)aName scriptPath:(nullable 
NSString *)path scriptArguments:(nullable NSString *)arguments 
scriptType:(BDSKScriptType)type NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithName:(nullable NSString *)aName scriptPath:(NSString 
*)path scriptArguments:(nullable NSString *)arguments 
scriptType:(BDSKScriptType)type NS_DESIGNATED_INITIALIZER;
 - (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 - (instancetype)initWithName:(id)aName NS_UNAVAILABLE;
 

Modified: trunk/bibdesk/BDSKSharedGroup.m
===================================================================
--- trunk/bibdesk/BDSKSharedGroup.m     2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BDSKSharedGroup.m     2025-10-05 15:41:28 UTC (rev 29671)
@@ -124,11 +124,6 @@
     return self;
 }
 
-- (instancetype)initWithCoder:(NSCoder *)decoder {
-    self = nil;
-    return self;
-}
-
 - (id)copyWithZone:(NSZone *)aZone {
        return [(BDSKSharedGroup *)[[self class] alloc] initWithClient:client];
 }

Modified: trunk/bibdesk/BDSKURLGroup.h
===================================================================
--- trunk/bibdesk/BDSKURLGroup.h        2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BDSKURLGroup.h        2025-10-05 15:41:28 UTC (rev 29671)
@@ -54,7 +54,7 @@
 - (instancetype)initWithName:(nullable NSString *)aName URL:(NSURL *)aURL 
NS_DESIGNATED_INITIALIZER;
 - (instancetype)initWithURL:(NSURL *)aURL;
 - (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithName:(nullable NSString *)aName NS_UNAVAILABLE;
+- (instancetype)initWithName:(NSString *)aName NS_UNAVAILABLE;
 
 @property (nonatomic, strong) NSURL *URL;
 

Modified: trunk/bibdesk/BDSKURLGroup.m
===================================================================
--- trunk/bibdesk/BDSKURLGroup.m        2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BDSKURLGroup.m        2025-10-05 15:41:28 UTC (rev 29671)
@@ -74,10 +74,7 @@
 - (instancetype)initWithName:(NSString *)aName URL:(NSURL *)aURL;
 {
     NSParameterAssert(aURL != nil);
-    if (aName == nil)
-        aName = [aURL lastPathComponent];
-    if(self = [super initWithName:aName]){
-        
+    if(self = [super initWithName:aName ?: [aURL lastPathComponent]]){
         URL = [aURL copy];
         isRetrieving = NO;
         failedDownload = NO;

Modified: trunk/bibdesk/BDSKWebGroup.h
===================================================================
--- trunk/bibdesk/BDSKWebGroup.h        2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BDSKWebGroup.h        2025-10-05 15:41:28 UTC (rev 29671)
@@ -49,10 +49,6 @@
     NSMapTable *frameInfo;
 }
 
-- (instancetype)init NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithName:(id)aName NS_UNAVAILABLE;
-
 @property (nonatomic, nullable, strong) NSString *label;
 
 @property (nonatomic, nullable, strong) NSURL *URL;

Modified: trunk/bibdesk/BDSKWebGroup.m
===================================================================
--- trunk/bibdesk/BDSKWebGroup.m        2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BDSKWebGroup.m        2025-10-05 15:41:28 UTC (rev 29671)
@@ -87,15 +87,9 @@
 }
 
 - (instancetype)init {
-       self = [super initWithName:BDSKWebLocalizedString];
-    return self;
+       return [self initWithName:BDSKWebLocalizedString];
 }
 
-- (instancetype)initWithCoder:(NSCoder *)decoder {
-    self = [super initWithCoder:decoder];
-    return self;
-}
-
 - (void)dealloc {
     // should always be on the main thread, see BibDocument, but be sure
     BDSKENSURE_MAIN_THREAD(

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2025-10-05 15:01:53 UTC (rev 29670)
+++ trunk/bibdesk/BibDocument.m 2025-10-05 15:41:28 UTC (rev 29671)
@@ -2143,7 +2143,7 @@
         [pub markNewWithDate:importDate description:importDateDescription];
     
     if ((options & BDSKImportSelectLibrary))
-        [self selectLibraryGroup:nil];    
+        [self selectLibraryGroup:nil];     
        [self addPublications:newPubs];
     if ([self hasGroupTypeSelected:BDSKLibraryGroupType])
         [self selectPublications:newPubs];

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