summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-10-18 19:08:55 +0200
committerBenjamin Otte <otte@redhat.com>2010-10-18 19:22:44 +0200
commit9e31ef616d97c778f5df050ef492dac268cbd4ca (patch)
tree6584f9c05f1c7c4cf2ceba772804b626fc0e53df /modules
parent3b8a264a5efbd2509d1286c9c367ec181cf34356 (diff)
downloadgtk+-9e31ef616d97c778f5df050ef492dac268cbd4ca.tar.gz
cups: Add hack to work around gcc warning
gcc warns if you switch on values that are not part of the enum you're switching on. So handle those cases in the default handler by using if statments. PS: Someone file a bug against cups about this?
Diffstat (limited to 'modules')
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 2486c20721..1b83e32e61 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -845,9 +845,6 @@ request_password (gpointer data)
switch (dispatch->request->ipp_request->request.op.operation_id)
{
- case 0:
- prompt = g_strdup_printf ( _("Authentication is required to get a file from %s"), hostname);
- break;
case IPP_PRINT_JOB:
if (job_title != NULL && printer_name != NULL)
prompt = g_strdup_printf ( _("Authentication is required to print document '%s' on printer %s"), job_title, printer_name);
@@ -873,7 +870,11 @@ request_password (gpointer data)
prompt = g_strdup_printf ( _("Authentication is required to get printers from %s"), hostname);
break;
default:
- prompt = g_strdup_printf ( _("Authentication is required on %s"), hostname);
+ /* work around gcc warning about 0 not being a value for this enum */
+ if (dispatch->request->ipp_request->request.op.operation_id == 0)
+ prompt = g_strdup_printf ( _("Authentication is required to get a file from %s"), hostname);
+ else
+ prompt = g_strdup_printf ( _("Authentication is required on %s"), hostname);
break;
}