gnome-cups-manager r582 - in trunk: . gnome-cups-manager libgnomecups nautilus-view



Author: stephaner
Date: Sun Oct 12 19:25:07 2008
New Revision: 582
URL: http://svn.gnome.org/viewvc/gnome-cups-manager?rev=582&view=rev

Log:
2008-10-12  StÃphane Raimbault  <stephane raimbault gmail com>

	reviewed by: Kjartan Maraas  <kmaraas gnome org>
	
	* gnome-cups-manager/eggiconlist.c:
	(egg_icon_list_set_adjustments), (egg_icon_list_queue_layout):
	* libgnomecups/gnome-cups-ui-connection.c: (ui_add_server_handler),
	(ui_add_printer_handler):
	* libgnomecups/gnome-cups-ui-driver.c: (combo_select),
	(ppd_extract_model_and_driver), (get_detected_ppd):
	* nautilus-view/nautilus-printers.c: (pause_cb), (resume_cb),
	(make_default_cb), (delete_cb):	
	Remove the g_return_* macros from static private functions. Closes
	bug #320242.


Modified:
   trunk/ChangeLog
   trunk/gnome-cups-manager/eggiconlist.c
   trunk/libgnomecups/gnome-cups-ui-connection.c
   trunk/libgnomecups/gnome-cups-ui-driver.c
   trunk/nautilus-view/nautilus-printers.c

Modified: trunk/gnome-cups-manager/eggiconlist.c
==============================================================================
--- trunk/gnome-cups-manager/eggiconlist.c	(original)
+++ trunk/gnome-cups-manager/eggiconlist.c	Sun Oct 12 19:25:07 2008
@@ -1271,11 +1271,12 @@
   gboolean need_adjust = FALSE;
 
   if (hadj)
-    g_return_if_fail (GTK_IS_ADJUSTMENT (hadj));
+    g_assert (GTK_IS_ADJUSTMENT (hadj));
   else
     hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
+
   if (vadj)
-    g_return_if_fail (GTK_IS_ADJUSTMENT (vadj));
+    g_assert (GTK_IS_ADJUSTMENT (vadj));
   else
     vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
 
@@ -1775,7 +1776,7 @@
 static void
 egg_icon_list_queue_layout (EggIconList *icon_list)
 {
-  g_return_if_fail (EGG_IS_ICON_LIST (icon_list));
+  g_assert (EGG_IS_ICON_LIST (icon_list));
 
   if (icon_list->priv->layout_idle_id != 0)
     return;

Modified: trunk/libgnomecups/gnome-cups-ui-connection.c
==============================================================================
--- trunk/libgnomecups/gnome-cups-ui-connection.c	(original)
+++ trunk/libgnomecups/gnome-cups-ui-connection.c	Sun Oct 12 19:25:07 2008
@@ -823,11 +823,11 @@
 	GtkTreeIter   iter;
 	char *name, *path;
 
-	g_return_if_fail (new_servers != NULL);
+	g_assert (new_servers != NULL);
 	name = new_servers->data;
 	new_servers = g_slist_remove (new_servers, name);
 
-	g_return_if_fail (new_servers != NULL); /* minor leak of name */
+	g_assert (new_servers != NULL); /* minor leak of name */
 	path = new_servers->data;
 	new_servers = g_slist_remove (new_servers, path);
 
@@ -847,11 +847,11 @@
 	GtkTreeIter   iter;
 	char *server, *printer;
 
-	g_return_if_fail (new_printers != NULL);
+	g_assert (new_printers != NULL);
 	server = new_printers->data;
 	new_printers = g_slist_remove (new_printers, server);
 
-	g_return_if_fail (new_printers != NULL); /* minor leak of server */
+	g_assert (new_printers != NULL); /* minor leak of server */
 	printer = new_printers->data;
 	new_printers = g_slist_remove (new_printers, printer);
 

Modified: trunk/libgnomecups/gnome-cups-ui-driver.c
==============================================================================
--- trunk/libgnomecups/gnome-cups-ui-driver.c	(original)
+++ trunk/libgnomecups/gnome-cups-ui-driver.c	Sun Oct 12 19:25:07 2008
@@ -79,10 +79,9 @@
 	GtkComboBox	*combo = (GtkComboBox *)glade_xml_get_widget (xml, name);
 	GtkTreeModel	*model = gtk_combo_box_get_model (combo);
 
-	g_return_val_if_fail (model != NULL, FALSE);
-
 	if (!gtk_tree_model_get_iter_first (model, &iter))
 		return FALSE;
+
 	do {
 		gtk_tree_model_get (model, &iter, col, &tmp, -1);
 		if (tmp != NULL && target != NULL && 0 == strcmp (tmp, target)) {
@@ -303,7 +302,7 @@
 	if (NULL == without_vendor)
 		without_vendor = (char *)ppd->nickname;
 
-	g_return_if_fail (without_vendor != NULL);
+	g_assert (without_vendor != NULL);
 
 	/* gimp-print ijs models (suse, debian)
 	 * 	<model> Foomatic/gimp-print-ijs */
@@ -584,7 +583,7 @@
 	g_slist_free (models);
 
 	model_hash = g_hash_table_lookup (ds->vendors, vendor);
-	g_return_val_if_fail (model_hash != NULL, NULL);
+	g_assert (model_hash != NULL);
 	drivers = g_hash_table_lookup (model_hash, ppd_model);
 
 	g_free (vendor);

Modified: trunk/nautilus-view/nautilus-printers.c
==============================================================================
--- trunk/nautilus-view/nautilus-printers.c	(original)
+++ trunk/nautilus-view/nautilus-printers.c	Sun Oct 12 19:25:07 2008
@@ -689,7 +689,7 @@
         selection = nautilus_icon_container_get_selection (NAUTILUS_ICON_CONTAINER (container));
         for (l = selection; l != NULL; l = l->next) {
                 GError *error = NULL;
-                g_return_if_fail (l->data != NEW_PRINTER_ICON);
+                g_assert (l->data != NEW_PRINTER_ICON);
                 printer = GNOME_CUPS_PRINTER (l->data);
                 gnome_cups_printer_pause (printer, &error);
                 if (error) {
@@ -718,7 +718,7 @@
         selection = nautilus_icon_container_get_selection (NAUTILUS_ICON_CONTAINER (container));
         for (l = selection; l != NULL; l = l->next) {
                 GError *error = NULL;
-                g_return_if_fail (l->data != NEW_PRINTER_ICON);
+                g_assert (l->data != NEW_PRINTER_ICON);
                 printer = GNOME_CUPS_PRINTER (l->data);
                 gnome_cups_printer_resume (printer, &error);
                 if (error) {
@@ -745,8 +745,8 @@
         container = user_data;
 
         selection = nautilus_icon_container_get_selection (NAUTILUS_ICON_CONTAINER (container));
-        g_return_if_fail (g_list_length (selection) == 1);
-        g_return_if_fail (selection->data != NEW_PRINTER_ICON);
+        g_assert (g_list_length (selection) == 1);
+        g_assert (selection->data != NEW_PRINTER_ICON);
         
         printer = GNOME_CUPS_PRINTER (selection->data);
         gnome_cups_printer_set_default (printer, &error);
@@ -775,7 +775,7 @@
         selection = nautilus_icon_container_get_selection (NAUTILUS_ICON_CONTAINER (container));
         for (l = selection; l != NULL; l = l->next) {
                 GError *error = NULL;
-                g_return_if_fail (l->data != NEW_PRINTER_ICON);
+                g_assert (l->data != NEW_PRINTER_ICON);
                 printer = GNOME_CUPS_PRINTER (l->data);
                 gnome_cups_printer_delete (printer, &error);                
                 if (error) {



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