Patch for print plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is a patch for the print plugin. The patch fixes an anoyance with the
print dialog: If you have lots of printers (we have about 50 here), it takes
*several minutes* to open. Fix: Just use lpstat -d -v (just list the names of
the printers instead of checking if they are enabled; the information is
discarded anyway). Later, when it becomes clear that we can use that info,
we can reenable it again (including some kind of caching and a progress
report which shows that Gimp is still doing something).

*** gimp-1.1.16/plug-ins/print/print.c~	Mon Jan 31 03:32:25 2000
--- gimp-1.1.16/plug-ins/print/print.c	Tue Feb  8 15:51:56 2000
***************
*** 3146,3152 ****
  #endif /* LPC_COMMAND */
  
  #ifdef LPSTAT_COMMAND
!   if ((pfile = popen(LPSTAT_COMMAND " -d -p", "r")) != NULL)
    {
      char name[17];	
  	
--- 3146,3152 ----
  #endif /* LPC_COMMAND */
  
  #ifdef LPSTAT_COMMAND
!   if ((pfile = popen(LPSTAT_COMMAND " -v -d", "r")) != NULL)
    {
      char name[17];	
  	
***************
*** 3153,3159 ****
      while (fgets(line, sizeof(line), pfile) != NULL &&
             plist_count < MAX_PLIST)
      {
!       if (sscanf(line, "printer %s", name) == 1)
        {
  	strcpy(plist[plist_count].name, name);
  	sprintf(plist[plist_count].v.output_to, LP_COMMAND " -s -d%s", name);
--- 3153,3159 ----
      while (fgets(line, sizeof(line), pfile) != NULL &&
             plist_count < MAX_PLIST)
      {
!       if (sscanf(line, "system for %[^:]s:", name) == 1)
        {
  	strcpy(plist[plist_count].name, name);
  	sprintf(plist[plist_count].v.output_to, LP_COMMAND " -s -d%s", name);

-- 
Dipl. Inf. (FH) Aaron "Optimizer" Digulla
"(to) optimize: Make a program faster by
improving the algorithms rather than by       
buying a faster machine."                     


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux