mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
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:
parent
7f8251ed59
commit
5ab6e00e3e
9 changed files with 57 additions and 46 deletions
11
ChangeLog
11
ChangeLog
|
@ -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>
|
||||
|
||||
* Gorm.m: Code cleanup.
|
||||
|
|
|
@ -729,7 +729,7 @@
|
|||
{
|
||||
if (actions == nil)
|
||||
{
|
||||
allActions = [NSMutableArray new];
|
||||
allActions = [[NSMutableArray alloc] init];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -850,7 +850,7 @@
|
|||
{
|
||||
if (outlets == nil)
|
||||
{
|
||||
allOutlets = [NSMutableArray new];
|
||||
allOutlets = [[NSMutableArray alloc] init];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1181,7 +1181,7 @@
|
|||
|
||||
// get the info...
|
||||
classInfo = [classInformation objectForKey: key];
|
||||
newInfo = [NSMutableDictionary new];
|
||||
newInfo = [[NSMutableDictionary alloc] init];
|
||||
[ci setObject: newInfo forKey: key];
|
||||
|
||||
// superclass...
|
||||
|
@ -1234,7 +1234,7 @@
|
|||
|
||||
// get the info...
|
||||
classInfo = [classInformation objectForKey: key];
|
||||
newInfo = [NSMutableDictionary new];
|
||||
newInfo = [[NSMutableDictionary alloc] init];
|
||||
[ci setObject: newInfo forKey: key];
|
||||
|
||||
// superclass...
|
||||
|
@ -1294,7 +1294,7 @@
|
|||
NSMutableDictionary *oldInfo;
|
||||
id obj;
|
||||
|
||||
newInfo = [NSMutableDictionary new];
|
||||
newInfo = [[NSMutableDictionary alloc] init];
|
||||
oldInfo = [classInformation objectForKey: key];
|
||||
|
||||
[classInformation setObject: newInfo forKey: key];
|
||||
|
|
|
@ -217,7 +217,7 @@ static NSImage *fileImage = nil;
|
|||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
// initialize...
|
||||
openEditors = [NSMutableArray new];
|
||||
openEditors = [[NSMutableArray alloc] init];
|
||||
classManager = [(GormClassManager *)[GormClassManager alloc] initWithDocument: self];
|
||||
|
||||
/*
|
||||
|
@ -228,7 +228,7 @@ static NSImage *fileImage = nil;
|
|||
NSObjectMapValueCallBacks, 128, [self zone]);
|
||||
|
||||
// for saving the editors when the gorm file is persisted.
|
||||
savedEditors = [NSMutableArray new];
|
||||
savedEditors = [[NSMutableArray alloc] init];
|
||||
[window setMinSize: [window frame].size];
|
||||
[window setTitle: _(@"UNTITLED")];
|
||||
|
||||
|
@ -353,10 +353,10 @@ static NSImage *fileImage = nil;
|
|||
/*
|
||||
* 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];
|
||||
[objectsView addObject: filesOwner];
|
||||
firstResponder = [GormFirstResponder new];
|
||||
firstResponder = [[GormFirstResponder alloc] init];
|
||||
[self setName: @"NSFirst" forObject: firstResponder];
|
||||
[objectsView addObject: firstResponder];
|
||||
|
||||
|
@ -364,7 +364,7 @@ static NSImage *fileImage = nil;
|
|||
* Set image for this miniwindow.
|
||||
*/
|
||||
[window setMiniwindowImage: [(id)filesOwner imageForViewer]];
|
||||
hidden = [NSMutableArray new];
|
||||
hidden = [[NSMutableArray alloc] init];
|
||||
|
||||
// retain the file prefs view...
|
||||
RETAIN(filePrefsView);
|
||||
|
@ -502,7 +502,7 @@ static NSImage *fileImage = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
NSNibConnector *con = [NSNibConnector new];
|
||||
NSNibConnector *con = [[NSNibConnector alloc] init];
|
||||
|
||||
[con setSource: anObject];
|
||||
[con setDestination: aParent];
|
||||
|
@ -644,7 +644,7 @@ static NSImage *fileImage = nil;
|
|||
{
|
||||
NSString *label = NSStringFromSelector(sel);
|
||||
id source = anObject;
|
||||
NSNibControlConnector *con = [NSNibControlConnector new];
|
||||
NSNibControlConnector *con = [[NSNibControlConnector alloc] init];
|
||||
id destination = [(NSControl *)anObject target];
|
||||
NSArray *sourceConnections = [self connectorsForSource: source];
|
||||
|
||||
|
@ -984,7 +984,7 @@ static NSImage *fileImage = nil;
|
|||
* Remove all editors from the selected objects before archiving
|
||||
* and restore them afterwards.
|
||||
*/
|
||||
editorSet = [NSMutableSet new];
|
||||
editorSet = [[NSMutableSet alloc] init];
|
||||
enumerator = [anArray objectEnumerator];
|
||||
while ((obj = [enumerator nextObject]) != nil)
|
||||
{
|
||||
|
@ -1405,7 +1405,7 @@ static NSImage *fileImage = nil;
|
|||
id<IBConnectors> link;
|
||||
|
||||
editor = [[eClass alloc] initWithObject: anObject inDocument: self];
|
||||
link = AUTORELEASE([GormObjectToEditor new]);
|
||||
link = AUTORELEASE([[GormObjectToEditor alloc] init]);
|
||||
[link setSource: anObject];
|
||||
[link setDestination: editor];
|
||||
[connections addObject: link];
|
||||
|
@ -1428,7 +1428,7 @@ static NSImage *fileImage = nil;
|
|||
/*
|
||||
* Link to the parent of the editor.
|
||||
*/
|
||||
link = AUTORELEASE([GormEditorToParent new]);
|
||||
link = AUTORELEASE([[GormEditorToParent alloc] init]);
|
||||
[link setSource: editor];
|
||||
[link setDestination: anEditor];
|
||||
[connections addObject: link];
|
||||
|
@ -2792,7 +2792,7 @@ static NSImage *fileImage = nil;
|
|||
{
|
||||
if (a == nil)
|
||||
{
|
||||
a = [NSMutableArray new];
|
||||
a = [[NSMutableArray alloc] init];
|
||||
[nameTable setObject: a forKey: @"NSVisible"];
|
||||
RELEASE(a);
|
||||
}
|
||||
|
@ -2826,7 +2826,7 @@ static NSImage *fileImage = nil;
|
|||
{
|
||||
if (a == nil)
|
||||
{
|
||||
a = [NSMutableArray new];
|
||||
a = [[NSMutableArray alloc] init];
|
||||
[nameTable setObject: a forKey: @"NSDeferred"];
|
||||
RELEASE(a);
|
||||
}
|
||||
|
@ -2903,7 +2903,7 @@ static NSImage *fileImage = nil;
|
|||
*/
|
||||
- (id) revertDocument: (id)sender
|
||||
{
|
||||
GormDocument *reverted = AUTORELEASE([GormDocument new]);
|
||||
GormDocument *reverted = AUTORELEASE([[GormDocument alloc] init]);
|
||||
|
||||
if ([reverted loadDocument: documentPath] != nil)
|
||||
{
|
||||
|
|
|
@ -210,7 +210,7 @@
|
|||
NSRect inspectorRect = {{0, 0}, {IVW, IVH}};
|
||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
|
||||
|
||||
cache = [NSMutableDictionary new];
|
||||
cache = [[NSMutableDictionary alloc] init];
|
||||
panel = [[NSPanel alloc] initWithContentRect: contentRect
|
||||
styleMask: style
|
||||
backing: NSBackingStoreRetained
|
||||
|
@ -294,10 +294,10 @@
|
|||
|
||||
current = -1;
|
||||
|
||||
inspector = [GormEmptyInspector new];
|
||||
inspector = [[GormEmptyInspector alloc] init];
|
||||
[cache setObject: inspector forKey: @"GormEmptyInspector"];
|
||||
RELEASE(inspector);
|
||||
inspector = [GormMultipleInspector new];
|
||||
inspector = [[GormMultipleInspector alloc] init];
|
||||
[cache setObject: inspector forKey: @"GormMultipleInspector"];
|
||||
DESTROY(inspector);
|
||||
|
||||
|
@ -361,7 +361,7 @@
|
|||
if(inspector == nil)
|
||||
{
|
||||
Class c = NSClassFromString(newInspector);
|
||||
inspector = [c new];
|
||||
inspector = [[c alloc] init];
|
||||
}
|
||||
|
||||
newView = [[inspector window] contentView];
|
||||
|
@ -489,14 +489,14 @@
|
|||
{
|
||||
Class c = NSClassFromString(newInspector);
|
||||
|
||||
inspector = [c new];
|
||||
inspector = [[c alloc] init];
|
||||
/* Try to gracefully handle an inspector creation error */
|
||||
while (inspector == nil && (obj = [obj superclass])
|
||||
&& current == 0)
|
||||
{
|
||||
NSDebugLog(@"Error loading %@ inspector", newInspector);
|
||||
newInspector = [obj inspectorClassName];
|
||||
inspector = [NSClassFromString(newInspector) new];
|
||||
inspector = [[NSClassFromString(newInspector) alloc] init];
|
||||
}
|
||||
[cache setObject: inspector forKey: newInspector];
|
||||
RELEASE(inspector);
|
||||
|
@ -738,7 +738,7 @@
|
|||
allActionsForObject: [NSApp connectDestination]]);
|
||||
if ([actions count] > 0)
|
||||
{
|
||||
con = [NSNibControlConnector new];
|
||||
con = [[NSNibControlConnector alloc] init];
|
||||
[con setSource: object];
|
||||
[con setDestination: [NSApp connectDestination]];
|
||||
[con setLabel: [actions objectAtIndex: 0]];
|
||||
|
@ -782,7 +782,7 @@
|
|||
if (found == NO)
|
||||
{
|
||||
RELEASE(currentConnector);
|
||||
currentConnector = [NSNibOutletConnector new];
|
||||
currentConnector = [[NSNibOutletConnector alloc] init];
|
||||
[currentConnector setSource: object];
|
||||
[currentConnector setDestination: [NSApp connectDestination]];
|
||||
[currentConnector setLabel: title];
|
||||
|
@ -819,7 +819,7 @@
|
|||
if (found == NO)
|
||||
{
|
||||
RELEASE(currentConnector);
|
||||
currentConnector = [NSNibControlConnector new];
|
||||
currentConnector = [[NSNibControlConnector alloc] init];
|
||||
[currentConnector setSource: object];
|
||||
[currentConnector setDestination: [NSApp connectDestination]];
|
||||
[currentConnector setLabel: title];
|
||||
|
@ -1135,7 +1135,7 @@ selectCellWithString: (NSString*)title
|
|||
/*
|
||||
* Create list of existing connections for selected object.
|
||||
*/
|
||||
connectors = [NSMutableArray new];
|
||||
connectors = [[NSMutableArray alloc] init];
|
||||
array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object
|
||||
ofClass: [NSNibControlConnector class]];
|
||||
[connectors addObjectsFromArray: array];
|
||||
|
|
|
@ -349,8 +349,8 @@ static NSMapTable *docMap = 0;
|
|||
[self setDoubleAction: @selector(raiseSelection:)];
|
||||
[self setTarget: self];
|
||||
|
||||
objects = [NSMutableArray new];
|
||||
proto = [NSButtonCell new];
|
||||
objects = [[NSMutableArray alloc] init];
|
||||
proto = [[NSButtonCell alloc] init];
|
||||
[proto setBordered: NO];
|
||||
[proto setAlignment: NSCenterTextAlignment];
|
||||
[proto setImagePosition: NSImageAbove];
|
||||
|
|
|
@ -102,9 +102,9 @@ selectCellWithString: (NSString*)title
|
|||
NSRect windowRect = NSMakeRect(0, 0, IVW, IVH-IVB);
|
||||
NSRect rect;
|
||||
|
||||
sets = [NSMutableArray new];
|
||||
gets = [NSMutableDictionary new];
|
||||
types = [NSMutableDictionary new];
|
||||
sets = [[NSMutableArray alloc] init];
|
||||
gets = [[NSMutableDictionary alloc] init];
|
||||
types = [[NSMutableDictionary alloc] init];
|
||||
|
||||
window = [[NSWindow alloc] initWithContentRect: windowRect
|
||||
styleMask: NSBorderlessWindowMask
|
||||
|
@ -251,7 +251,7 @@ selectCellWithString: (NSString*)title
|
|||
|
||||
if (c != 0)
|
||||
{
|
||||
(*imp)(object, set, [c new]);
|
||||
(*imp)(object, set, [[c alloc] init]);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -200,7 +200,7 @@ static NSImage *dragImage = nil;
|
|||
}
|
||||
|
||||
RELEASE(dragImage);
|
||||
dragImage = [NSImage new];
|
||||
dragImage = [[NSImage alloc] init];
|
||||
rep = [[NSCachedImageRep alloc] initWithWindow: [self window]
|
||||
rect: rect];
|
||||
[dragImage setSize: rect.size];
|
||||
|
@ -292,12 +292,12 @@ static NSImage *dragImage = nil;
|
|||
[panel setMinSize: [panel frame].size];
|
||||
|
||||
// allocate arrays and dictionaries.
|
||||
bundles = [NSMutableArray new];
|
||||
palettes = [NSMutableArray new];
|
||||
importedClasses = [NSMutableDictionary new];
|
||||
importedImages = [NSMutableArray new];
|
||||
importedSounds = [NSMutableArray new];
|
||||
substituteClasses = [NSMutableDictionary new];
|
||||
bundles = [[NSMutableArray alloc] init];
|
||||
palettes = [[NSMutableArray alloc] init];
|
||||
importedClasses = [[NSMutableDictionary alloc] init];
|
||||
importedImages = [[NSMutableArray alloc] init];
|
||||
importedSounds = [[NSMutableArray alloc] init];
|
||||
substituteClasses = [[NSMutableDictionary alloc] init];
|
||||
|
||||
scrollView = [[NSScrollView alloc] initWithFrame: scrollRect];
|
||||
[scrollView setHasHorizontalScroller: YES];
|
||||
|
@ -460,7 +460,7 @@ static NSImage *dragImage = nil;
|
|||
return NO;
|
||||
}
|
||||
|
||||
palette = [paletteClass new];
|
||||
palette = [[paletteClass alloc] init];
|
||||
if ([palette isKindOfClass: [IBPalette class]] == NO)
|
||||
{
|
||||
NSRunAlertPanel (nil, _(@"Palette contains wrong type of class"),
|
||||
|
|
|
@ -212,8 +212,8 @@ static int handled_mask= NSDragOperationCopy | NSDragOperationGeneric | NSDragOp
|
|||
[self setDoubleAction: @selector(raiseSelection:)];
|
||||
[self setTarget: self];
|
||||
|
||||
objects = [NSMutableArray new];
|
||||
proto = [NSButtonCell new];
|
||||
objects = [[NSMutableArray alloc] init];
|
||||
proto = [[NSButtonCell alloc] init];
|
||||
[proto setBordered: NO];
|
||||
[proto setAlignment: NSCenterTextAlignment];
|
||||
[proto setImagePosition: NSImageAbove];
|
||||
|
|
|
@ -333,8 +333,8 @@
|
|||
[self registerForDraggedTypes: [NSArray arrayWithObjects:
|
||||
GormLinkPboardType, IBViewPboardType, nil]];
|
||||
|
||||
selection = [NSMutableArray new];
|
||||
subeditors = [NSMutableArray new];
|
||||
selection = [[NSMutableArray alloc] init];
|
||||
subeditors = [[NSMutableArray alloc] init];
|
||||
|
||||
activated = NO;
|
||||
closed = NO;
|
||||
|
|
Loading…
Reference in a new issue