Hello community, here is the log from the commit of package gnome-cups-manager checked in at Sun Dec 2 14:24:10 CET 2007. -------- --- GNOME/gnome-cups-manager/gnome-cups-manager.changes 2007-11-23 17:54:06.000000000 +0100 +++ /mounts/work_src_done/STABLE/gnome-cups-manager/gnome-cups-manager.changes 2007-11-30 18:50:33.074410000 +0100 @@ -1,0 +2,6 @@ +Fri Nov 30 18:49:25 CET 2007 - crivera@suse.de + +- Remove duplicate printers from the detected list, if possible. + This fixes 215490. + +------------------------------------------------------------------- New: ---- gnome-cups-add-filter-printers.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gnome-cups-manager.spec ++++++ --- /var/tmp/diff_new_pack.b16916/_old 2007-12-02 14:23:10.000000000 +0100 +++ /var/tmp/diff_new_pack.b16916/_new 2007-12-02 14:23:10.000000000 +0100 @@ -13,7 +13,7 @@ Name: gnome-cups-manager BuildRequires: cups cups-devel fdupes gcc-c++ gnome-common gnome-icon-theme gnutls-devel intltool krb5-devel libglade2-devel libgnomecups-devel libgnomeprintui-devel libgnomeui-devel libsmbclient libsmbclient-devel libwnck-devel mDNSResponder-devel perl-XML-Parser update-desktop-files Version: 0.32 -Release: 14 +Release: 18 Url: http://www.gnome.org/ Group: System/GUI/GNOME License: GPL v2 only @@ -27,6 +27,7 @@ Patch4: gnome-cups-manager-root-queue.patch Patch5: gnome-cups-manager-icon-callback.patch Patch6: gnome-cups-manager-gcc4.3-fixes.patch +Patch7: gnome-cups-add-filter-printers.patch AutoReqProv: on Requires: gnome-icon-theme Requires: %{name}-lang = %{version} @@ -58,6 +59,7 @@ %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build sed -i "s/\(ALL_LINGUAS.*\) no /\1 /" configure.in @@ -108,6 +110,9 @@ %{_includedir}/libgnomecups-1/libgnomecups/* %changelog +* Fri Nov 30 2007 - crivera@suse.de +- Remove duplicate printers from the detected list, if possible. + This fixes 215490. * Fri Nov 23 2007 - maw@suse.de - Update gnome-cups-manager-gcc4.3-fixes.patch - Build with -fno-strict-aliasing. ++++++ gnome-cups-add-filter-printers.patch ++++++ diff -ur /usr/src/packages/BUILD/gnome-cups-manager-0.32/libgnomecups/gnome-cups-ui-connection.c ./libgnomecups/gnome-cups-ui-connection.c --- /usr/src/packages/BUILD/gnome-cups-manager-0.32/libgnomecups/gnome-cups-ui-connection.c 2007-11-30 13:32:05.000000000 -0500 +++ ./libgnomecups/gnome-cups-ui-connection.c 2007-11-30 13:32:01.000000000 -0500 @@ -147,6 +147,7 @@ char *label; char *uri; char *vendor_and_model; + char *device_id; } LocalPrinter; static void @@ -155,6 +156,7 @@ g_free (printer->label); g_free (printer->uri); g_free (printer->vendor_and_model); + g_free (printer->device_id); g_free (printer); } @@ -401,6 +403,9 @@ } else if (!strcmp (attr->name, "device-info")) { g_free (desc->label); desc->label = g_strdup (attr->values[0].string.text); + } else if (!strcmp (attr->name, "device-id")) { + g_free (desc->device_id); + desc->device_id = g_strdup (attr->values[0].string.text); } else if (!strcmp (attr->name, "device-uri")) { g_free (desc->uri); desc->uri = g_strdup (attr->values[0].string.text); @@ -954,6 +959,38 @@ } } +static gboolean +usb_printer_has_specialized_match (LocalPrinter *usb_printer, GSList *list) +{ + GSList *p; + + if (strncmp ("usb:/", usb_printer->uri, 5)) + return FALSE; + + for (p = list; p; p = p->next) { + LocalPrinter *lp = p->data; + + if (!strncmp ("usb:/", lp->uri, 5)) + continue; + + if (usb_printer->device_id && lp->device_id && + !strcmp (lp->device_id, usb_printer->device_id)) + return TRUE; + + if (usb_printer->vendor_and_model && lp->vendor_and_model) { + gchar *usb_up = g_ascii_strup (usb_printer->vendor_and_model, -1); + gchar *other_up = g_ascii_strup (lp->vendor_and_model, -1); + int ret = strcmp (usb_up, other_up); + g_free (usb_up); + g_free (other_up); + if (!ret) + return TRUE; + } + } + + return FALSE; +} + static void setup_local_connections (GCupsConnectionSelector *cs) { @@ -986,6 +1023,7 @@ selection = gtk_tree_view_get_selection (tree_view); num_detected = 0; + for (ptr = devices; ptr != NULL; ptr = ptr->next) { LocalPrinter *desc = ptr->data; if (desc->vendor_and_model @@ -995,6 +1033,13 @@ && strcmp (desc->vendor_and_model, "CANON")) { GtkTreeIter iter; + /* + * If the usb backend printer has a specialized match + * then we skip it in favor of the specialized one. + */ + if (usb_printer_has_specialized_match (desc, devices)) + continue; + gtk_list_store_append (list_store, &iter); gtk_list_store_set (list_store, &iter, 0, desc->vendor_and_model, ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de