svn commit: samba r21862 - in branches: SAMBA_3_0/source/printing SAMBA_3_0_25/source/printing

jerry at samba.org jerry at samba.org
Fri Mar 16 21:52:24 GMT 2007


Author: jerry
Date: 2007-03-16 21:52:21 +0000 (Fri, 16 Mar 2007)
New Revision: 21862

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21862

Log:
add the cups comment and location lookup to get_a_printer_2_default() as well
Modified:
   branches/SAMBA_3_0/source/printing/nt_printing.c
   branches/SAMBA_3_0_25/source/printing/nt_printing.c


Changeset:
Modified: branches/SAMBA_3_0/source/printing/nt_printing.c
===================================================================
--- branches/SAMBA_3_0/source/printing/nt_printing.c	2007-03-16 21:46:58 UTC (rev 21861)
+++ branches/SAMBA_3_0/source/printing/nt_printing.c	2007-03-16 21:52:21 UTC (rev 21862)
@@ -3743,10 +3743,8 @@
 ****************************************************************************/
 static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, const char *servername, const char* sharename)
 {
-	int snum;
+	int snum = lp_servicenumber(sharename);
 
-	snum = lp_servicenumber(sharename);
-
 	slprintf(info->servername, sizeof(info->servername)-1, "\\\\%s", servername);
 	slprintf(info->printername, sizeof(info->printername)-1, "\\\\%s\\%s", 
 		servername, sharename);
@@ -3769,6 +3767,15 @@
 	fstrcpy(info->printprocessor, "winprint");
 	fstrcpy(info->datatype, "RAW");
 
+#ifdef HAVE_CUPS
+	if ( (enum printing_types)lp_printing(snum) == PRINT_CUPS ) {		
+		/* Pull the location and comment strings from cups if we don't
+		   already have one */
+		if ( !strlen(info->location) || !strlen(info->comment) )
+			cups_pull_comment_location( info );
+	}
+#endif
+
 	info->attributes = PRINTER_ATTRIBUTE_SAMBA;
 
 	info->starttime = 0; /* Minutes since 12:00am GMT */

Modified: branches/SAMBA_3_0_25/source/printing/nt_printing.c
===================================================================
--- branches/SAMBA_3_0_25/source/printing/nt_printing.c	2007-03-16 21:46:58 UTC (rev 21861)
+++ branches/SAMBA_3_0_25/source/printing/nt_printing.c	2007-03-16 21:52:21 UTC (rev 21862)
@@ -3743,10 +3743,8 @@
 ****************************************************************************/
 static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, const char *servername, const char* sharename)
 {
-	int snum;
+	int snum = lp_servicenumber(sharename);
 
-	snum = lp_servicenumber(sharename);
-
 	slprintf(info->servername, sizeof(info->servername)-1, "\\\\%s", servername);
 	slprintf(info->printername, sizeof(info->printername)-1, "\\\\%s\\%s", 
 		servername, sharename);
@@ -3769,6 +3767,15 @@
 	fstrcpy(info->printprocessor, "winprint");
 	fstrcpy(info->datatype, "RAW");
 
+#ifdef HAVE_CUPS
+	if ( (enum printing_types)lp_printing(snum) == PRINT_CUPS ) {		
+		/* Pull the location and comment strings from cups if we don't
+		   already have one */
+		if ( !strlen(info->location) || !strlen(info->comment) )
+			cups_pull_comment_location( info );
+	}
+#endif
+
 	info->attributes = PRINTER_ATTRIBUTE_SAMBA;
 
 	info->starttime = 0; /* Minutes since 12:00am GMT */



More information about the samba-cvs mailing list