[gnome-color-manager] Wait three seconds after calibration for gnome-settings-daemon to pickup and parse the new profile



commit f6e3e8d1611aa83a135b4bbf09a460bc96f70c1c
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jun 28 21:39:29 2011 +0100

    Wait three seconds after calibration for gnome-settings-daemon to pickup and parse the new profile

 src/gcm-calibrate-main.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-calibrate-main.c b/src/gcm-calibrate-main.c
index adb2b9c..0ea5708 100644
--- a/src/gcm-calibrate-main.c
+++ b/src/gcm-calibrate-main.c
@@ -391,6 +391,13 @@ out:
 }
 
 static gboolean
+gcm_calib_wait_for_daemon_cb (gpointer user_data)
+{
+	g_main_loop_quit ((GMainLoop *) user_data);
+	return FALSE;
+}
+
+static gboolean
 gcm_calib_start_idle_cb (gpointer user_data)
 {
 	CdProfile *profile = NULL;
@@ -401,6 +408,7 @@ gcm_calib_start_idle_cb (gpointer user_data)
 	GError *error = NULL;
 	GFile *dest = NULL;
 	GFile *file = NULL;
+	GMainLoop *loop;
 	GtkWidget *vbox;
 	GcmCalibratePriv *calib = (GcmCalibratePriv *) user_data;
 	GtkAssistant *assistant = GTK_ASSISTANT (calib->main_window);
@@ -457,6 +465,12 @@ gcm_calib_start_idle_cb (gpointer user_data)
 		goto out;
 	}
 
+	/* wait for gnome-settings-daemon to pickup the new file */
+	loop = g_main_loop_new (NULL, FALSE);
+	g_timeout_add_seconds (3, gcm_calib_wait_for_daemon_cb, loop);
+	g_main_loop_run (loop);
+	g_main_loop_unref (loop);
+
 	/* add the new profile as the default */
 	filename_dest = g_file_get_path (dest);
 	profile = cd_client_find_profile_by_filename_sync (calib->client,



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