gnome-cups-manager r573 - in trunk: . gnome-cups-add gnome-cups-manager libgnomecups/snmpkit



Author: jpr
Date: Tue Apr  1 19:25:22 2008
New Revision: 573
URL: http://svn.gnome.org/viewvc/gnome-cups-manager?rev=573&view=rev

Log:
2008-04-01  JP Rosevear  <jpr novell com>

	* gnome-cups-add/add-printer.c: strip more special chars out of
	the model name for compare

	* libgnomecups/snmpkit/snmpkit: Fix build under gcc 4.3

	* gnome-cups-manager/printer-properties.c (create_option_editor):
	Update status properly in adminstrator mode (bnc #154299)



Modified:
   trunk/ChangeLog
   trunk/gnome-cups-add/add-printer.c
   trunk/gnome-cups-manager/printer-properties.c
   trunk/libgnomecups/snmpkit/snmpkit
   trunk/libgnomecups/snmpkit/structfill.C

Modified: trunk/gnome-cups-add/add-printer.c
==============================================================================
--- trunk/gnome-cups-add/add-printer.c	(original)
+++ trunk/gnome-cups-add/add-printer.c	Tue Apr  1 19:25:22 2008
@@ -186,7 +186,7 @@
 	name = g_strdup (ppd->model);
 	/* strip out the spaces */
 	for (ptr = name ; *ptr ; ptr++)
-		if (*ptr == ' ')
+		if (*ptr == ' ' || *ptr == '/' || *ptr == '(' || *ptr == ')')
 			*ptr = '-';
 
 	existing = gnome_cups_get_printers ();

Modified: trunk/gnome-cups-manager/printer-properties.c
==============================================================================
--- trunk/gnome-cups-manager/printer-properties.c	(original)
+++ trunk/gnome-cups-manager/printer-properties.c	Tue Apr  1 19:25:22 2008
@@ -466,6 +466,14 @@
 	g_object_unref (relation_set);
 }
 
+static void
+printer_attributes_changed_cb (GnomeCupsPrinter *printer, gpointer user_data)
+{
+	GladeXML *xml = GLADE_XML (user_data);
+
+	update_general_page (xml);
+}
+
 static GtkWidget *
 create_option_editor (GladeXML *xml,
 		      GnomeCupsPrinter *printer,
@@ -696,6 +704,8 @@
 				printer, g_object_unref);
 	g_signal_connect_object (printer, "gone",
 				 G_CALLBACK (printer_gone_cb), xml, 0);
+	g_signal_connect_object (printer, "attributes_changed",
+				 G_CALLBACK (printer_attributes_changed_cb), xml, 0);
 
 	g_object_weak_ref (G_OBJECT (xml), disconnect_view, printer);
 

Modified: trunk/libgnomecups/snmpkit/snmpkit
==============================================================================
--- trunk/libgnomecups/snmpkit/snmpkit	(original)
+++ trunk/libgnomecups/snmpkit/snmpkit	Tue Apr  1 19:25:22 2008
@@ -31,6 +31,7 @@
 #include <netdb.h>
 #include <pthread.h>
 
+#include <cstring>
 #include <string>
 #include <list>
 #include <functional>

Modified: trunk/libgnomecups/snmpkit/structfill.C
==============================================================================
--- trunk/libgnomecups/snmpkit/structfill.C	(original)
+++ trunk/libgnomecups/snmpkit/structfill.C	Tue Apr  1 19:25:22 2008
@@ -28,7 +28,8 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
+#include <ios>
 #include <algorithm>
 
 #include "snmpkit"
@@ -91,22 +92,22 @@
 	 counters or large ints */
       if(curber->type()==INT_TAG && cur->type==COUNTER_TAG)
 	// these errors are minor enough and simple enough to fix
-	cerr << "Warning: Counter returned when Integer expected for " 
+	std::cerr << "Warning: Counter returned when Integer expected for " 
 	     << cur->oidstr << " Buggy firmware?\n";
       else if(curber->type()==COUNTER_TAG && cur->type==INT_TAG)
 	// these errors are minor enough and simple enough to fix
-	cerr << "Warning: Integer returned when Counter expected for "
+	std::cerr << "Warning: Integer returned when Counter expected for "
 	     << cur->oidstr << " Buggy firmware?\n";
       else{
-	ios::fmtflags opts=ios::hex;
-	opts=cerr.flags(opts);
-	cerr << "Warning: Printer returned a value of type 0x"
+	std::ios::fmtflags opts=std::ios::hex;
+	opts=std::cerr.flags(opts);
+        std::cerr << "Warning: Printer returned a value of type 0x"
 	     << static_cast<long unsigned int>(curber->type()) 
 	     << " when a value of 0x" 
 	     << static_cast<long unsigned int>(cur->type)
 	     << " was expected for " << cur->oidstr 
 	     << " Buggy firmware? Skipping.\n";
-	cerr.flags(opts);
+	std::cerr.flags(opts);
 	retval=0;
 	break;
       }
@@ -177,7 +178,7 @@
     throw SNMPNoResponseException();
 
   if(!fillStruct(retseq,(unsigned char*)tobefilled)){
-    cerr << "Warning: printer did not respond with a value for one of the "
+    std::cerr << "Warning: printer did not respond with a value for one of the "
 	 << "OIDs. Buggy firmware?\n";
     return NULL;
   }



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