[gnome-color-manager/colord: 1/6] Remove CUPS support, it's using colord now



commit 051d234a32cb9d197f43303d52af42c15f38b3c8
Author: Richard Hughes <richard hughsie com>
Date:   Sat Jan 15 12:03:35 2011 +0000

    Remove CUPS support, it's using colord now

 configure.ac                             |   19 --
 contrib/gnome-color-manager.spec.in      |    1 -
 data/org.gnome.color-manager.gschema.xml |    5 -
 src/Makefile.am                          |    2 -
 src/gcm-client.c                         |   99 -----------
 src/gcm-device-cups.c                    |  276 ------------------------------
 src/gcm-device-cups.h                    |   61 -------
 src/gcm-utils.h                          |    1 -
 8 files changed, 0 insertions(+), 464 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f36c36b..baa88d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,25 +209,6 @@ fi
 AC_SUBST(TIFF_CFLAGS)
 AC_SUBST(TIFF_LIBS)
 
-dnl **** Check for cups ****
-AC_SUBST(CUPS_CFLAGS,"")
-AC_SUBST(CUPS_LIBS,"")
-ac_save_CPPFLAGS="$CPPFLAGS"
-ac_cups_cflags=`cups-config --cflags 2>/dev/null`
-ac_cups_libs=`cups-config --ldflags 2>/dev/null`
-CPPFLAGS="$CPPFLAGS $ac_cups_cflags"
-AC_CHECK_HEADERS(cups/cups.h,
-    [AC_CHECK_LIB(cups,cupsGetDefault,
-		  [
-			CUPS_CFLAGS="$ac_cups_cflags"
-			CUPS_LIBS="-lcups $ac_cups_libs"
-			HAVE_CUPS="yes"
-		  ],,[$ac_cups_libs])])
-CPPFLAGS="$ac_save_CPPFLAGS"
-if test "x$HAVE_CUPS" != "xyes"; then
-	AC_MSG_ERROR([cups-devel is required for gnome-color-manager])
-fi
-
 dnl ---------------------------------------------------------------------------
 dnl - Generate man pages ? (default enabled)
 dnl ---------------------------------------------------------------------------
diff --git a/contrib/gnome-color-manager.spec.in b/contrib/gnome-color-manager.spec.in
index 62c19c0..c7fc460 100644
--- a/contrib/gnome-color-manager.spec.in
+++ b/contrib/gnome-color-manager.spec.in
@@ -30,7 +30,6 @@ BuildRequires: intltool
 BuildRequires: libgudev1-devel
 BuildRequires: libXrandr-devel
 BuildRequires: lcms2-devel
-BuildRequires: cups-devel
 BuildRequires: sane-backends-devel
 BuildRequires: libtiff-devel
 BuildRequires: libexif-devel
diff --git a/data/org.gnome.color-manager.gschema.xml b/data/org.gnome.color-manager.gschema.xml
index 8fd291b..34bcee7 100644
--- a/data/org.gnome.color-manager.gschema.xml
+++ b/data/org.gnome.color-manager.gschema.xml
@@ -95,11 +95,6 @@
       <summary>If SANE support is enabled</summary>
       <description>This allows the user to disable scanner support if attached devices fail when probed.</description>
     </key>
-    <key name="enable-cups" type="b">
-      <default>true</default>
-      <summary>If CUPS support is enabled</summary>
-      <description>This allows the user to disable printer support if attached devices fail when probed.</description>
-    </key>
     <key name="profile-graph-type" enum="org.gnome.color-manager.GraphType">
       <default>'cie-1931-xy'</default>
       <summary>The graph type to show in the properties page</summary>
diff --git a/src/Makefile.am b/src/Makefile.am
index e4d5586..463b718 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,8 +54,6 @@ libgcmshared_a_SOURCES =				\
 	gcm-device-xrandr.h				\
 	gcm-device-udev.c				\
 	gcm-device-udev.h				\
-	gcm-device-cups.c				\
-	gcm-device-cups.h				\
 	gcm-device-virtual.c				\
 	gcm-device-virtual.h				\
 	gcm-cie-widget.c				\
diff --git a/src/gcm-client.c b/src/gcm-client.c
index 6cab489..5731381 100644
--- a/src/gcm-client.c
+++ b/src/gcm-client.c
@@ -32,7 +32,6 @@
 #include <glib/gi18n.h>
 #include <glib-object.h>
 #include <gudev/gudev.h>
-#include <cups/cups.h>
 
 #ifdef HAVE_SANE
  #include <sane/sane.h>
@@ -42,7 +41,6 @@
 #include "gcm-client.h"
 #include "gcm-device-xrandr.h"
 #include "gcm-device-udev.h"
-#include "gcm-device-cups.h"
 #ifdef HAVE_SANE
  #include "gcm-device-sane.h"
 #endif
@@ -73,11 +71,9 @@ struct _GcmClientPrivate
 	GUdevClient			*gudev_client;
 	GSettings			*settings;
 	GcmX11Screen			*screen;
-	http_t				*http;
 	gboolean			 loading;
 	guint				 loading_refcount;
 	gboolean			 use_threads;
-	gboolean			 init_cups;
 	gboolean			 init_sane;
 	guint				 refresh_id;
 	guint				 emit_added_id;
@@ -726,80 +722,6 @@ out:
 	return ret;
 }
 
-/**
- * gcm_client_cups_add:
- **/
-static void
-gcm_client_cups_add (GcmClient *client, cups_dest_t dest)
-{
-	gboolean ret;
-	GError *error = NULL;
-	GcmDevice *device = NULL;
-	GcmClientPrivate *priv = client->priv;
-
-	/* create new device */
-	device = gcm_device_cups_new ();
-	ret = gcm_device_cups_set_from_dest (device, priv->http, dest, &error);
-	if (!ret) {
-		g_debug ("failed to set for output: %s", error->message);
-		g_error_free (error);
-		goto out;
-	}
-
-	/* add device */
-	ret = gcm_client_add_device (client, device, &error);
-	if (!ret) {
-		g_debug ("failed to set for device: %s", error->message);
-		g_error_free (error);
-		goto out;
-	}
-out:
-	if (device != NULL)
-		g_object_unref (device);
-}
-
-/**
- * gcm_client_coldplug_devices_cups:
- **/
-static gboolean
-gcm_client_coldplug_devices_cups (GcmClient *client, GError **error)
-{
-	gint num_dests;
-	cups_dest_t *dests;
-	gint i;
-	GcmClientPrivate *priv = client->priv;
-
-	/* initialize */
-	if (!client->priv->init_cups) {
-		httpInitialize();
-		/* should be okay for localhost */
-		client->priv->http = httpConnectEncrypt (cupsServer (), ippPort (), cupsEncryption ());
-		client->priv->init_cups = TRUE;
-	}
-
-	num_dests = cupsGetDests2 (priv->http, &dests);
-	g_debug ("got %i printers", num_dests);
-
-	/* get printers on the local server */
-	for (i = 0; i < num_dests; i++)
-		gcm_client_cups_add (client, dests[i]);
-	cupsFreeDests (num_dests, dests);
-
-	/* inform the UI */
-	gcm_client_done_loading (client);
-	return TRUE;
-}
-
-/**
- * gcm_client_coldplug_devices_cups_thrd:
- **/
-static gpointer
-gcm_client_coldplug_devices_cups_thrd (GcmClient *client)
-{
-	gcm_client_coldplug_devices_cups (client, NULL);
-	return NULL;
-}
-
 #ifdef HAVE_SANE
 /**
  * gcm_client_sane_add:
@@ -930,8 +852,6 @@ gcm_client_add_unconnected_device (GcmClient *client, GKeyFile *keyfile, const g
 		device = gcm_device_virtual_new ();
 	} else if (kind == GCM_DEVICE_KIND_DISPLAY) {
 		device = gcm_device_xrandr_new ();
-	} else if (kind == GCM_DEVICE_KIND_PRINTER) {
-		device = gcm_device_cups_new ();
 	} else if (kind == GCM_DEVICE_KIND_CAMERA) {
 		/* FIXME: use GPhoto? */
 		device = gcm_device_udev_new ();
@@ -1155,22 +1075,6 @@ gcm_client_coldplug (GcmClient *client, GcmClientColdplug coldplug, GError **err
 		}
 	}
 
-	/* CUPS */
-	enable = g_settings_get_boolean (client->priv->settings, GCM_SETTINGS_ENABLE_CUPS);
-	if (enable && (!coldplug || coldplug & GCM_CLIENT_COLDPLUG_CUPS)) {
-		gcm_client_add_loading (client);
-		g_debug ("adding devices of type CUPS");
-		if (client->priv->use_threads) {
-			thread = g_thread_create ((GThreadFunc) gcm_client_coldplug_devices_cups_thrd, client, FALSE, error);
-			if (thread == NULL)
-				goto out;
-		} else {
-			ret = gcm_client_coldplug_devices_cups (client, error);
-			if (!ret)
-				goto out;
-		}
-	}
-
 #ifdef HAVE_SANE
 	/* SANE */
 	enable = g_settings_get_boolean (client->priv->settings, GCM_SETTINGS_ENABLE_SANE);
@@ -1508,7 +1412,6 @@ gcm_client_init (GcmClient *client)
 	client->priv->display_name = NULL;
 	client->priv->loading_refcount = 0;
 	client->priv->use_threads = FALSE;
-	client->priv->init_cups = FALSE;
 	client->priv->init_sane = FALSE;
 	client->priv->settings = g_settings_new (GCM_SETTINGS_SCHEMA);
 	client->priv->array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
@@ -1550,8 +1453,6 @@ gcm_client_finalize (GObject *object)
 	g_object_unref (priv->gudev_client);
 	g_object_unref (priv->screen);
 	g_object_unref (priv->settings);
-	if (client->priv->init_cups)
-		httpClose (priv->http);
 #ifdef HAVE_SANE
 	if (client->priv->init_sane)
 		sane_exit ();
diff --git a/src/gcm-utils.h b/src/gcm-utils.h
index 0d35d7d..f52391a 100644
--- a/src/gcm-utils.h
+++ b/src/gcm-utils.h
@@ -51,7 +51,6 @@
 #define GCM_SETTINGS_RECALIBRATE_PRINTER_THRESHOLD	"recalibrate-printer-threshold"
 #define GCM_SETTINGS_RECALIBRATE_DISPLAY_THRESHOLD	"recalibrate-display-threshold"
 #define GCM_SETTINGS_ENABLE_SANE			"enable-sane"
-#define GCM_SETTINGS_ENABLE_CUPS			"enable-cups"
 #define GCM_SETTINGS_PROFILE_GRAPH_TYPE			"profile-graph-type"
 
 #define GCM_CONFIG_VERSION_ORIGINAL			0



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