From 00a434e4a09ebf31fd60b0abc2a57e8622636897 Mon Sep 17 00:00:00 2001 From: cehardin Date: Fri, 8 Oct 2004 09:31:11 +0000 Subject: [PATCH] GSLPR Updates git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20209 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 11 ++++++ Printing/GSLPR/GSLPRPageLayout.h | 2 +- Printing/GSLPR/GSLPRPrincipalClass.h | 6 ++-- Printing/GSLPR/GSLPRPrintInfo.m | 6 ++-- Printing/GSLPR/GSLPRPrinter.h | 1 + Printing/GSLPR/GSLPRPrinter.m | 50 +++------------------------- 6 files changed, 23 insertions(+), 53 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9af46d1df..02b1ce4a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-10-08 09:17 Chad Hardin + + * Printing/GSLPR/GSLPRPageLayout.m: Fixed a #define + * Printing/GSLPR/GSLPRPrintInfo.m: Made it so the code calls + NSPrinter's printerWithName rather than GSLPR's, because the former + caches NSPrinter objects. + * Printing/GSLPR/GSLPRPrinter.h: Moved a method out of a (Private) + catagory and place it into the header file, directly into the class. + * Printing/GSLPR/GSLPRPrinter.m: Simplified the class by taking out + an unnecesary initializer. + 2004-10-08 Chad Hardin * Printing/GSLPR/GSLPRPrintOperation: Removed useless #defines and diff --git a/Printing/GSLPR/GSLPRPageLayout.h b/Printing/GSLPR/GSLPRPageLayout.h index 4b6a57b80..fccd79a0d 100644 --- a/Printing/GSLPR/GSLPRPageLayout.h +++ b/Printing/GSLPR/GSLPRPageLayout.h @@ -44,4 +44,4 @@ @end -#endif // _GNUstep_H_NSPageLayout +#endif // _GNUstep_H_GSLPRPageLayout diff --git a/Printing/GSLPR/GSLPRPrincipalClass.h b/Printing/GSLPR/GSLPRPrincipalClass.h index 041ffd3f6..d36f1e96e 100644 --- a/Printing/GSLPR/GSLPRPrincipalClass.h +++ b/Printing/GSLPR/GSLPRPrincipalClass.h @@ -25,8 +25,8 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _GSLPRPRINCIPALCLASS_H_ -#define _GSLPRPRINCIPALCLASS_H_ +#ifndef _GNUstep_H_GSLPRPrincipalClass +#define _GNUstep_H_GSLPRPrincipalClass #include @@ -36,5 +36,5 @@ @end -#endif // _GSLPRPRINCIPALCLASS_H_ +#endif // _GNUstep_H_GSLPRPrincipalClass diff --git a/Printing/GSLPR/GSLPRPrintInfo.m b/Printing/GSLPR/GSLPRPrintInfo.m index 0132f28de..c2613022e 100644 --- a/Printing/GSLPR/GSLPRPrintInfo.m +++ b/Printing/GSLPR/GSLPRPrintInfo.m @@ -78,16 +78,16 @@ if( name == nil ) { - name = [[GSLPRPrinter printerNames] objectAtIndex: 0]; + name = [[NSPrinter printerNames] objectAtIndex: 0]; } else { - if( [GSLPRPrinter printerWithName: name] == nil ) + if( [NSPrinter printerWithName: name] == nil ) { name = [[GSLPRPrinter printerNames] objectAtIndex: 0]; } } - return [GSLPRPrinter printerWithName: name]; + return [NSPrinter printerWithName: name]; } diff --git a/Printing/GSLPR/GSLPRPrinter.h b/Printing/GSLPR/GSLPRPrinter.h index 7bfac72c4..6ceed7f12 100644 --- a/Printing/GSLPR/GSLPRPrinter.h +++ b/Printing/GSLPR/GSLPRPrinter.h @@ -40,6 +40,7 @@ { } ++(NSDictionary*) printersDictionary; @end #endif // _GNUstep_H_GSLPRPrinter diff --git a/Printing/GSLPR/GSLPRPrinter.m b/Printing/GSLPR/GSLPRPrinter.m index f5aafa640..89d881a22 100644 --- a/Printing/GSLPR/GSLPRPrinter.m +++ b/Printing/GSLPR/GSLPRPrinter.m @@ -63,18 +63,6 @@ -@interface GSLPRPrinter (Private) - -+(NSDictionary*) printersDictionary; - --(id) initWithName: (NSString*) name - withType: (NSString*) type - withHost: (NSString*) host - withNote: (NSString*) note - withPPDPath: (NSString*) ppdPath; -@end - - @implementation GSLPRPrinter // @@ -124,10 +112,11 @@ initWithName: name withType: [printerEntry objectForKey: @"Type"] withHost: [printerEntry objectForKey: @"Host"] - withNote: [printerEntry objectForKey: @"Note"] - withPPDPath: [printerEntry objectForKey: @"PPDPath"]]; + withNote: [printerEntry objectForKey: @"Note"]]; + + [printer parsePPDAtPath: [printerEntry objectForKey: @"PPDPath"]]; - return [printer autorelease]; + return AUTORELEASE(printer); } @@ -151,13 +140,8 @@ [super encodeWithCoder: coder]; } -@end - - - -@implementation GSLPRPrinter (Private) // // Load the printer setup from NSUserDefaults // @@ -213,30 +197,4 @@ } - - -// -// Initialisation method -// -// To keep loading of PPDs relatively fast, not much checking is done on it. --(id) initWithName: (NSString*) name - withType: (NSString*) type - withHost: (NSString*) host - withNote: (NSString*) note - withPPDPath: (NSString*) ppdPath -{ - NSDebugMLLog(@"GSPrinting", @""); - - self = [super initWithName: name - withType: type - withHost: host - withNote: note]; - - [self parsePPDAtPath: ppdPath]; - - return self; -} - - - @end