gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButtonImageSource weird code


From: Gregory Casamento
Subject: Re: NSButtonImageSource weird code
Date: Wed, 10 Jul 2013 15:43:25 -0400

Have you made the change you suggest and tested it?


On Wed, Jul 10, 2013 at 3:12 PM, Vincent R. <address@hidden> wrote:
Hi,

the following method of NSButtonImageSource looks weird :

NSMutableDictionary     *sources = nil;

+ (id) buttonImageSourceWithName: (NSString*)name
{
  NSButtonImageSource   *source;

  source = [sources objectForKey: name];
  if (source == nil)
    {
      source = [self alloc];
      source->imageName = [name copy];
      source->images = [NSMutableDictionary new];
      [sources setObject: source forKey: sources->imageName];
      RELEASE(source);
    }
  return source;
}

I think the line where the new object is added to the sources dictionary should be :

[sources setObject: source forKey: source->imageName];
instead of
[sources setObject: source forKey: sources->imageName];

What do you think ?


_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev



--
Gregory Casamento
Open Logic Corporation, Principal Consultant
yahoo/skype: greg_casamento, aol: gjcasa
(240)274-9630 (Cell)
http://www.gnustep.org
http://heronsperch.blogspot.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]