]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Write printcap file as needed from callers to add/delete printer/class and
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 24 Nov 2005 22:28:43 +0000 (22:28 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 24 Nov 2005 22:28:43 +0000 (22:28 +0000)
change of default printer (also fixes STR #1346)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@4854 7a7537e8-13f0-0310-91df-b6672ffda945

scheduler/conf.c
scheduler/dirsvc.c
scheduler/ipp.c
scheduler/printers.c

index e586742213b7279b69eb33a7311ba4498d83d434..546fcee33f816bec644e10417e303e763f82e079 100644 (file)
@@ -994,6 +994,7 @@ cupsdReadConfiguration(void)
     cupsdLoadAllPrinters();
     cupsdLoadAllClasses();
     cupsdLoadRemoteCache();
+    cupsdWritePrintcap();
 
     cupsdCreateCommonData();
 
@@ -1024,6 +1025,7 @@ cupsdReadConfiguration(void)
     */
 
     cupsdUpdatePrinters();
+    cupsdWritePrintcap();
 
     cupsdLogMessage(CUPSD_LOG_INFO, "Partial reload complete.");
   }
index 173fd270471b9e3f8bf7d032a4537df10aef92fd..61a9e53296fbb9edf2d1baacd9ca04829ecb5a02 100644 (file)
@@ -852,17 +852,19 @@ cupsdProcessBrowseData(
   */
 
   if (DefaultPrinter == NULL && Printers != NULL)
-  {
     DefaultPrinter = (cupsd_printer_t *)cupsArrayFirst(Printers);
 
-    cupsdWritePrintcap();
-  }
-
  /*
   * Do auto-classing if needed...
   */
 
   cupsdProcessImplicitClasses();
+
+ /*
+  * Update the printcap file...
+  */
+
+  cupsdWritePrintcap();
 }
 
 
index 9892f0f808f8831bf981ea34c41effbb244192b8..da68a4cc9573f2b9d7ebce189a74c02df5949dd0 100644 (file)
@@ -4804,6 +4804,8 @@ delete_printer(cupsd_client_t  *con,      /* I - Client connection */
     cupsdSaveAllPrinters();
   }
 
+  cupsdWritePrintcap();
+
  /*
   * Return with no errors...
   */
@@ -8422,6 +8424,8 @@ set_default(cupsd_client_t  *con, /* I - Client connection */
   cupsdSaveAllPrinters();
   cupsdSaveAllClasses();
 
+  cupsdWritePrintcap();
+
   cupsdLogMessage(CUPSD_LOG_INFO,
                   "Default destination set to \'%s\' by \'%s\'.", name,
                   con->username);
index 96c030e0fb58490af482b351c70e0ec96f879220..4418f81513c28daed346e296be10c3ad0d6e1f98 100644 (file)
@@ -131,12 +131,6 @@ cupsdAddPrinter(const char *name)  /* I - Name of printer */
   if (!ImplicitPrinters)
     ImplicitPrinters = cupsArrayNew(compare_printers, NULL);
 
- /*
-  * Write a new /etc/printcap or /var/spool/lp/pstatus file.
-  */
-
-  cupsdWritePrintcap();
-
  /*
   * Return the new printer...
   */
@@ -714,12 +708,8 @@ cupsdDeletePrinter(
   */
 
   if (p == DefaultPrinter)
-  {
     DefaultPrinter = (cupsd_printer_t *)cupsArrayFirst(Printers);
 
-    cupsdWritePrintcap();
-  }
-
  /*
   * Remove this printer from any classes and send a browse delete message...
   */
@@ -769,12 +759,6 @@ cupsdDeletePrinter(
   cupsdClearString(&p->error_policy);
 
   free(p);
-
- /*
-  * Write a new /etc/printcap file...
-  */
-
-  cupsdWritePrintcap();
 }