Fix printer spool path attribut name in the message we handle to transport add-on(s).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5562 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -21,4 +21,5 @@ StaticLibrary
|
|||||||
# printerdriveraddon
|
# printerdriveraddon
|
||||||
# :
|
# :
|
||||||
# PrinterDriverAddOn.cpp
|
# PrinterDriverAddOn.cpp
|
||||||
# ;
|
# ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,32 @@
|
|||||||
#include "PrintTransportAddOn.h"
|
#include "PrintTransportAddOn.h"
|
||||||
|
|
||||||
|
// We don't support multiple instances of the same transport add-on
|
||||||
static BDataIO* gTransport = NULL;
|
static BDataIO* gTransport = NULL;
|
||||||
|
|
||||||
extern "C" _EXPORT BDataIO *init_transport(BMessage *msg) {
|
extern "C" _EXPORT BDataIO *init_transport(BMessage *msg)
|
||||||
if (msg != NULL && gTransport == NULL) {
|
{
|
||||||
const char* printer_name = msg->FindString("printer_name");
|
if (msg == NULL || gTransport != NULL)
|
||||||
if (printer_name && *printer_name != '\0') {
|
return NULL;
|
||||||
BDirectory printer(printer_name);
|
|
||||||
if (printer.InitCheck() == B_OK) {
|
const char *spool_path = msg->FindString("printer_file");
|
||||||
gTransport = instanciate_transport(&printer, msg);
|
|
||||||
return gTransport;
|
if (spool_path && *spool_path != '\0') {
|
||||||
}
|
BDirectory printer(spool_path);
|
||||||
}
|
|
||||||
}
|
if (printer.InitCheck() == B_OK) {
|
||||||
|
gTransport = instanciate_transport(&printer, msg);
|
||||||
|
return gTransport;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" _EXPORT void exit_transport() {
|
extern "C" _EXPORT void exit_transport()
|
||||||
|
{
|
||||||
if (gTransport) {
|
if (gTransport) {
|
||||||
delete gTransport; gTransport = NULL;
|
delete gTransport;
|
||||||
|
gTransport = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user