Revision: 15680
http://sourceforge.net/p/skim-app/code/15680
Author: hofman
Date: 2025-10-02 16:32:25 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
override designated initializer rather than convenience initializer
Modified Paths:
--------------
trunk/SKBookmarkController.m
trunk/SKDownloadController.m
trunk/SKInfoWindowController.m
trunk/SKLineInspector.m
trunk/SKPreferenceController.m
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKBookmarkController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -146,9 +146,9 @@
return sharedBookmarkController ?: [super allocWithZone:zone];
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
if (sharedBookmarkController == nil) {
- self = [self initWithWindowNibName:@"BookmarksWindow"];
+ self = [super initWithWindow:nil];
if (self) {
NSDictionary *bookmarkDictionary = [[NSUserDefaults
standardUserDefaults] persistentDomainForName:SKBookmarksIdentifier];
@@ -187,6 +187,10 @@
[self stopObservingBookmarks:@[bookmarkRoot]];
}
+- (NSString *)windowNibName {
+ return @"BookmarksWindow";
+}
+
- (void)windowDidLoad {
[self setupToolbar];
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKDownloadController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -106,8 +106,8 @@
SKDownloadsIdentifier = [[[NSBundle mainBundle] bundleIdentifier]
stringByAppendingString:@".downloads"];
}
-- (instancetype)init {
- self = [self initWithWindowNibName:@"DownloadsWindow"];
+- (instancetype)initWithWindow:(NSWindow *)window {
+ self = [super initWithWindow:nil];
if (self) {
downloads = [[NSMutableArray alloc] init];
@@ -132,6 +132,10 @@
[self endObservingDownloads:downloads];
}
+- (NSString *)windowNibName {
+ return @"DownloadsWindow";
+}
+
- (void)windowDidLoad {
[self setupToolbar];
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKInfoWindowController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -77,8 +77,8 @@
@synthesize summaryTableView, attributesTableView, tabView, info;
-- (instancetype)init {
- self = [self initWithWindowNibName:@"InfoWindow"];
+- (instancetype)initWithWindow:(NSWindow *)window {
+ self = [super initWithWindow:nil];
if (self){
info = nil;
summaryKeys = [[NSArray alloc] initWithObjects:
@@ -123,6 +123,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"InfoWindow";
+}
+
- (void)updateForDocument:(NSDocument *)doc {
[self setInfo:[[self class] infoForDocument:doc]];
[summaryTableView reloadData];
Modified: trunk/SKLineInspector.m
===================================================================
--- trunk/SKLineInspector.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKLineInspector.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -80,9 +80,9 @@
return sharedLineInspector != nil;
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
if (sharedLineInspector) NSLog(@"Attempt to allocate second instance of
%@", [self class]);
- self = [self initWithWindowNibName:@"LineInspector"];
+ self = [super initWithWindow:nil];
if (self) {
style = kPDFBorderStyleSolid;
lineWidth = 1.0;
@@ -94,6 +94,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"LineInspector";
+}
+
- (void)windowDidLoad {
[lineWell setCanActivate:NO];
[lineWell bind:SKLineWellLineWidthKey toObject:self
withKeyPath:LINEWIDTH_KEY options:nil];
Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKPreferenceController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -71,8 +71,8 @@
@synthesize resetButton, resetAllButton;
-- (instancetype)init {
- self = [self initWithWindowNibName:@"PreferenceWindow"];
+- (instancetype)initWithWindow:(NSWindow *)window {
+ self = [super initWithWindow:nil];
if (self) {
preferencePanes = [[NSArray alloc] initWithObjects:
[[SKGeneralPreferences alloc] init],
@@ -85,6 +85,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"PreferenceWindow";
+}
+
- (NSViewController<SKPreferencePane>
*)preferencePaneForItemIdentifier:(NSString *)itemIdent {
for (NSViewController<SKPreferencePane> *pane in preferencePanes)
if ([[pane nibName] isEqualToString:itemIdent])
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