mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-19 09:40:59 +00:00
* EOAccess/EOAdaptor.m ([EOAdaptor sharedLoginPanelInstance]):
Maintain instances on a per class basis as reported by Matt Rice. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@18639 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6154adebfd
commit
281ebea9b2
2 changed files with 33 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-02-23 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOAccess/EOAdaptor.m ([EOAdaptor sharedLoginPanelInstance]):
|
||||
Maintain instances on a per class basis as reported by Matt Rice.
|
||||
|
||||
2003-02-22 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOAccess/EOAdaptor.h/m: New globals for GDL2 specific
|
||||
|
|
|
@ -90,7 +90,7 @@ NSString *EOAdministrativeConnectionDictionaryNeededNotification
|
|||
= @"EOAdministrativeConnectionDictionaryNeededNotification";
|
||||
NSString *EOAdaptorKey = @"EOAdaptorKey";
|
||||
NSString *EOModelKey = @"EOModelKey";
|
||||
NSString *EOConnectionDictionaryKey = "EOConnectionDictionaryKey";
|
||||
NSString *EOConnectionDictionaryKey = @"EOConnectionDictionaryKey";
|
||||
NSString *EOAdministrativeConnectionDictionaryKey
|
||||
= @"EOAdministrativeConnectionDictionaryKey";
|
||||
|
||||
|
@ -263,22 +263,36 @@ NSString *EOAdministrativeConnectionDictionaryKey
|
|||
|
||||
+ (EOLoginPanel *)sharedLoginPanelInstance
|
||||
{
|
||||
static EOLoginPanel *panel = nil;
|
||||
static NSMutableDictionary *panelDict = nil;
|
||||
NSString *name;
|
||||
EOLoginPanel *panel = nil;
|
||||
|
||||
if (panel == nil
|
||||
&& NSClassFromString(@"NSApplication") != nil)
|
||||
if ([self isMemberOfClass: [EOAdaptor class]] == NO)
|
||||
{
|
||||
NSBundle *adaptorFramework;
|
||||
NSBundle *loginBundle;
|
||||
NSString *path;
|
||||
Class loginClass;
|
||||
if (panelDict == nil)
|
||||
{
|
||||
panelDict = [NSMutableDictionary new];
|
||||
}
|
||||
|
||||
name = NSStringFromClass(self);
|
||||
panel = [panelDict objectForKey: name];
|
||||
|
||||
if (panel == nil
|
||||
&& NSClassFromString(@"NSApplication") != nil)
|
||||
{
|
||||
NSBundle *adaptorFramework;
|
||||
NSBundle *loginBundle;
|
||||
NSString *path;
|
||||
Class loginClass;
|
||||
|
||||
adaptorFramework = [NSBundle bundleForClass: self];
|
||||
path = [adaptorFramework pathForResource: @"LoginPanel"
|
||||
ofType: @"bundle"];
|
||||
loginBundle = [NSBundle bundleWithPath: path];
|
||||
loginClass = [loginBundle principalClass];
|
||||
panel = [loginClass new];
|
||||
adaptorFramework = [NSBundle bundleForClass: self];
|
||||
path = [adaptorFramework pathForResource: @"LoginPanel"
|
||||
ofType: @"bundle"];
|
||||
loginBundle = [NSBundle bundleWithPath: path];
|
||||
loginClass = [loginBundle principalClass];
|
||||
panel = [loginClass new];
|
||||
[panelDict setObject: panel forKey: name];
|
||||
}
|
||||
}
|
||||
|
||||
return panel;
|
||||
|
|
Loading…
Reference in a new issue