Revision: 13980
http://sourceforge.net/p/skim-app/code/13980
Author: hofman
Date: 2023-12-24 18:01:19 +0000 (Sun, 24 Dec 2023)
Log Message:
-----------
remove convenience class factory methods for SKBookmark
Modified Paths:
--------------
trunk/NSDocument_SKExtensions.m
trunk/SKBookmark.h
trunk/SKBookmark.m
trunk/SKBookmarkController.m
Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m 2023-12-24 17:38:24 UTC (rev 13979)
+++ trunk/NSDocument_SKExtensions.m 2023-12-24 18:01:19 UTC (rev 13980)
@@ -145,19 +145,19 @@
{
PDFPage *page = [self currentPage];
NSUInteger pageIndex = page ? [page pageIndex] :
NSNotFound;
- bookmark = [SKBookmark bookmarkWithURL:[self fileURL]
pageIndex:pageIndex label:label];
+ bookmark = [[SKBookmark alloc] initWithURL:[self
fileURL] pageIndex:pageIndex label:label];
break;
}
case SKAddBookmarkTypeSetup:
{
NSDictionary *setup = [self currentDocumentSetup];
- bookmark = [SKBookmark bookmarkWithSetup:setup
label:label];
+ bookmark = [[SKBookmark alloc] initWithSetup:setup
label:label];
break;
}
case SKAddBookmarkTypeSession:
{
NSArray *setups = [[NSApp orderedDocuments]
valueForKey:@"currentDocumentSetup"];
- bookmark = [SKBookmark
bookmarkSessionWithSetups:setups label:label];
+ bookmark = [[SKBookmark alloc]
initSessionWithSetups:setups label:label];
break;
}
default:
Modified: trunk/SKBookmark.h
===================================================================
--- trunk/SKBookmark.h 2023-12-24 17:38:24 UTC (rev 13979)
+++ trunk/SKBookmark.h 2023-12-24 18:01:19 UTC (rev 13980)
@@ -52,18 +52,11 @@
__weak SKBookmark *parent;
}
-+ (nullable instancetype)bookmarkWithURL:(NSURL *)aURL
pageIndex:(NSUInteger)aPageIndex label:(NSString *)aLabel;
-+ (nullable instancetype)bookmarkWithSetup:(NSDictionary *)aSetupDict
label:(NSString *)aLabel;
-+ (nullable instancetype)bookmarkFolderWithLabel:(NSString *)aLabel;
-+ (nullable instancetype)bookmarkSessionWithSetups:(NSArray *)aSetupDicts
label:(NSString *)aLabel;
-+ (instancetype)bookmarkSeparator;
-
+ (NSArray *)bookmarksForURLs:(NSArray *)urls;
- (nullable instancetype)initWithURL:(NSURL *)aURL
pageIndex:(NSUInteger)aPageIndex label:(NSString *)aLabel;
- (nullable instancetype)initWithSetup:(NSDictionary *)aSetupDict
label:(NSString *)aLabel;
- (nullable instancetype)initFolderWithChildren:(nullable NSArray *)aChildren
label:(NSString *)aLabel;
-- (nullable instancetype)initFolderWithLabel:(NSString *)aLabel;
- (nullable instancetype)initRootWithChildrenProperties:(nullable NSArray
*)childrenProperties;
- (nullable instancetype)initSessionWithSetups:(NSArray *)aSetupDicts
label:(NSString *)aLabel;
- (nullable instancetype)initSeparator;
Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m 2023-12-24 17:38:24 UTC (rev 13979)
+++ trunk/SKBookmark.m 2023-12-24 18:01:19 UTC (rev 13980)
@@ -114,26 +114,6 @@
}
}
-+ (instancetype)bookmarkWithURL:(NSURL *)aURL pageIndex:(NSUInteger)aPageIndex
label:(NSString *)aLabel {
- return [[self alloc] initWithURL:aURL pageIndex:aPageIndex label:aLabel];
-}
-
-+ (instancetype)bookmarkWithSetup:(NSDictionary *)aSetupDict label:(NSString
*)aLabel {
- return [[self alloc] initWithSetup:aSetupDict label:aLabel];
-}
-
-+ (instancetype)bookmarkFolderWithLabel:(NSString *)aLabel {
- return [[self alloc] initFolderWithLabel:aLabel];
-}
-
-+ (instancetype)bookmarkSessionWithSetups:(NSArray *)aSetupDicts
label:(NSString *)aLabel {
- return [[self alloc] initSessionWithSetups:aSetupDicts label:aLabel];
-}
-
-+ (instancetype)bookmarkSeparator {
- return [[self alloc] initSeparator];
-}
-
+ (NSArray *)bookmarksForURLs:(NSArray *)urls {
NSFileManager *fm = [NSFileManager defaultManager];
NSDocumentController *dc = [NSDocumentController sharedDocumentController];
@@ -175,11 +155,6 @@
return nil;
}
-- (instancetype)initFolderWithLabel:(NSString *)aLabel {
- [self doesNotRecognizeSelector:_cmd];
- return nil;
-}
-
- (instancetype)initRootWithChildrenProperties:(NSArray *)childrenProperties {
[self doesNotRecognizeSelector:_cmd];
return nil;
@@ -351,10 +326,6 @@
return (id)[[SKFolderBookmark alloc] initFolderWithChildren:aChildren
label:aLabel];
}
-- (instancetype)initFolderWithLabel:(NSString *)aLabel {
- return [self initFolderWithChildren:nil label:aLabel];
-}
-
- (instancetype)initRootWithChildrenProperties:(NSArray *)childrenProperties {
NSMutableArray *aChildren = [NSMutableArray array];
SKBookmark *child;
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2023-12-24 17:38:24 UTC (rev 13979)
+++ trunk/SKBookmarkController.m 2023-12-24 18:01:19 UTC (rev 13980)
@@ -443,7 +443,7 @@
}
- (IBAction)insertBookmarkFolder:(id)sender {
- SKBookmark *folder = [SKBookmark
bookmarkFolderWithLabel:NSLocalizedString(@"Folder", @"default folder name")];
+ SKBookmark *folder = [[SKBookmark alloc] initFolderWithChildren:nil
label:NSLocalizedString(@"Folder", @"default folder name")];
NSUInteger idx = 0;
SKBookmark *item = [self insertionFolderAndChildIndex:&idx];
@@ -458,7 +458,7 @@
}
- (IBAction)insertBookmarkSeparator:(id)sender {
- SKBookmark *separator = [SKBookmark bookmarkSeparator];
+ SKBookmark *separator = [[SKBookmark alloc] initSeparator];
NSUInteger idx = 0;
SKBookmark *item = [self insertionFolderAndChildIndex:&idx];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit