mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-21 02:20:55 +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>
|
2003-02-22 David Ayers <d.ayers@inode.at>
|
||||||
|
|
||||||
* EOAccess/EOAdaptor.h/m: New globals for GDL2 specific
|
* EOAccess/EOAdaptor.h/m: New globals for GDL2 specific
|
||||||
|
|
|
@ -90,7 +90,7 @@ NSString *EOAdministrativeConnectionDictionaryNeededNotification
|
||||||
= @"EOAdministrativeConnectionDictionaryNeededNotification";
|
= @"EOAdministrativeConnectionDictionaryNeededNotification";
|
||||||
NSString *EOAdaptorKey = @"EOAdaptorKey";
|
NSString *EOAdaptorKey = @"EOAdaptorKey";
|
||||||
NSString *EOModelKey = @"EOModelKey";
|
NSString *EOModelKey = @"EOModelKey";
|
||||||
NSString *EOConnectionDictionaryKey = "EOConnectionDictionaryKey";
|
NSString *EOConnectionDictionaryKey = @"EOConnectionDictionaryKey";
|
||||||
NSString *EOAdministrativeConnectionDictionaryKey
|
NSString *EOAdministrativeConnectionDictionaryKey
|
||||||
= @"EOAdministrativeConnectionDictionaryKey";
|
= @"EOAdministrativeConnectionDictionaryKey";
|
||||||
|
|
||||||
|
@ -263,22 +263,36 @@ NSString *EOAdministrativeConnectionDictionaryKey
|
||||||
|
|
||||||
+ (EOLoginPanel *)sharedLoginPanelInstance
|
+ (EOLoginPanel *)sharedLoginPanelInstance
|
||||||
{
|
{
|
||||||
static EOLoginPanel *panel = nil;
|
static NSMutableDictionary *panelDict = nil;
|
||||||
|
NSString *name;
|
||||||
|
EOLoginPanel *panel = nil;
|
||||||
|
|
||||||
if (panel == nil
|
if ([self isMemberOfClass: [EOAdaptor class]] == NO)
|
||||||
&& NSClassFromString(@"NSApplication") != nil)
|
|
||||||
{
|
{
|
||||||
NSBundle *adaptorFramework;
|
if (panelDict == nil)
|
||||||
NSBundle *loginBundle;
|
{
|
||||||
NSString *path;
|
panelDict = [NSMutableDictionary new];
|
||||||
Class loginClass;
|
}
|
||||||
|
|
||||||
|
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];
|
adaptorFramework = [NSBundle bundleForClass: self];
|
||||||
path = [adaptorFramework pathForResource: @"LoginPanel"
|
path = [adaptorFramework pathForResource: @"LoginPanel"
|
||||||
ofType: @"bundle"];
|
ofType: @"bundle"];
|
||||||
loginBundle = [NSBundle bundleWithPath: path];
|
loginBundle = [NSBundle bundleWithPath: path];
|
||||||
loginClass = [loginBundle principalClass];
|
loginClass = [loginBundle principalClass];
|
||||||
panel = [loginClass new];
|
panel = [loginClass new];
|
||||||
|
[panelDict setObject: panel forKey: name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
|
|
Loading…
Reference in a new issue