[gnome-color-manager] trivial: fix make check



commit a59f62a51b73224fb2fcc621f1bd6d203a5623a9
Author: Richard Hughes <richard hughsie com>
Date:   Mon Mar 1 11:40:26 2010 +0000

    trivial: fix make check

 help/C/gnome-color-manager.xml |    8 +++++---
 po/POTFILES.in                 |    6 ++++--
 src/gcm-calibrate.c            |    2 +-
 src/gcm-device.c               |    3 ++-
 src/gcm-print.c                |   30 ++++++++++++++++--------------
 src/gcm-self-test.c            |    2 +-
 6 files changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/help/C/gnome-color-manager.xml b/help/C/gnome-color-manager.xml
index 69a0378..4788653 100644
--- a/help/C/gnome-color-manager.xml
+++ b/help/C/gnome-color-manager.xml
@@ -137,9 +137,11 @@
     <systemitem>GNOME desktop</systemitem>. 
   </para>
   <warning>
-    &app; should NOT be used to alter the appearance of your desktop.
-    The Appearance preference tool lets you configure various aspects
-    of how your desktop looks.
+    <para>
+      &app; should NOT be used to alter the appearance of your desktop.
+      The Appearance preference tool lets you configure various aspects
+      of how your desktop looks.
+    </para>
   </warning>
 
 </section>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index d58b084..53f596d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,15 +6,17 @@ policy/org.gnome.color.policy.in
 src/egg-debug.c
 src/gcm-calibrate-argyll.c
 src/gcm-calibrate.c
+src/gcm-calibrate-dialog.c
 src/gcm-calibrate-manual.c
 src/gcm-client.c
+src/gcm-colorimeter.c
+src/gcm-device-xrandr.c
 src/gcm-dump-edid.c
 src/gcm-dump-profile.c
-src/gcm-device-xrandr.c
 src/gcm-fix-profile.c
-src/gcm-install-system-wide.c
 src/gcm-import.c
 src/gcm-inspect.c
+src/gcm-install-system-wide.c
 src/gcm-prefs.c
 src/gcm-profile.c
 src/gcm-session.c
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index 6c2429b..9e36cf7 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -1354,8 +1354,8 @@ gcm_calibrate_finalize (GObject *object)
 	g_free (priv->device);
 	g_free (priv->serial);
 	g_free (priv->working_path);
-	g_object_unref (priv->colorimeter);
 	g_signal_handlers_disconnect_by_func (calibrate->priv->colorimeter, G_CALLBACK (gcm_prefs_colorimeter_changed_cb), calibrate);
+	g_object_unref (priv->colorimeter);
 	g_object_unref (priv->calibrate_dialog);
 
 	G_OBJECT_CLASS (gcm_calibrate_parent_class)->finalize (object);
diff --git a/src/gcm-device.c b/src/gcm-device.c
index efe14f9..ca67a5f 100644
--- a/src/gcm-device.c
+++ b/src/gcm-device.c
@@ -778,6 +778,7 @@ gcm_device_test (EggTest *test)
 		      "connected", TRUE,
 		      "virtual", FALSE,
 		      "serial", "0123456789",
+		      "colorspace", GCM_COLORSPACE_ENUM_RGB,
 		      NULL);
 
 	/************************************************************/
@@ -871,7 +872,7 @@ gcm_device_test (EggTest *test)
 
 	/************************************************************/
 	egg_test_title (test, "check data");
-	if (g_strcmp0 (data, "\n[sysfs_dummy_device]\nprofile=/srv/sysfs_canon_canoscan.icc\nserial=0123456789\ntype=scanner\n") == 0)
+	if (g_strcmp0 (data, "\n[sysfs_dummy_device]\nprofile=/srv/sysfs_canon_canoscan.icc\nserial=0123456789\ntype=scanner\ncolorspace=rgb\n") == 0)
 		egg_test_success (test, NULL);
 	else
 		egg_test_failed (test, "invalid data: %s", data);
diff --git a/src/gcm-print.c b/src/gcm-print.c
index cc31702..a245226 100644
--- a/src/gcm-print.c
+++ b/src/gcm-print.c
@@ -66,6 +66,7 @@ typedef struct {
 	gpointer		 user_data;
 	GMainLoop		*loop;
 	gboolean		 aborted;
+	GError			*error;
 } GcmPrintTask;
 
 /**
@@ -100,16 +101,14 @@ static void
 gcm_print_begin_print_cb (GtkPrintOperation *operation, GtkPrintContext *context, GcmPrintTask *task)
 {
 	GtkPageSetup *page_setup;
-	GError *error = NULL;
 
 	/* get the page details */
 	page_setup = gtk_print_context_get_page_setup (context);
 
 	/* get the list of files */
-	task->filenames = task->render_callback (task->print, page_setup, task->user_data, &error);
+	task->filenames = task->render_callback (task->print, page_setup, task->user_data, &task->error);
 	if (task->filenames == NULL) {
-		egg_warning ("failed to render pages: %s", error->message);
-		g_error_free (error);
+		gtk_print_operation_cancel (operation);
 		goto out;
 	}
 
@@ -131,7 +130,6 @@ gcm_print_draw_page_cb (GtkPrintOperation *operation, GtkPrintContext *context,
 	cairo_t *cr;
 	gdouble width = 0.0f;
 	gdouble height = 0.0f;
-	GError *error = NULL;
 	const gchar *filename;
 	GdkPixbuf *pixbuf = NULL;
 	cairo_surface_t *surface = NULL;
@@ -144,10 +142,8 @@ gcm_print_draw_page_cb (GtkPrintOperation *operation, GtkPrintContext *context,
 
 	/* load pixbuf, which we've already prepared */
 	filename = g_ptr_array_index (task->filenames, page_nr);
-	pixbuf = gdk_pixbuf_new_from_file (filename, &error);
+	pixbuf = gdk_pixbuf_new_from_file (filename, &task->error);
 	if (pixbuf == NULL) {
-		egg_warning ("failed to load image: %s", error->message);
-		g_error_free (error);
 		gtk_print_operation_cancel (operation);
 		goto out;
 	}
@@ -203,6 +199,11 @@ gcm_print_status_changed_cb (GtkPrintOperation *operation, GcmPrintTask *task)
 		g_idle_add ((GSourceFunc) gcm_print_loop_quit_idle_cb, task);
 	} else if (status == GTK_PRINT_STATUS_FINISHED_ABORTED) {
 		task->aborted = TRUE;
+
+		/* we failed, and didn't set an error */
+		if (task->error == NULL)
+			g_set_error (&task->error, 1, 0, "printing was aborted, and no error was set");
+
 		egg_debug ("printing aborted");
 		g_idle_add ((GSourceFunc) gcm_print_loop_quit_idle_cb, task);
 	}
@@ -279,11 +280,10 @@ gcm_print_with_render_callback (GcmPrint *print, GtkWindow *window, GcmPrintRend
 	/* wait for finished or abort */
 	g_main_loop_run (task->loop);
 
-	/* we failed */
-	if (task->aborted) {
-		g_set_error (error, 1, 0, "printing was aborted");
+	/* pass on error */
+	if (task->error != NULL) {
+		g_set_error_literal (error, 1, 0, task->error->message);
 		ret = FALSE;
-		goto out;
 	}
 out:
 	if (task->filenames != NULL)
@@ -292,6 +292,8 @@ out:
 		g_object_unref (task->print);
 	if (task->loop != NULL)
 		g_main_loop_unref (task->loop);
+	if (task->error != NULL)
+		g_error_free (task->error);
 	g_free (task);
 	g_object_unref (operation);
 	return ret;
@@ -345,8 +347,8 @@ gcm_print_test_render_cb (GcmPrint *print,  GtkPageSetup *page_setup, gpointer u
 {
 	GPtrArray *filenames;
 	filenames = g_ptr_array_new_with_free_func (g_free);
-	g_ptr_array_add (filenames, g_strdup ("/home/hughsie/Desktop/DSC_2182.tif"));
-	g_ptr_array_add (filenames, g_strdup ("/home/hughsie/Desktop/DSC_2182-2.tif"));
+	g_ptr_array_add (filenames, egg_test_get_data_file ("image-widget-nonembed.png"));
+	g_ptr_array_add (filenames, egg_test_get_data_file ("image-widget-good.png"));
 	return filenames;
 }
 
diff --git a/src/gcm-self-test.c b/src/gcm-self-test.c
index 863c392..f0f9ce9 100644
--- a/src/gcm-self-test.c
+++ b/src/gcm-self-test.c
@@ -52,7 +52,6 @@ main (int argc, char **argv)
 	egg_debug_init (&argc, &argv);
 
 	/* components */
-	gcm_print_test (test);
 	gcm_calibrate_test (test);
 	gcm_edid_test (test);
 	gcm_tables_test (test);
@@ -67,6 +66,7 @@ main (int argc, char **argv)
 	gcm_cie_widget_test (test);
 	gcm_gamma_widget_test (test);
 	gcm_image_test (test);
+	gcm_print_test (test);
 //	gcm_calibrate_manual_test (test);
 
 	return (egg_test_finish (test));



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