Commit 75e4e943 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

If the default CUPS printer has no ppd file, just use the first

printer that has one as Windows default printer. Support PRINTER_ENUM_CONNECTIONS in the default way.
parent 921eef3b
......@@ -131,6 +131,11 @@ CUPS_LoadPrinters(void) {
if (!ppd) {
WARN("No ppd file for %s.\n",printers[i]);
/* If this was going to be the default printer,
* forget it and use another one.
*/
if (def && !strcmp(def,printers[i]))
def = NULL;
continue;
}
unlink(ppd);
......@@ -139,6 +144,14 @@ CUPS_LoadPrinters(void) {
if (def && !strcmp(def,printers[i]))
WINSPOOL_SetDefaultPrinter(printers[i],printers[i],FALSE);
/* The default printer has no PPD file, just use the first one
* which has one.
*/
if (!def) {
WINSPOOL_SetDefaultPrinter(printers[i],printers[i],FALSE);
def = printers[i];
}
memset(&pinfo2a,0,sizeof(pinfo2a));
pinfo2a.pPrinterName = printers[i];
pinfo2a.pDatatype = "RAW";
......@@ -1866,6 +1879,12 @@ static BOOL WINSPOOL_EnumPrinters(DWORD dwType, LPWSTR lpszName,
if(dwType == PRINTER_ENUM_DEFAULT)
return TRUE;
if (dwType & PRINTER_ENUM_CONNECTIONS) {
FIXME("We dont handle PRINTER_ENUM_CONNECTIONS\n");
dwType &= ~PRINTER_ENUM_CONNECTIONS; /* we dont handle that */
dwType |= PRINTER_ENUM_LOCAL;
}
if (!((dwType & PRINTER_ENUM_LOCAL) || (dwType & PRINTER_ENUM_NAME))) {
FIXME("dwType = %08lx\n", dwType);
SetLastError(ERROR_INVALID_FLAGS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment