GSLPR Updates

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20209 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
cehardin 2004-10-08 09:31:11 +00:00
parent 21c4e04b00
commit 00a434e4a0
6 changed files with 23 additions and 53 deletions

View file

@ -1,3 +1,14 @@
2004-10-08 09:17 Chad Hardin <cehardin@mac.com>
* 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 <cehardin@mac.com> 2004-10-08 Chad Hardin <cehardin@mac.com>
* Printing/GSLPR/GSLPRPrintOperation: Removed useless #defines and * Printing/GSLPR/GSLPRPrintOperation: Removed useless #defines and

View file

@ -44,4 +44,4 @@
@end @end
#endif // _GNUstep_H_NSPageLayout #endif // _GNUstep_H_GSLPRPageLayout

View file

@ -25,8 +25,8 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef _GSLPRPRINCIPALCLASS_H_ #ifndef _GNUstep_H_GSLPRPrincipalClass
#define _GSLPRPRINCIPALCLASS_H_ #define _GNUstep_H_GSLPRPrincipalClass
#include <GNUstepGUI/GSPrinting.h> #include <GNUstepGUI/GSPrinting.h>
@ -36,5 +36,5 @@
@end @end
#endif // _GSLPRPRINCIPALCLASS_H_ #endif // _GNUstep_H_GSLPRPrincipalClass

View file

@ -78,16 +78,16 @@
if( name == nil ) if( name == nil )
{ {
name = [[GSLPRPrinter printerNames] objectAtIndex: 0]; name = [[NSPrinter printerNames] objectAtIndex: 0];
} }
else else
{ {
if( [GSLPRPrinter printerWithName: name] == nil ) if( [NSPrinter printerWithName: name] == nil )
{ {
name = [[GSLPRPrinter printerNames] objectAtIndex: 0]; name = [[GSLPRPrinter printerNames] objectAtIndex: 0];
} }
} }
return [GSLPRPrinter printerWithName: name]; return [NSPrinter printerWithName: name];
} }

View file

@ -40,6 +40,7 @@
{ {
} }
+(NSDictionary*) printersDictionary;
@end @end
#endif // _GNUstep_H_GSLPRPrinter #endif // _GNUstep_H_GSLPRPrinter

View file

@ -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 @implementation GSLPRPrinter
// //
@ -124,10 +112,11 @@
initWithName: name initWithName: name
withType: [printerEntry objectForKey: @"Type"] withType: [printerEntry objectForKey: @"Type"]
withHost: [printerEntry objectForKey: @"Host"] withHost: [printerEntry objectForKey: @"Host"]
withNote: [printerEntry objectForKey: @"Note"] withNote: [printerEntry objectForKey: @"Note"]];
withPPDPath: [printerEntry objectForKey: @"PPDPath"]];
[printer parsePPDAtPath: [printerEntry objectForKey: @"PPDPath"]];
return [printer autorelease]; return AUTORELEASE(printer);
} }
@ -151,13 +140,8 @@
[super encodeWithCoder: coder]; [super encodeWithCoder: coder];
} }
@end
@implementation GSLPRPrinter (Private)
// //
// Load the printer setup from NSUserDefaults // 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 @end