summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-12-27 06:49:49 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-12-27 06:49:49 +0000
commitc5ef6f4b39c801bdf864d92ccf107c58da594d4a (patch)
tree10a0f95d22a31ccebe216895a8d92145edd90774 /modules
parent6ef83209bdd09c43eb98e8340ccc2a18d09a098b (diff)
downloadgtk+-c5ef6f4b39c801bdf864d92ccf107c58da594d4a.tar.gz
Use getters for http fields where available. (#364866, Björn Lindqvist)
2006-12-27 Matthias Clasen <mclasen@redhat.com> * modules/printbackends/cups/gtkprintbackendcups.c: Use getters for http fields where available. (#364866, Björn Lindqvist)
Diffstat (limited to 'modules')
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 5aab327f47..8351325fb4 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -270,7 +270,7 @@ _cairo_write_to_cups (void *closure,
while (length > 0)
{
- g_io_channel_write_chars (io, data, length, &written, &error);
+ g_io_channel_write_chars (io, (gchar *)data, length, &written, &error);
if (error != NULL)
{
@@ -503,27 +503,24 @@ cups_dispatch_watch_check (GSource *source)
dispatch = (GtkPrintCupsDispatchWatch *) source;
poll_state = gtk_cups_request_get_poll_state (dispatch->request);
-
- if (dispatch->data_poll == NULL &&
- dispatch->request->http != NULL)
- {
- dispatch->data_poll = g_new0 (GPollFD, 1);
- dispatch->data_poll->fd = dispatch->request->http->fd;
- g_source_add_poll (source, dispatch->data_poll);
- }
-
- if (dispatch->data_poll != NULL && dispatch->request->http != NULL)
+ if (dispatch->request->http != NULL)
{
- if (dispatch->data_poll->fd != dispatch->request->http->fd)
- dispatch->data_poll->fd = dispatch->request->http->fd;
-
- if (poll_state == GTK_CUPS_HTTP_READ)
- dispatch->data_poll->events = G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI;
- else if (poll_state == GTK_CUPS_HTTP_WRITE)
- dispatch->data_poll->events = G_IO_OUT | G_IO_ERR;
+ if (dispatch->data_poll == NULL)
+ {
+ dispatch->data_poll = g_new0 (GPollFD, 1);
+ g_source_add_poll (source, dispatch->data_poll);
+ }
else
- dispatch->data_poll->events = 0;
+ {
+ if (poll_state == GTK_CUPS_HTTP_READ)
+ dispatch->data_poll->events = G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI;
+ else if (poll_state == GTK_CUPS_HTTP_WRITE)
+ dispatch->data_poll->events = G_IO_OUT | G_IO_ERR;
+ else
+ dispatch->data_poll->events = 0;
+ }
+ dispatch->data_poll->fd = httpGetFd (dispatch->request->http);
}
if (poll_state != GTK_CUPS_HTTP_IDLE)