Revision: 13992
http://sourceforge.net/p/skim-app/code/13992
Author: hofman
Date: 2023-12-26 09:26:00 +0000 (Tue, 26 Dec 2023)
Log Message:
-----------
make thumbnails an immutable array, we never need to modify it
Modified Paths:
--------------
trunk/SKMainWindowController.h
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h 2023-12-26 00:10:05 UTC (rev 13991)
+++ trunk/SKMainWindowController.h 2023-12-26 09:26:00 UTC (rev 13992)
@@ -100,7 +100,7 @@
SKFieldEditor *fieldEditor;
- NSMutableArray<SKThumbnail *> *thumbnails;
+ NSArray<SKThumbnail *> *thumbnails;
CGFloat roundedThumbnailSize;
NSMutableArray<PDFSelection *> *searchResults;
@@ -243,7 +243,7 @@
- (void)removeObjectFromNotesAtIndex:(NSUInteger)theIndex;
- (void)removeAllObjectsFromNotes;
-@property (nonatomic, nullable, copy) NSArray<SKThumbnail *> *thumbnails;
+@property (nonatomic, copy) NSArray<SKThumbnail *> *thumbnails;
@property (nonatomic, readonly) NSArray<SKSnapshotWindowController *>
*snapshots;
- (void)insertObject:(SKSnapshotWindowController *)snapshot
inSnapshotsAtIndex:(NSUInteger)theIndex;
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2023-12-26 00:10:05 UTC (rev 13991)
+++ trunk/SKMainWindowController.m 2023-12-26 09:26:00 UTC (rev 13992)
@@ -239,7 +239,7 @@
mwcFlags.wholeWordSearch = [sud boolForKey:SKWholeWordSearchKey];
mwcFlags.caseInsensitiveFilter = [sud
boolForKey:SKCaseInsensitiveFilterKey];
groupedSearchResults = nil;
- thumbnails = [[NSMutableArray alloc] init];
+ thumbnails = [[NSArray alloc] init];
notes = [[NSMutableArray alloc] init];
tags = [[NSArray alloc] init];
rating = 0.0;
@@ -1072,7 +1072,7 @@
[self setSearchResults:nil];
[self setGroupedSearchResults:nil];
[self removeAllObjectsFromNotes];
- [self setThumbnails:nil];
+ [self setThumbnails:@[]];
[self clearWidgets];
// remember snapshots and close them, without animation
@@ -1345,7 +1345,7 @@
- (void)setThumbnails:(NSArray *)newThumbnails {
[thumbnails setValue:nil forKey:@"delegate"];
- [thumbnails setArray:newThumbnails];
+ thumbnails = [newThumbnails copy];
[thumbnails setValue:self forKey:@"delegate"];
}
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