Hi,
Playing with different themes I noticed that when starting an
application with GnomeTheme the debug log 'Gnome theme initialized'
appears multiple times.
I think the following patch is needed :
--- Source/GSTheme.m (revision 34503)
+++ Source/GSTheme.m (working copy)
@@ -282,19 +282,22 @@
+ (void) initialize
{
- if (themes == nil)
+ if ([GSTheme class] == self)
{
- themes = [NSMutableDictionary new];
- null = RETAIN([NSNull null]);
- defaultTheme = [[self alloc] initWithBundle: nil];
- ASSIGN(theTheme, defaultTheme);
- ASSIGN(currentThemeName, [defaultTheme name]);
- names = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
- NSIntMapValueCallBacks, 0);
+ if (themes == nil)
+ {
+ themes = [NSMutableDictionary new];
+ null = RETAIN([NSNull null]);
+ defaultTheme = [[self alloc] initWithBundle: nil];
+ ASSIGN(theTheme, defaultTheme);
+ ASSIGN(currentThemeName, [defaultTheme name]);
+ names = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
+ NSIntMapValueCallBacks, 0);
+ }
+ /* Establish the theme specified by the user defaults (if any);
+ */
+ [self defaultsDidChange: nil];
}
- /* Establish the theme specified by the user defaults (if any);
- */
- [self defaultsDidChange: nil];
}
+ (GSTheme*) loadThemeNamed: (NSString*)aName
Or maybe just moving [self defaultsDidChange: nil] at the end of the
existing condition.
Philippe
_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev