Minor code cleanup. Replaced deprecated method.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21317 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-06-17 04:41:24 +00:00
parent 7f8251ed59
commit 5ab6e00e3e
9 changed files with 57 additions and 46 deletions

View file

@ -1,3 +1,14 @@
2005-06-17 00:47 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormClassManager.m
* GormCore/GormDocument.m
* GormCore/GormInspectorsManager.m
* GormCore/GormObjectEditor.m
* GormCore/GormObjectInspector.m
* GormCore/GormPalettesManager.m
* GormCore/GormResourceEditor.m
* GormCore/GormWindowEditor.m: Code cleanup.
2005-06-17 00:24 Gregory John Casamento <greg_casamento@yahoo.com> 2005-06-17 00:24 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: Code cleanup. * Gorm.m: Code cleanup.

View file

@ -729,7 +729,7 @@
{ {
if (actions == nil) if (actions == nil)
{ {
allActions = [NSMutableArray new]; allActions = [[NSMutableArray alloc] init];
} }
else else
{ {
@ -850,7 +850,7 @@
{ {
if (outlets == nil) if (outlets == nil)
{ {
allOutlets = [NSMutableArray new]; allOutlets = [[NSMutableArray alloc] init];
} }
else else
{ {
@ -1181,7 +1181,7 @@
// get the info... // get the info...
classInfo = [classInformation objectForKey: key]; classInfo = [classInformation objectForKey: key];
newInfo = [NSMutableDictionary new]; newInfo = [[NSMutableDictionary alloc] init];
[ci setObject: newInfo forKey: key]; [ci setObject: newInfo forKey: key];
// superclass... // superclass...
@ -1234,7 +1234,7 @@
// get the info... // get the info...
classInfo = [classInformation objectForKey: key]; classInfo = [classInformation objectForKey: key];
newInfo = [NSMutableDictionary new]; newInfo = [[NSMutableDictionary alloc] init];
[ci setObject: newInfo forKey: key]; [ci setObject: newInfo forKey: key];
// superclass... // superclass...
@ -1294,7 +1294,7 @@
NSMutableDictionary *oldInfo; NSMutableDictionary *oldInfo;
id obj; id obj;
newInfo = [NSMutableDictionary new]; newInfo = [[NSMutableDictionary alloc] init];
oldInfo = [classInformation objectForKey: key]; oldInfo = [classInformation objectForKey: key];
[classInformation setObject: newInfo forKey: key]; [classInformation setObject: newInfo forKey: key];

View file

@ -217,7 +217,7 @@ static NSImage *fileImage = nil;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
// initialize... // initialize...
openEditors = [NSMutableArray new]; openEditors = [[NSMutableArray alloc] init];
classManager = [(GormClassManager *)[GormClassManager alloc] initWithDocument: self]; classManager = [(GormClassManager *)[GormClassManager alloc] initWithDocument: self];
/* /*
@ -228,7 +228,7 @@ static NSImage *fileImage = nil;
NSObjectMapValueCallBacks, 128, [self zone]); NSObjectMapValueCallBacks, 128, [self zone]);
// for saving the editors when the gorm file is persisted. // for saving the editors when the gorm file is persisted.
savedEditors = [NSMutableArray new]; savedEditors = [[NSMutableArray alloc] init];
[window setMinSize: [window frame].size]; [window setMinSize: [window frame].size];
[window setTitle: _(@"UNTITLED")]; [window setTitle: _(@"UNTITLED")];
@ -353,10 +353,10 @@ static NSImage *fileImage = nil;
/* /*
* Set up special-case dummy objects and add them to the objects view. * Set up special-case dummy objects and add them to the objects view.
*/ */
filesOwner = [GormFilesOwner new]; filesOwner = [[GormFilesOwner alloc] init];
[self setName: @"NSOwner" forObject: filesOwner]; [self setName: @"NSOwner" forObject: filesOwner];
[objectsView addObject: filesOwner]; [objectsView addObject: filesOwner];
firstResponder = [GormFirstResponder new]; firstResponder = [[GormFirstResponder alloc] init];
[self setName: @"NSFirst" forObject: firstResponder]; [self setName: @"NSFirst" forObject: firstResponder];
[objectsView addObject: firstResponder]; [objectsView addObject: firstResponder];
@ -364,7 +364,7 @@ static NSImage *fileImage = nil;
* Set image for this miniwindow. * Set image for this miniwindow.
*/ */
[window setMiniwindowImage: [(id)filesOwner imageForViewer]]; [window setMiniwindowImage: [(id)filesOwner imageForViewer]];
hidden = [NSMutableArray new]; hidden = [[NSMutableArray alloc] init];
// retain the file prefs view... // retain the file prefs view...
RETAIN(filePrefsView); RETAIN(filePrefsView);
@ -502,7 +502,7 @@ static NSImage *fileImage = nil;
} }
else else
{ {
NSNibConnector *con = [NSNibConnector new]; NSNibConnector *con = [[NSNibConnector alloc] init];
[con setSource: anObject]; [con setSource: anObject];
[con setDestination: aParent]; [con setDestination: aParent];
@ -644,7 +644,7 @@ static NSImage *fileImage = nil;
{ {
NSString *label = NSStringFromSelector(sel); NSString *label = NSStringFromSelector(sel);
id source = anObject; id source = anObject;
NSNibControlConnector *con = [NSNibControlConnector new]; NSNibControlConnector *con = [[NSNibControlConnector alloc] init];
id destination = [(NSControl *)anObject target]; id destination = [(NSControl *)anObject target];
NSArray *sourceConnections = [self connectorsForSource: source]; NSArray *sourceConnections = [self connectorsForSource: source];
@ -984,7 +984,7 @@ static NSImage *fileImage = nil;
* Remove all editors from the selected objects before archiving * Remove all editors from the selected objects before archiving
* and restore them afterwards. * and restore them afterwards.
*/ */
editorSet = [NSMutableSet new]; editorSet = [[NSMutableSet alloc] init];
enumerator = [anArray objectEnumerator]; enumerator = [anArray objectEnumerator];
while ((obj = [enumerator nextObject]) != nil) while ((obj = [enumerator nextObject]) != nil)
{ {
@ -1405,7 +1405,7 @@ static NSImage *fileImage = nil;
id<IBConnectors> link; id<IBConnectors> link;
editor = [[eClass alloc] initWithObject: anObject inDocument: self]; editor = [[eClass alloc] initWithObject: anObject inDocument: self];
link = AUTORELEASE([GormObjectToEditor new]); link = AUTORELEASE([[GormObjectToEditor alloc] init]);
[link setSource: anObject]; [link setSource: anObject];
[link setDestination: editor]; [link setDestination: editor];
[connections addObject: link]; [connections addObject: link];
@ -1428,7 +1428,7 @@ static NSImage *fileImage = nil;
/* /*
* Link to the parent of the editor. * Link to the parent of the editor.
*/ */
link = AUTORELEASE([GormEditorToParent new]); link = AUTORELEASE([[GormEditorToParent alloc] init]);
[link setSource: editor]; [link setSource: editor];
[link setDestination: anEditor]; [link setDestination: anEditor];
[connections addObject: link]; [connections addObject: link];
@ -2792,7 +2792,7 @@ static NSImage *fileImage = nil;
{ {
if (a == nil) if (a == nil)
{ {
a = [NSMutableArray new]; a = [[NSMutableArray alloc] init];
[nameTable setObject: a forKey: @"NSVisible"]; [nameTable setObject: a forKey: @"NSVisible"];
RELEASE(a); RELEASE(a);
} }
@ -2826,7 +2826,7 @@ static NSImage *fileImage = nil;
{ {
if (a == nil) if (a == nil)
{ {
a = [NSMutableArray new]; a = [[NSMutableArray alloc] init];
[nameTable setObject: a forKey: @"NSDeferred"]; [nameTable setObject: a forKey: @"NSDeferred"];
RELEASE(a); RELEASE(a);
} }
@ -2903,7 +2903,7 @@ static NSImage *fileImage = nil;
*/ */
- (id) revertDocument: (id)sender - (id) revertDocument: (id)sender
{ {
GormDocument *reverted = AUTORELEASE([GormDocument new]); GormDocument *reverted = AUTORELEASE([[GormDocument alloc] init]);
if ([reverted loadDocument: documentPath] != nil) if ([reverted loadDocument: documentPath] != nil)
{ {

View file

@ -210,7 +210,7 @@
NSRect inspectorRect = {{0, 0}, {IVW, IVH}}; NSRect inspectorRect = {{0, 0}, {IVW, IVH}};
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask; unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
cache = [NSMutableDictionary new]; cache = [[NSMutableDictionary alloc] init];
panel = [[NSPanel alloc] initWithContentRect: contentRect panel = [[NSPanel alloc] initWithContentRect: contentRect
styleMask: style styleMask: style
backing: NSBackingStoreRetained backing: NSBackingStoreRetained
@ -294,10 +294,10 @@
current = -1; current = -1;
inspector = [GormEmptyInspector new]; inspector = [[GormEmptyInspector alloc] init];
[cache setObject: inspector forKey: @"GormEmptyInspector"]; [cache setObject: inspector forKey: @"GormEmptyInspector"];
RELEASE(inspector); RELEASE(inspector);
inspector = [GormMultipleInspector new]; inspector = [[GormMultipleInspector alloc] init];
[cache setObject: inspector forKey: @"GormMultipleInspector"]; [cache setObject: inspector forKey: @"GormMultipleInspector"];
DESTROY(inspector); DESTROY(inspector);
@ -361,7 +361,7 @@
if(inspector == nil) if(inspector == nil)
{ {
Class c = NSClassFromString(newInspector); Class c = NSClassFromString(newInspector);
inspector = [c new]; inspector = [[c alloc] init];
} }
newView = [[inspector window] contentView]; newView = [[inspector window] contentView];
@ -489,14 +489,14 @@
{ {
Class c = NSClassFromString(newInspector); Class c = NSClassFromString(newInspector);
inspector = [c new]; inspector = [[c alloc] init];
/* Try to gracefully handle an inspector creation error */ /* Try to gracefully handle an inspector creation error */
while (inspector == nil && (obj = [obj superclass]) while (inspector == nil && (obj = [obj superclass])
&& current == 0) && current == 0)
{ {
NSDebugLog(@"Error loading %@ inspector", newInspector); NSDebugLog(@"Error loading %@ inspector", newInspector);
newInspector = [obj inspectorClassName]; newInspector = [obj inspectorClassName];
inspector = [NSClassFromString(newInspector) new]; inspector = [[NSClassFromString(newInspector) alloc] init];
} }
[cache setObject: inspector forKey: newInspector]; [cache setObject: inspector forKey: newInspector];
RELEASE(inspector); RELEASE(inspector);
@ -738,7 +738,7 @@
allActionsForObject: [NSApp connectDestination]]); allActionsForObject: [NSApp connectDestination]]);
if ([actions count] > 0) if ([actions count] > 0)
{ {
con = [NSNibControlConnector new]; con = [[NSNibControlConnector alloc] init];
[con setSource: object]; [con setSource: object];
[con setDestination: [NSApp connectDestination]]; [con setDestination: [NSApp connectDestination]];
[con setLabel: [actions objectAtIndex: 0]]; [con setLabel: [actions objectAtIndex: 0]];
@ -782,7 +782,7 @@
if (found == NO) if (found == NO)
{ {
RELEASE(currentConnector); RELEASE(currentConnector);
currentConnector = [NSNibOutletConnector new]; currentConnector = [[NSNibOutletConnector alloc] init];
[currentConnector setSource: object]; [currentConnector setSource: object];
[currentConnector setDestination: [NSApp connectDestination]]; [currentConnector setDestination: [NSApp connectDestination]];
[currentConnector setLabel: title]; [currentConnector setLabel: title];
@ -819,7 +819,7 @@
if (found == NO) if (found == NO)
{ {
RELEASE(currentConnector); RELEASE(currentConnector);
currentConnector = [NSNibControlConnector new]; currentConnector = [[NSNibControlConnector alloc] init];
[currentConnector setSource: object]; [currentConnector setSource: object];
[currentConnector setDestination: [NSApp connectDestination]]; [currentConnector setDestination: [NSApp connectDestination]];
[currentConnector setLabel: title]; [currentConnector setLabel: title];
@ -1135,7 +1135,7 @@ selectCellWithString: (NSString*)title
/* /*
* Create list of existing connections for selected object. * Create list of existing connections for selected object.
*/ */
connectors = [NSMutableArray new]; connectors = [[NSMutableArray alloc] init];
array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object
ofClass: [NSNibControlConnector class]]; ofClass: [NSNibControlConnector class]];
[connectors addObjectsFromArray: array]; [connectors addObjectsFromArray: array];

View file

@ -349,8 +349,8 @@ static NSMapTable *docMap = 0;
[self setDoubleAction: @selector(raiseSelection:)]; [self setDoubleAction: @selector(raiseSelection:)];
[self setTarget: self]; [self setTarget: self];
objects = [NSMutableArray new]; objects = [[NSMutableArray alloc] init];
proto = [NSButtonCell new]; proto = [[NSButtonCell alloc] init];
[proto setBordered: NO]; [proto setBordered: NO];
[proto setAlignment: NSCenterTextAlignment]; [proto setAlignment: NSCenterTextAlignment];
[proto setImagePosition: NSImageAbove]; [proto setImagePosition: NSImageAbove];

View file

@ -102,9 +102,9 @@ selectCellWithString: (NSString*)title
NSRect windowRect = NSMakeRect(0, 0, IVW, IVH-IVB); NSRect windowRect = NSMakeRect(0, 0, IVW, IVH-IVB);
NSRect rect; NSRect rect;
sets = [NSMutableArray new]; sets = [[NSMutableArray alloc] init];
gets = [NSMutableDictionary new]; gets = [[NSMutableDictionary alloc] init];
types = [NSMutableDictionary new]; types = [[NSMutableDictionary alloc] init];
window = [[NSWindow alloc] initWithContentRect: windowRect window = [[NSWindow alloc] initWithContentRect: windowRect
styleMask: NSBorderlessWindowMask styleMask: NSBorderlessWindowMask
@ -251,7 +251,7 @@ selectCellWithString: (NSString*)title
if (c != 0) if (c != 0)
{ {
(*imp)(object, set, [c new]); (*imp)(object, set, [[c alloc] init]);
} }
} }
else else

View file

@ -200,7 +200,7 @@ static NSImage *dragImage = nil;
} }
RELEASE(dragImage); RELEASE(dragImage);
dragImage = [NSImage new]; dragImage = [[NSImage alloc] init];
rep = [[NSCachedImageRep alloc] initWithWindow: [self window] rep = [[NSCachedImageRep alloc] initWithWindow: [self window]
rect: rect]; rect: rect];
[dragImage setSize: rect.size]; [dragImage setSize: rect.size];
@ -292,12 +292,12 @@ static NSImage *dragImage = nil;
[panel setMinSize: [panel frame].size]; [panel setMinSize: [panel frame].size];
// allocate arrays and dictionaries. // allocate arrays and dictionaries.
bundles = [NSMutableArray new]; bundles = [[NSMutableArray alloc] init];
palettes = [NSMutableArray new]; palettes = [[NSMutableArray alloc] init];
importedClasses = [NSMutableDictionary new]; importedClasses = [[NSMutableDictionary alloc] init];
importedImages = [NSMutableArray new]; importedImages = [[NSMutableArray alloc] init];
importedSounds = [NSMutableArray new]; importedSounds = [[NSMutableArray alloc] init];
substituteClasses = [NSMutableDictionary new]; substituteClasses = [[NSMutableDictionary alloc] init];
scrollView = [[NSScrollView alloc] initWithFrame: scrollRect]; scrollView = [[NSScrollView alloc] initWithFrame: scrollRect];
[scrollView setHasHorizontalScroller: YES]; [scrollView setHasHorizontalScroller: YES];
@ -460,7 +460,7 @@ static NSImage *dragImage = nil;
return NO; return NO;
} }
palette = [paletteClass new]; palette = [[paletteClass alloc] init];
if ([palette isKindOfClass: [IBPalette class]] == NO) if ([palette isKindOfClass: [IBPalette class]] == NO)
{ {
NSRunAlertPanel (nil, _(@"Palette contains wrong type of class"), NSRunAlertPanel (nil, _(@"Palette contains wrong type of class"),

View file

@ -212,8 +212,8 @@ static int handled_mask= NSDragOperationCopy | NSDragOperationGeneric | NSDragOp
[self setDoubleAction: @selector(raiseSelection:)]; [self setDoubleAction: @selector(raiseSelection:)];
[self setTarget: self]; [self setTarget: self];
objects = [NSMutableArray new]; objects = [[NSMutableArray alloc] init];
proto = [NSButtonCell new]; proto = [[NSButtonCell alloc] init];
[proto setBordered: NO]; [proto setBordered: NO];
[proto setAlignment: NSCenterTextAlignment]; [proto setAlignment: NSCenterTextAlignment];
[proto setImagePosition: NSImageAbove]; [proto setImagePosition: NSImageAbove];

View file

@ -333,8 +333,8 @@
[self registerForDraggedTypes: [NSArray arrayWithObjects: [self registerForDraggedTypes: [NSArray arrayWithObjects:
GormLinkPboardType, IBViewPboardType, nil]]; GormLinkPboardType, IBViewPboardType, nil]];
selection = [NSMutableArray new]; selection = [[NSMutableArray alloc] init];
subeditors = [NSMutableArray new]; subeditors = [[NSMutableArray alloc] init];
activated = NO; activated = NO;
closed = NO; closed = NO;