1 diff -up cups-1.4b1/backend/ipp.c.eggcups cups-1.4b1/backend/ipp.c
2 --- cups-1.4b1/backend/ipp.c.eggcups 2008-10-15 19:27:45.000000000 +0100
3 +++ cups-1.4b1/backend/ipp.c 2008-11-11 15:43:30.000000000 +0000
4 @@ -51,6 +51,70 @@ static char pstmpname[1024] = ""; /* Tem
5 static char tmpfilename[1024] = ""; /* Temporary spool file name */
6 static int job_cancelled = 0; /* Job cancelled? */
9 +#include <dbus/dbus.h>
11 +static DBusConnection *dbus_connection = NULL;
16 + DBusConnection *connection;
19 + if (dbus_connection &&
20 + !dbus_connection_get_is_connected (dbus_connection)) {
21 + dbus_connection_unref (dbus_connection);
22 + dbus_connection = NULL;
25 + dbus_error_init (&error);
26 + connection = dbus_bus_get (getuid () ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error);
27 + if (connection == NULL) {
28 + dbus_error_free (&error);
32 + dbus_connection = connection;
37 +dbus_broadcast_queued_remote (const char *printer_uri,
38 + ipp_status_t status,
39 + unsigned int local_job_id,
40 + unsigned int remote_job_id,
41 + const char *username,
42 + const char *printer_name)
44 + DBusMessage *message;
45 + DBusMessageIter iter;
48 + if (!dbus_connection || !dbus_connection_get_is_connected (dbus_connection)) {
49 + if (init_dbus () || !dbus_connection)
53 + errstr = ippErrorString (status);
54 + message = dbus_message_new_signal ("/com/redhat/PrinterSpooler",
55 + "com.redhat.PrinterSpooler",
57 + dbus_message_iter_init_append (message, &iter);
58 + dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_uri);
59 + dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &errstr);
60 + dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &local_job_id);
61 + dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &remote_job_id);
62 + dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &username);
63 + dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_name);
65 + dbus_connection_send (dbus_connection, message, NULL);
66 + dbus_connection_flush (dbus_connection);
67 + dbus_message_unref (message);
71 +#endif /* HAVE_DBUS */
75 @@ -1058,6 +1122,15 @@ main(int argc, /* I - Number of comm
80 + dbus_broadcast_queued_remote (argv[0],
85 + getenv ("PRINTER"));
86 +#endif /* HAVE_DBUS */
91 diff -up cups-1.4b1/backend/Makefile.eggcups cups-1.4b1/backend/Makefile
92 --- cups-1.4b1/backend/Makefile.eggcups 2008-10-06 22:08:27.000000000 +0100
93 +++ cups-1.4b1/backend/Makefile 2008-11-11 15:45:31.000000000 +0000
94 @@ -188,7 +188,7 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbac
96 ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
98 - $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
99 + $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS) $(CUPSDLIBS)
103 diff -up cups-1.4b1/scheduler/subscriptions.c.eggcups cups-1.4b1/scheduler/subscriptions.c
104 --- cups-1.4b1/scheduler/subscriptions.c.eggcups 2008-08-01 22:11:55.000000000 +0100
105 +++ cups-1.4b1/scheduler/subscriptions.c 2008-11-11 15:43:30.000000000 +0000
106 @@ -1302,13 +1302,13 @@ cupsd_send_dbus(cupsd_eventmask_t event,
107 what = "PrinterAdded";
108 else if (event & CUPSD_EVENT_PRINTER_DELETED)
109 what = "PrinterRemoved";
110 - else if (event & CUPSD_EVENT_PRINTER_CHANGED)
111 - what = "QueueChanged";
112 else if (event & CUPSD_EVENT_JOB_CREATED)
113 what = "JobQueuedLocal";
114 else if ((event & CUPSD_EVENT_JOB_STATE) && job &&
115 job->state_value == IPP_JOB_PROCESSING)
116 what = "JobStartedLocal";
117 + else if (event & (CUPSD_EVENT_PRINTER_CHANGED|CUPSD_EVENT_JOB_STATE_CHANGED|CUPSD_EVENT_PRINTER_STATE_CHANGED))
118 + what = "QueueChanged";
122 @@ -1344,7 +1344,7 @@ cupsd_send_dbus(cupsd_eventmask_t event,
123 dbus_message_append_iter_init(message, &iter);
125 dbus_message_iter_append_string(&iter, dest->name);
127 + if (job && strcmp (what, "QueueChanged") != 0)
129 dbus_message_iter_append_uint32(&iter, job->id);
130 dbus_message_iter_append_string(&iter, job->username);