diff --git a/src/add-ons/print/transports/print_to_file/Jamfile b/src/add-ons/print/transports/print_to_file/Jamfile index 5f3f78be79..e5f8d5ea31 100644 --- a/src/add-ons/print/transports/print_to_file/Jamfile +++ b/src/add-ons/print/transports/print_to_file/Jamfile @@ -2,6 +2,9 @@ SubDir HAIKU_TOP src add-ons print transports print_to_file ; SetSubDirSupportedPlatformsBeOSCompatible ; +# In case of changing the name of this transport add-on +# the method NeedsLocking() in src/servers/print/ResourceManager.cpp +# has to be updated as well. Addon Print\ To\ File : print_transport.cpp FileSelector.cpp diff --git a/src/servers/print/Printer.cpp b/src/servers/print/Printer.cpp index b3e28ef8db..fe7487774a 100644 --- a/src/servers/print/Printer.cpp +++ b/src/servers/print/Printer.cpp @@ -126,7 +126,7 @@ Printer::Printer(const BDirectory* node, Resource* res) : Inherited(B_EMPTY_STRING), fPrinter(gLock, be_app, *node), fResource(res), - fSinglePrintThread(true), + fSinglePrintThread(res->NeedsLocking()), fJob(NULL), fProcessing(0), fAbort(false) @@ -136,9 +136,6 @@ Printer::Printer(const BDirectory* node, Resource* res) if (SpoolDir()->ReadAttrString(PSRV_PRINTER_ATTR_PRT_NAME, &name) == B_OK) SetName(name.String()); - if (name == "Preview") - fSinglePrintThread = false; - // Add us to the global list of known printer definitions sPrinters.AddItem(this); diff --git a/src/servers/print/ResourceManager.cpp b/src/servers/print/ResourceManager.cpp index a78bfd6686..4389491e2f 100644 --- a/src/servers/print/ResourceManager.cpp +++ b/src/servers/print/ResourceManager.cpp @@ -27,7 +27,15 @@ Resource::~Resource() { } bool Resource::NeedsLocking() { - return !(fTransport == "Print to File" || fTransport == "NONE"); + // TODO R2: Provide API to query that information + // ATM: Print jobs are not processed sequentially + // if the transport add-on is either "Print To File" + // or in case of "Preview" printer it + // is set on R5 to "NONE" IIRC and the Haiku + // preflet sets an empty string. + return !(fTransport == "Print To File" + || fTransport == "NONE" + || fTransport == ""); } bool Resource::Equals(const char* transport, const char* address, const char* connection) { diff --git a/src/servers/print/ResourceManager.h b/src/servers/print/ResourceManager.h index 349fdceaaf..85e3b090d8 100644 --- a/src/servers/print/ResourceManager.h +++ b/src/servers/print/ResourceManager.h @@ -22,13 +22,12 @@ private: BString fConnection; sem_id fResourceAvailable; - bool NeedsLocking(); - - public: Resource(const char* transport, const char* address, const char* connection); ~Resource(); + bool NeedsLocking(); + bool Equals(const char* transport, const char* address, const char* connection); const BString& Transport() const { return fTransport; }