[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GSTheme activation
From: |
Philippe Roussel |
Subject: |
GSTheme activation |
Date: |
Thu, 12 Jan 2012 21:49:34 +0100 |
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
- GSTheme activation,
Philippe Roussel <=