Revision: 15677
http://sourceforge.net/p/skim-app/code/15677
Author: hofman
Date: 2025-10-02 14:47:52 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
Use self for convenience initializers and super for designated initializers
Modified Paths:
--------------
trunk/SKAnimatedBorderlessWindow.m
trunk/SKBookmarkController.m
trunk/SKColorPicker.m
trunk/SKDownloadController.m
trunk/SKImageToolTipWindow.m
trunk/SKInfoWindowController.m
trunk/SKLineInspector.m
trunk/SKNavigationWindow.m
trunk/SKNoteWindowController.m
trunk/SKPreferenceController.m
trunk/SKPresentationOptionsSheetController.m
trunk/SKSideWindow.m
trunk/SKViewSettingsController.m
Modified: trunk/SKAnimatedBorderlessWindow.m
===================================================================
--- trunk/SKAnimatedBorderlessWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKAnimatedBorderlessWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -53,7 +53,7 @@
@dynamic fadeInDuration, fadeOutDuration;
- (instancetype)initWithContentRect:(NSRect)contentRect {
- self = [super initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+ self = [self initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
defaultAlphaValue = ALPHA_VALUE;
autoHideTimeInterval = AUTO_HIDE_TIME_INTERVAL;
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKBookmarkController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -148,7 +148,7 @@
- (instancetype)init {
if (sharedBookmarkController == nil) {
- self = [super initWithWindowNibName:@"BookmarksWindow"];
+ self = [self initWithWindowNibName:@"BookmarksWindow"];
if (self) {
NSDictionary *bookmarkDictionary = [[NSUserDefaults
standardUserDefaults] persistentDomainForName:SKBookmarksIdentifier];
@@ -677,7 +677,7 @@
SKBookmark *bookmark = nil;
NSInteger tag = 0;
- if (supermenu == [NSApp mainMenu]) {
+ if (supermenu == [NSApp mainMenu]) {log_method();
bookmark = [self bookmarkRoot];
tag = SKBookmarkTagBookmarksMenu;
} else if (idx >= 0) {
Modified: trunk/SKColorPicker.m
===================================================================
--- trunk/SKColorPicker.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKColorPicker.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -50,8 +50,8 @@
@synthesize delegate;
@dynamic colors;
-- (instancetype)init {
- self = [super init];
+- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle
*)nibBundleOrNil {
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
scrubber = [[NSScrubber alloc] initWithFrame:NSMakeRect(0.0, 0.0, 180,
22.0)];
[scrubber setDelegate:self];
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKDownloadController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -107,7 +107,7 @@
}
- (instancetype)init {
- self = [super initWithWindowNibName:@"DownloadsWindow"];
+ self = [self initWithWindowNibName:@"DownloadsWindow"];
if (self) {
downloads = [[NSMutableArray alloc] init];
Modified: trunk/SKImageToolTipWindow.m
===================================================================
--- trunk/SKImageToolTipWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKImageToolTipWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -70,7 +70,7 @@
- (instancetype)init {
if (sharedToolTipWindow) NSLog(@"Attempt to allocate second instance of
%@", self);
- self = [super initWithContentRect:NSZeroRect];
+ self = [self initWithContentRect:NSZeroRect];
if (self) {
[self setHidesOnDeactivate:NO];
[self setIgnoresMouseEvents:YES];
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKInfoWindowController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -78,7 +78,7 @@
@synthesize summaryTableView, attributesTableView, tabView, info;
- (instancetype)init {
- self = [super initWithWindowNibName:@"InfoWindow"];
+ self = [self initWithWindowNibName:@"InfoWindow"];
if (self){
info = nil;
summaryKeys = [[NSArray alloc] initWithObjects:
Modified: trunk/SKLineInspector.m
===================================================================
--- trunk/SKLineInspector.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKLineInspector.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -82,7 +82,7 @@
- (instancetype)init {
if (sharedLineInspector) NSLog(@"Attempt to allocate second instance of
%@", [self class]);
- self = [super initWithWindowNibName:@"LineInspector"];
+ self = [self initWithWindowNibName:@"LineInspector"];
if (self) {
style = kPDFBorderStyleSolid;
lineWidth = 1.0;
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKNavigationWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -77,7 +77,7 @@
NSScreen *screen = [[presentationView window] screen] ?: [NSScreen
mainScreen];
CGFloat width = 5 * BUTTON_WIDTH + 3 * SEP_WIDTH + 2 * BUTTON_MARGIN;
NSRect contentRect = NSMakeRect(NSMidX([screen frame]) - 0.5 * width,
NSMinY([screen frame]) + WINDOW_OFFSET, width, BUTTON_HEIGHT + 2 *
BUTTON_MARGIN);
- self = [super initWithContentRect:contentRect];
+ self = [self initWithContentRect:contentRect];
if (self) {
[self setIgnoresMouseEvents:NO];
@@ -416,7 +416,7 @@
@synthesize view;
- (instancetype)init {
- self = [super initWithContentRect:NSZeroRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
+ self = [self initWithContentRect:NSZeroRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
if (self) {
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKNoteWindowController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -148,7 +148,7 @@
}
- (instancetype)initWithNote:(PDFAnnotation *)aNote {
- self = [super initWithWindowNibName:@"NoteWindow"];
+ self = [self initWithWindowNibName:@"NoteWindow"];
if (self) {
note = aNote;
Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKPreferenceController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -72,7 +72,7 @@
@synthesize resetButton, resetAllButton;
- (instancetype)init {
- self = [super initWithWindowNibName:@"PreferenceWindow"];
+ self = [self initWithWindowNibName:@"PreferenceWindow"];
if (self) {
preferencePanes = [[NSArray alloc] initWithObjects:
[[SKGeneralPreferences alloc] init],
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2025-10-02 14:43:53 UTC
(rev 15676)
+++ trunk/SKPresentationOptionsSheetController.m 2025-10-02 14:47:52 UTC
(rev 15677)
@@ -102,7 +102,7 @@
}
- (instancetype)initForController:(SKMainWindowController *)aController {
- self = [super init];
+ self = [self initWithWindowNibName:@"TransitionSheet"];
if (self) {
controller = aController;
@@ -272,10 +272,6 @@
name:SKDocumentControllerDidRemoveDocumentNotification object:nil];
}
-- (NSString *)windowNibName {
- return @"TransitionSheet";
-}
-
- (void)dismissSheet:(id)sender {
[[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil];
if ([sender tag] == NSModalResponseCancel) {
Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKSideWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -73,7 +73,7 @@
}
- (instancetype)initWithView:(NSView *)view {
- self = [super initWithContentRect:NSMakeRect(0.0, 0.0,
DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+ self = [self initWithContentRect:NSMakeRect(0.0, 0.0,
DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
Modified: trunk/SKViewSettingsController.m
===================================================================
--- trunk/SKViewSettingsController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKViewSettingsController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -60,7 +60,7 @@
}
- (instancetype)initWithSettings:(NSDictionary *)settings
defaultSettings:(NSDictionary *)aDefaultSettings {
- self = [super init];
+ self = [self initWithWindowNibName: @"ViewSettings"];
if (self) {
defaultSettings = [aDefaultSettings copy];
if (defaultSettings == nil || [settings count]) {
@@ -75,10 +75,6 @@
return self;
}
-- (NSString *)windowNibName {
- return @"ViewSettings";
-}
-
- (NSInteger)extendedDisplayMode {
NSInteger mode = [self displayMode];
if (mode == kPDFDisplaySinglePageContinuous && [self displayDirection] ==
1)
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