~ubuntu-branches/ubuntu/oneiric/cups/oneiric

« back to all changes in this revision

Viewing changes to cups/dest.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-04-09 16:19:16 UTC
  • mto: (25.1.2 lucid) (55.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100409161916-k0e6prz52ubf4vlg
Tags: upstream-1.4.3
ImportĀ upstreamĀ versionĀ 1.4.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: dest.c 8789 2009-08-28 22:54:34Z mike $"
 
2
 * "$Id: dest.c 8938 2009-12-18 23:52:01Z mike $"
3
3
 *
4
4
 *   User-defined destination (and option) support for the Common UNIX
5
5
 *   Printing System (CUPS).
33
33
 *                           server.
34
34
 *   appleCopyLocations()  - Copy the location history array.
35
35
 *   appleCopyNetwork()    - Get the network ID for the current location.
36
 
 *   appleGetDefault()     - Get the default printer for this location.
37
36
 *   appleGetPaperSize()   - Get the default paper size.
38
37
 *   appleGetPrinter()     - Get a printer from the history array.
39
38
 *   appleSetDefault()     - Set the default printer for this location.
139
138
 
140
139
  if (!cupsGetDest(name, instance, num_dests, *dests))
141
140
  {
142
 
    if (instance &&
143
 
        (parent = cupsGetDest(name, NULL, num_dests, *dests)) == NULL)
 
141
    if (instance && !cupsGetDest(name, NULL, num_dests, *dests))
144
142
      return (num_dests);
145
143
 
146
144
    dest = cups_add_dest(name, instance, &num_dests, dests);
147
145
 
 
146
   /*
 
147
    * Find the base dest again now the array has been realloc'd.
 
148
    */
 
149
 
 
150
    parent = cupsGetDest(name, NULL, num_dests, *dests);
 
151
 
148
152
    if (instance && parent && parent->num_options > 0)
149
153
    {
150
154
     /*
549
553
 
550
554
  if (!cups_get_sdests(http, op, name, 0, &dest))
551
555
  {
552
 
    if (op == CUPS_GET_DEFAULT)
 
556
    if (op == CUPS_GET_DEFAULT || name)
553
557
      return (NULL);
554
558
 
555
559
   /*
1288
1292
  CFPropertyListRef     uselast;        /* Use last printer preference value */
1289
1293
 
1290
1294
 
 
1295
  if (getenv("CUPS_DISABLE_APPLE_DEFAULT"))
 
1296
    return (0);
 
1297
 
1291
1298
  if ((uselast = CFPreferencesCopyAppValue(kUseLastPrinterAsCurrentPrinterKey,
1292
1299
                                           kPMPrintingPreferences)) != NULL)
1293
1300
  {
2053
2060
 
2054
2061
 
2055
2062
/*
2056
 
 * End of "$Id: dest.c 8789 2009-08-28 22:54:34Z mike $".
 
2063
 * End of "$Id: dest.c 8938 2009-12-18 23:52:01Z mike $".
2057
2064
 */