[gnome-system-tools] Only commit the modified OobsService instead of all of them



commit fd9f374282b6ff339ded9d75e147c0684e05dc19
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Wed Jan 27 12:48:05 2010 +0100

    Only commit the modified OobsService instead of all of them
    
    This is made possible by a change in liboobs 2.29.90: OobsService is now an OobsObject. This should fix many bugs where untouched some services were changed, sometimes stopping the machine.

 configure.in             |    2 +-
 src/services/callbacks.c |   11 ++++++-----
 src/time/time-tool.c     |    5 ++---
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/configure.in b/configure.in
index 08796e1..164edaf 100644
--- a/configure.in
+++ b/configure.in
@@ -29,7 +29,7 @@ dnl glib-genmarshal
 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 
 STB_REQUIRED=2.8
-LIBOOBS_REQUIRED=2.29.3
+LIBOOBS_REQUIRED=2.29.90
 GTK_REQUIRED=2.16
 GLIB_REQUIRED=2.15.2
 GCONF_REQUIRED=2.2.0
diff --git a/src/services/callbacks.c b/src/services/callbacks.c
index a3a938c..56c5565 100644
--- a/src/services/callbacks.c
+++ b/src/services/callbacks.c
@@ -75,7 +75,7 @@ show_settings (void)
 
 	if (response != GTK_RESPONSE_NONE) {
 		service_settings_table_save (service);
-		gst_tool_commit (tool, GST_SERVICES_TOOL (tool)->services_config);
+		gst_tool_commit (tool, OOBS_OBJECT (service));
 	}
 
 	g_object_unref (service);
@@ -162,12 +162,13 @@ on_service_toggled (GtkCellRenderer *renderer, gchar *path_str, gpointer data)
 							 (new_value) ? OOBS_SERVICE_START : OOBS_SERVICE_STOP,
 							 /* Keep previous priority, see how liboobs handles this */
 							 0);
-		gst_tool_commit (tool, GST_SERVICES_TOOL (tool)->services_config);
+		if (gst_tool_commit (tool, OOBS_OBJECT (service)) != OOBS_RESULT_OK)
+			new_value = !new_value;
 
 		gtk_list_store_set (GTK_LIST_STORE (model),
-				    &iter,
-				    COL_ACTIVE, new_value,
-				    -1);
+		                    &iter,
+		                    COL_ACTIVE, new_value,
+		                    -1);
 	}
 
 	gtk_tree_path_free (path);
diff --git a/src/time/time-tool.c b/src/time/time-tool.c
index 3ba8f5f..edb71d8 100644
--- a/src/time/time-tool.c
+++ b/src/time/time-tool.c
@@ -422,10 +422,9 @@ on_option_configuration_changed (GtkWidget *widget,
 		oobs_service_set_runlevel_configuration (time_tool->ntp_service,
 							 (OobsServicesRunlevel *) runlevel,
 							 (active) ? OOBS_SERVICE_START : OOBS_SERVICE_STOP,
-							 /* FIXME: hardcoded priority? */
-							 50);
+							 0);
 
-		gst_tool_commit_async (GST_TOOL (time_tool), time_tool->services_config,
+		gst_tool_commit_async (GST_TOOL (time_tool), OOBS_OBJECT (time_tool->ntp_service),
 				       (active) ? _("Enabling NTP") : _("Disabling NTP"),
 				       NULL, NULL);
 	}



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