Revision: 5674
http://skim-app.svn.sourceforge.net/skim-app/?rev=5674&view=rev
Author: hofman
Date: 2009-09-04 17:09:14 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
don't enforce singleton status for methods that are always called in code using
the class factory methods
Modified Paths:
--------------
trunk/SKBookmarkController.m
trunk/SKDownloadController.m
trunk/SKFindController.m
trunk/SKInfoWindowController.m
trunk/SKLineInspector.m
trunk/SKNavigationWindow.m
trunk/SKNotesPanelController.m
trunk/SKPDFToolTipWindow.m
trunk/SKPreferenceController.m
trunk/SKReleaseNotesController.m
trunk/SKRemoteStateWindow.m
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKBookmarkController.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -103,20 +103,15 @@
maxRecentDocumentsCount = 50;
}
-static SKBookmarkController *sharedBookmarkController = nil;
-
+ (id)sharedBookmarkController {
+ static SKBookmarkController *sharedBookmarkController = nil;
if (sharedBookmarkController == nil)
- [[[self alloc] init] release];
+ sharedBookmarkController = [[self alloc] init];
return sharedBookmarkController;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedBookmarkController retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedBookmarkController == nil && (self = [super
initWithWindowNibName:@"BookmarksWindow"])) {
+ if (self = [super initWithWindowNibName:@"BookmarksWindow"]) {
recentDocuments = [[NSMutableArray alloc] init];
NSMutableArray *bookmarks = [NSMutableArray array];
@@ -153,8 +148,6 @@
selector:@selector(handleApplicationWillTerminateNotification:)
name:NSApplicationWillTerminateNotification
object:NSApp];
-
- sharedBookmarkController = [self retain];
}
return self;
}
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKDownloadController.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -66,22 +66,16 @@
@implementation SKDownloadController
-static SKDownloadController *sharedDownloadController = nil;
-
+ (id)sharedDownloadController {
+ static SKDownloadController *sharedDownloadController = nil;
if (sharedDownloadController == nil)
- [[[self alloc] init] release];
+ sharedDownloadController = [[self alloc] init];
return sharedDownloadController;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedDownloadController retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedDownloadController == nil && (self = [super
initWithWindowNibName:@"DownloadsWindow"])) {
+ if (self = [super initWithWindowNibName:@"DownloadsWindow"]) {
downloads = [[NSMutableArray alloc] init];
- sharedDownloadController = [self retain];
}
return self;
}
Modified: trunk/SKFindController.m
===================================================================
--- trunk/SKFindController.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKFindController.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -43,22 +43,16 @@
@implementation SKFindController
-static SKFindController *sharedFindController = nil;
-
+ (id)sharedFindController {
+ static SKFindController *sharedFindController = nil;
if (sharedFindController == nil)
- [[[self alloc] init] release];
+ sharedFindController = [[self alloc] init];
return sharedFindController;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedFindController retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedFindController == nil && (self = [super
initWithWindowNibName:@"FindPanel"])) {
+ if (self = [super initWithWindowNibName:@"FindPanel"]) {
ignoreCase = YES;
- sharedFindController = [self retain];
}
return self;
}
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKInfoWindowController.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -61,8 +61,6 @@
@implementation SKInfoWindowController
-static SKInfoWindowController *sharedInstance = nil;
-
+ (void)initialize {
SKINITIALIZE;
@@ -72,19 +70,15 @@
}
+ (id)sharedInstance {
+ static SKInfoWindowController *sharedInstance = nil;
if (sharedInstance == nil)
- [[[self alloc] init] release];
+ sharedInstance = [[self alloc] init];
return sharedInstance;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedInstance retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedInstance == nil && (self = [super
initWithWindowNibName:@"InfoWindow"])) {
+ if (self = [super initWithWindowNibName:@"InfoWindow"]){
info = nil;
- sharedInstance = [self retain];
}
return self;
}
Modified: trunk/SKLineInspector.m
===================================================================
--- trunk/SKLineInspector.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKLineInspector.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -59,7 +59,7 @@
+ (id)sharedLineInspector {
if (sharedLineInspector == nil)
- [[[self alloc] init] release];
+ sharedLineInspector = [[self alloc] init];
return sharedLineInspector;
}
@@ -67,19 +67,14 @@
return sharedLineInspector != nil;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedLineInspector retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedLineInspector == nil && (self = [super
initWithWindowNibName:@"LineInspector"])) {
+ if (self = [super initWithWindowNibName:@"LineInspector"]) {
style = kPDFBorderStyleSolid;
lineWidth = 1.0;
dashPattern = nil;
startLineStyle = kPDFLineStyleNone;
endLineStyle = kPDFLineStyleNone;
currentLineChangeAction = SKNoLineChangeAction;
- sharedLineInspector = [self retain];
}
return self;
}
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKNavigationWindow.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -193,20 +193,15 @@
@implementation SKNavigationToolTipWindow
-static SKNavigationToolTipWindow *sharedToolTipWindow = nil;
-
+ (id)sharedToolTipWindow {
+ static SKNavigationToolTipWindow *sharedToolTipWindow = nil;
if (sharedToolTipWindow == nil)
- [[[self alloc] init] retain];
+ sharedToolTipWindow = [[self alloc] init];
return sharedToolTipWindow;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedToolTipWindow retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedToolTipWindow == nil && (self = [super
initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered defer:YES screen:[NSScreen mainScreen]])) {
+ if (self = [super initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES
screen:[NSScreen mainScreen]]) {
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
[self setDisplaysWhenScreenProfileChanges:YES];
@@ -214,8 +209,6 @@
toolTipView = [[[SKNavigationToolTipView alloc] init] autorelease];
[[self contentView] addSubview:toolTipView];
-
- sharedToolTipWindow = [self retain];
}
return self;
}
Modified: trunk/SKNotesPanelController.m
===================================================================
--- trunk/SKNotesPanelController.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKNotesPanelController.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -47,7 +47,7 @@
+ (id)sharedController {
if (sharedController == nil)
- [[[self alloc] init] release];
+ sharedController = [[self alloc] init];
return sharedController;
}
@@ -55,15 +55,8 @@
return sharedController != nil;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedController retain] ?: [super allocWithZone:[self zone]];
-}
-
- (id)init {
- if (sharedController == nil && (self = [super
initWithWindowNibName:@"NotesPanel"])) {
- sharedController = [self retain];
- }
- return self;
+ return (self = [super initWithWindowNibName:@"NotesPanel"]);
}
- (void)windowDidLoad {
Modified: trunk/SKPDFToolTipWindow.m
===================================================================
--- trunk/SKPDFToolTipWindow.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKPDFToolTipWindow.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -65,20 +65,15 @@
@implementation SKPDFToolTipWindow
-static SKPDFToolTipWindow *sharedToolTipWindow = nil;
-
+ (id)sharedToolTipWindow {
+ static SKPDFToolTipWindow *sharedToolTipWindow = nil;
if (sharedToolTipWindow == nil)
- [[[self alloc] init] release];
+ sharedToolTipWindow = [[self alloc] init];
return sharedToolTipWindow;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedToolTipWindow retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedToolTipWindow == nil && (self = [super
initWithContentRect:NSZeroRect])) {
+ if (self = [super initWithContentRect:NSZeroRect]) {
[self setHidesOnDeactivate:NO];
[self setIgnoresMouseEvents:YES];
[self setOpaque:YES];
@@ -102,8 +97,6 @@
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleApplicationWillResignActiveNotification:)
name:NSApplicationWillResignActiveNotification object:NSApp];
-
- sharedToolTipWindow = [self retain];
}
return self;
}
Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKPreferenceController.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -65,20 +65,15 @@
@implementation SKPreferenceController
-static SKPreferenceController *sharedPrefenceController = nil;
-
+ (id)sharedPrefenceController {
+ static SKPreferenceController *sharedPrefenceController = nil;
if (sharedPrefenceController == nil)
- [[[self alloc] init] release];
+ sharedPrefenceController = [[self alloc] init];
return sharedPrefenceController;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedPrefenceController retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedPrefenceController == nil && (self = [super
initWithWindowNibName:@"PreferenceWindow"])) {
+ if (self = [super initWithWindowNibName:@"PreferenceWindow"]) {
NSString *initialUserDefaultsPath = [[NSBundle mainBundle]
pathForResource:INITIALUSERDEFAULTS_KEY ofType:@"plist"];
resettableKeys = [[[NSDictionary
dictionaryWithContentsOfFile:initialUserDefaultsPath]
valueForKey:RESETTABLEKEYS_KEY] retain];
@@ -87,8 +82,6 @@
[sudc addObserver:self forKeys:[NSArray
arrayWithObjects:SKDefaultPDFDisplaySettingsKey,
SKDefaultFullScreenPDFDisplaySettingsKey, nil]
context:&SKPreferenceWindowDefaultsObservationContext];
[[SUUpdater sharedUpdater] addObserver:self
forKeyPath:@"automaticallyChecksForUpdates" options:0
context:&SKPreferenceWindowUpdaterObservationContext];
[[SUUpdater sharedUpdater] addObserver:self
forKeyPath:@"updateCheckInterval" options:0
context:&SKPreferenceWindowUpdaterObservationContext];
-
- sharedPrefenceController = [self retain];
}
return self;
}
Modified: trunk/SKReleaseNotesController.m
===================================================================
--- trunk/SKReleaseNotesController.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKReleaseNotesController.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -41,23 +41,15 @@
@implementation SKReleaseNotesController
-static SKReleaseNotesController *sharedReleaseNotesController = nil;
-
+ (id)sharedReleaseNotesController {
+ static SKReleaseNotesController *sharedReleaseNotesController = nil;
if (sharedReleaseNotesController == nil)
- [[[self alloc] init] release];
+ sharedReleaseNotesController = [[self alloc] init];
return sharedReleaseNotesController;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedReleaseNotesController retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedReleaseNotesController == nil) {
- sharedReleaseNotesController = [[super
initWithWindowNibName:@"ReleaseNotes"] retain];
- }
- return self;
+ return (self = [super initWithWindowNibName:@"ReleaseNotes"]);
}
- (void)windowDidLoad {
Modified: trunk/SKRemoteStateWindow.m
===================================================================
--- trunk/SKRemoteStateWindow.m 2009-09-04 16:57:09 UTC (rev 5673)
+++ trunk/SKRemoteStateWindow.m 2009-09-04 17:09:14 UTC (rev 5674)
@@ -54,28 +54,20 @@
@implementation SKRemoteStateWindow
-static id sharedRemoteStateWindow = nil;
-
+ (id)sharedRemoteStateWindow {
+ static id sharedRemoteStateWindow = nil;
if (sharedRemoteStateWindow == nil)
- [[[self alloc] init] release];
+ sharedRemoteStateWindow = [[self alloc] init];
return sharedRemoteStateWindow;
}
-+ (id)allocWithZone:(NSZone *)zone {
- return [sharedRemoteStateWindow retain] ?: [super allocWithZone:zone];
-}
-
- (id)init {
- if (sharedRemoteStateWindow == nil) {
- NSRect contentRect = SKRectFromCenterAndSize(NSZeroPoint,
SKMakeSquareSize(WINDOW_SIZE));
- if (self = [super initWithContentRect:contentRect]) {
- [self setIgnoresMouseEvents:YES];
- [self setDisplaysWhenScreenProfileChanges:NO];
- [self setLevel:NSStatusWindowLevel];
- [self setContentView:[[[SKRemoteStateView alloc] init]
autorelease]];
- sharedRemoteStateWindow = [self retain];
- }
+ NSRect contentRect = SKRectFromCenterAndSize(NSZeroPoint,
SKMakeSquareSize(WINDOW_SIZE));
+ if (self = [super initWithContentRect:contentRect]) {
+ [self setIgnoresMouseEvents:YES];
+ [self setDisplaysWhenScreenProfileChanges:NO];
+ [self setLevel:NSStatusWindowLevel];
+ [self setContentView:[[[SKRemoteStateView alloc] init] autorelease]];
}
return self;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit