Print jobs whose transport add-on is either "Print To File" or not set at all (in case of "Preview" printer) are not processed sequentially.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27113 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,6 +2,9 @@ SubDir HAIKU_TOP src add-ons print transports print_to_file ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
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 :
|
Addon Print\ To\ File :
|
||||||
print_transport.cpp
|
print_transport.cpp
|
||||||
FileSelector.cpp
|
FileSelector.cpp
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ Printer::Printer(const BDirectory* node, Resource* res)
|
|||||||
: Inherited(B_EMPTY_STRING),
|
: Inherited(B_EMPTY_STRING),
|
||||||
fPrinter(gLock, be_app, *node),
|
fPrinter(gLock, be_app, *node),
|
||||||
fResource(res),
|
fResource(res),
|
||||||
fSinglePrintThread(true),
|
fSinglePrintThread(res->NeedsLocking()),
|
||||||
fJob(NULL),
|
fJob(NULL),
|
||||||
fProcessing(0),
|
fProcessing(0),
|
||||||
fAbort(false)
|
fAbort(false)
|
||||||
@@ -136,9 +136,6 @@ Printer::Printer(const BDirectory* node, Resource* res)
|
|||||||
if (SpoolDir()->ReadAttrString(PSRV_PRINTER_ATTR_PRT_NAME, &name) == B_OK)
|
if (SpoolDir()->ReadAttrString(PSRV_PRINTER_ATTR_PRT_NAME, &name) == B_OK)
|
||||||
SetName(name.String());
|
SetName(name.String());
|
||||||
|
|
||||||
if (name == "Preview")
|
|
||||||
fSinglePrintThread = false;
|
|
||||||
|
|
||||||
// Add us to the global list of known printer definitions
|
// Add us to the global list of known printer definitions
|
||||||
sPrinters.AddItem(this);
|
sPrinters.AddItem(this);
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,15 @@ Resource::~Resource() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Resource::NeedsLocking() {
|
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) {
|
bool Resource::Equals(const char* transport, const char* address, const char* connection) {
|
||||||
|
|||||||
@@ -22,13 +22,12 @@ private:
|
|||||||
BString fConnection;
|
BString fConnection;
|
||||||
sem_id fResourceAvailable;
|
sem_id fResourceAvailable;
|
||||||
|
|
||||||
bool NeedsLocking();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Resource(const char* transport, const char* address, const char* connection);
|
Resource(const char* transport, const char* address, const char* connection);
|
||||||
~Resource();
|
~Resource();
|
||||||
|
|
||||||
|
bool NeedsLocking();
|
||||||
|
|
||||||
bool Equals(const char* transport, const char* address, const char* connection);
|
bool Equals(const char* transport, const char* address, const char* connection);
|
||||||
|
|
||||||
const BString& Transport() const { return fTransport; }
|
const BString& Transport() const { return fTransport; }
|
||||||
|
|||||||
Reference in New Issue
Block a user