gnome-packagekit r288 - trunk/src



Author: rhughes
Date: Tue Sep 16 19:11:50 2008
New Revision: 288
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=288&view=rev

Log:
from git

Modified:
   trunk/src/gpk-check-update.c
   trunk/src/gpk-client.c

Modified: trunk/src/gpk-check-update.c
==============================================================================
--- trunk/src/gpk-check-update.c	(original)
+++ trunk/src/gpk-check-update.c	Tue Sep 16 19:11:50 2008
@@ -71,7 +71,10 @@
 	PkTaskList		*tlist;
 	PkControl		*control;
 	GpkAutoRefresh		*arefresh;
-	GpkClient		*gclient;
+	GpkClient		*gclient_refresh_cache;
+	GpkClient		*gclient_update_system;
+	GpkClient		*gclient_get_updates;
+	GpkClient		*gclient_get_distro_upgrades;
 	GConfClient		*gconf_client;
 	gboolean		 cache_okay;
 	gboolean		 cache_update_in_progress;
@@ -303,7 +306,7 @@
 gpk_check_update_update_system (GpkCheckUpdate *cupdate)
 {
 	gboolean ret;
-	ret = gpk_client_update_system (cupdate->priv->gclient, NULL);
+	ret = gpk_client_update_system (cupdate->priv->gclient_update_system, NULL);
 
 	/* we failed, show the icon */
 	if (!ret) {
@@ -322,7 +325,7 @@
 {
 	GpkCheckUpdate *cupdate = GPK_CHECK_UPDATE (data);
 	g_return_if_fail (GPK_IS_CHECK_UPDATE (cupdate));
-	gpk_client_set_interaction (cupdate->priv->gclient, GPK_CLIENT_INTERACT_ALWAYS);
+	gpk_client_set_interaction (cupdate->priv->gclient_update_system, GPK_CLIENT_INTERACT_ALWAYS);
 	gpk_check_update_update_system (cupdate);
 }
 
@@ -403,8 +406,8 @@
 
 		/* just update the important updates */
 		package_ids = pk_package_ids_from_array (cupdate->priv->important_updates_array);
-		gpk_client_set_interaction (cupdate->priv->gclient, GPK_CLIENT_INTERACT_NEVER);
-		ret = gpk_client_update_packages (cupdate->priv->gclient, package_ids, &error);
+		gpk_client_set_interaction (cupdate->priv->gclient_update_system, GPK_CLIENT_INTERACT_NEVER);
+		ret = gpk_client_update_packages (cupdate->priv->gclient_update_system, package_ids, &error);
 		if (!ret) {
 			egg_warning ("Individual updates failed: %s", error->message);
 			g_error_free (error);
@@ -672,9 +675,9 @@
 	}
 
 	/* get updates */
-	gpk_client_set_interaction (cupdate->priv->gclient, GPK_CLIENT_INTERACT_NEVER);
+	gpk_client_set_interaction (cupdate->priv->gclient_get_updates, GPK_CLIENT_INTERACT_NEVER);
 	cupdate->priv->get_updates_in_progress = TRUE;
-	list = gpk_client_get_updates (cupdate->priv->gclient, &error);
+	list = gpk_client_get_updates (cupdate->priv->gclient_get_updates, &error);
 	cupdate->priv->get_updates_in_progress = FALSE;
 	if (list == NULL) {
 		egg_warning ("failed to get updates: %s", error->message);
@@ -770,8 +773,8 @@
 
 		/* convert */
 		package_ids = pk_package_ids_from_array (security_array);
-		gpk_client_set_interaction (cupdate->priv->gclient, GPK_CLIENT_INTERACT_NEVER);
-		ret = gpk_client_update_packages (cupdate->priv->gclient, package_ids, &error);
+		gpk_client_set_interaction (cupdate->priv->gclient_update_system, GPK_CLIENT_INTERACT_NEVER);
+		ret = gpk_client_update_packages (cupdate->priv->gclient_update_system, package_ids, &error);
 		if (!ret) {
 			egg_warning ("Individual updates failed: %s", error->message);
 			g_error_free (error);
@@ -783,7 +786,7 @@
 	/* just do everything */
 	if (update == PK_UPDATE_ENUM_ALL) {
 		egg_debug ("we should do the update automatically!");
-		gpk_client_set_interaction (cupdate->priv->gclient, GPK_CLIENT_INTERACT_NEVER);
+		gpk_client_set_interaction (cupdate->priv->gclient_update_system, GPK_CLIENT_INTERACT_NEVER);
 		g_idle_add ((GSourceFunc) gpk_check_update_update_system, cupdate);
 		goto out;
 	}
@@ -887,8 +890,8 @@
 	cupdate->priv->cache_okay = TRUE;
 
 	/* use the gnome helper to refresh the cache */
-	gpk_client_set_interaction (cupdate->priv->gclient, GPK_CLIENT_INTERACT_NEVER);
-	ret = gpk_client_refresh_cache (cupdate->priv->gclient, NULL);
+	gpk_client_set_interaction (cupdate->priv->gclient_refresh_cache, GPK_CLIENT_INTERACT_NEVER);
+	ret = gpk_client_refresh_cache (cupdate->priv->gclient_refresh_cache, NULL);
 	if (!ret) {
 		/* we failed to get the cache */
 		egg_warning ("failed to refresh cache");
@@ -935,8 +938,8 @@
 	g_return_if_fail (GPK_IS_CHECK_UPDATE (cupdate));
 
 	/* get updates */
-	gpk_client_set_interaction (cupdate->priv->gclient, GPK_CLIENT_INTERACT_ALWAYS);
-	array = gpk_client_get_distro_upgrades (cupdate->priv->gclient, &error);
+	gpk_client_set_interaction (cupdate->priv->gclient_get_distro_upgrades, GPK_CLIENT_INTERACT_NEVER);
+	array = gpk_client_get_distro_upgrades (cupdate->priv->gclient_get_distro_upgrades, &error);
 	if (array == NULL) {
 		egg_warning ("failed to get upgrades: %s", error->message);
 		g_error_free (error);
@@ -1025,7 +1028,10 @@
 				 cupdate, 0);
 
 	/* install stuff using the gnome helpers */
-	cupdate->priv->gclient = gpk_client_new ();
+	cupdate->priv->gclient_refresh_cache = gpk_client_new ();
+	cupdate->priv->gclient_update_system = gpk_client_new ();
+	cupdate->priv->gclient_get_updates = gpk_client_new ();
+	cupdate->priv->gclient_get_distro_upgrades = gpk_client_new ();
 
 	cupdate->priv->pconnection = pk_connection_new ();
 	g_signal_connect (cupdate->priv->pconnection, "connection-changed",
@@ -1072,7 +1078,10 @@
 	g_object_unref (cupdate->priv->arefresh);
 	g_object_unref (cupdate->priv->gconf_client);
 	g_object_unref (cupdate->priv->control);
-	g_object_unref (cupdate->priv->gclient);
+	g_object_unref (cupdate->priv->gclient_refresh_cache);
+	g_object_unref (cupdate->priv->gclient_update_system);
+	g_object_unref (cupdate->priv->gclient_get_updates);
+	g_object_unref (cupdate->priv->gclient_get_distro_upgrades);
 	if (cupdate->priv->important_updates_array != NULL) {
 		g_ptr_array_foreach (cupdate->priv->important_updates_array, (GFunc) g_free, NULL);
 		g_ptr_array_free (cupdate->priv->important_updates_array, TRUE);

Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c	(original)
+++ trunk/src/gpk-client.c	Tue Sep 16 19:11:50 2008
@@ -1199,7 +1199,8 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* are we dumb and can't check for depends? */
 	if (!pk_bitfield_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_REQUIRES)) {
@@ -1247,7 +1248,8 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* wait for an answer */
 	g_main_loop_run (gclient->priv->loop);
@@ -1293,7 +1295,8 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* are we dumb and can't check for depends? */
 	if (!pk_bitfield_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_DEPENDS)) {
@@ -1640,7 +1643,8 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* save the objects to download in a list */
 	list = pk_package_list_new ();
@@ -1960,7 +1964,8 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* get files to be installed */
 	catalog = pk_catalog_new ();
@@ -2069,7 +2074,8 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* if we are not showing UI, then notify the user what we are doing (just on the active terminal) */
 	ret = gconf_client_get_bool (gclient->priv->gconf_client, GPK_CONF_NOTIFY_CRITICAL, NULL);
@@ -2148,7 +2154,8 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* wait for an answer */
 	g_main_loop_run (gclient->priv->loop);
@@ -2231,7 +2238,7 @@
 	/* reset */
 	ret = pk_client_reset (gclient->priv->client_action, &error_local);
 	if (!ret) {
-		gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset get-upgrades"), error_local->message);
+		gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset get-distro-upgrades"), error_local->message);
 		gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
 		g_error_free (error_local);
 		return FALSE;
@@ -2255,7 +2262,8 @@
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
 	gpk_client_dialog_set_title (gclient->priv->dialog, _("Getting distribution upgrade information"));
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* wait for an answer */
 	g_main_loop_run (gclient->priv->loop);
@@ -2355,7 +2363,8 @@
 	/* setup the UI */
 	gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
 	gpk_client_dialog_set_title (gclient->priv->dialog, _("Update packages"));
-	gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+	if (gclient->priv->show_progress)
+		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
 
 	/* wait for an answer */
 	g_main_loop_run (gclient->priv->loop);



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