gnome-packagekit r290 - trunk/src



Author: rhughes
Date: Wed Sep 17 10:53:44 2008
New Revision: 290
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=290&view=rev

Log:
from git

Modified:
   trunk/src/gpk-application.c
   trunk/src/gpk-client-resolve.c
   trunk/src/gpk-client.c
   trunk/src/gpk-common.c
   trunk/src/gpk-common.h
   trunk/src/gpk-install-catalog.c
   trunk/src/gpk-install-mime-type.c
   trunk/src/gpk-install-package-name.c
   trunk/src/gpk-install-provide-file.c
   trunk/src/gpk-interface.h
   trunk/src/gpk-update-icon.c
   trunk/src/gpk-update-viewer.c
   trunk/src/gpk-watch.c

Modified: trunk/src/gpk-application.c
==============================================================================
--- trunk/src/gpk-application.c	(original)
+++ trunk/src/gpk-application.c	Wed Sep 17 10:53:44 2008
@@ -1577,7 +1577,7 @@
 
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
-	package_ids = pk_package_list_to_argv (application->priv->package_list);
+	package_ids = pk_package_list_to_strv (application->priv->package_list);
 	if (application->priv->action == PK_ACTION_INSTALL) {
 		gpk_client_show_finished (application->priv->gclient, FALSE);
 		ret = gpk_client_install_package_ids (application->priv->gclient, package_ids, NULL);

Modified: trunk/src/gpk-client-resolve.c
==============================================================================
--- trunk/src/gpk-client-resolve.c	(original)
+++ trunk/src/gpk-client-resolve.c	Wed Sep 17 10:53:44 2008
@@ -120,7 +120,7 @@
 	}
 
 	/* convert to data */
-	package_ids = pk_package_list_to_argv (list);
+	package_ids = pk_package_list_to_strv (list);
 	g_object_unref (list);
 
 out:

Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c	(original)
+++ trunk/src/gpk-client.c	Wed Sep 17 10:53:44 2008
@@ -1714,7 +1714,7 @@
 	}
 
 	/* convert to list of package id's */
-	package_ids = pk_package_list_to_argv (list);
+	package_ids = pk_package_list_to_strv (list);
 	ret = gpk_client_install_package_ids (gclient, package_ids, error);
 
 out:
@@ -2020,7 +2020,7 @@
 	}
 
 	/* convert to list of package id's */
-	package_ids = pk_package_list_to_argv (list);
+	package_ids = pk_package_list_to_strv (list);
 	ret = gpk_client_install_package_ids (gclient, package_ids, error);
 
 out:

Modified: trunk/src/gpk-common.c
==============================================================================
--- trunk/src/gpk-common.c	(original)
+++ trunk/src/gpk-common.c	Wed Sep 17 10:53:44 2008
@@ -1402,7 +1402,7 @@
 			title = g_strdup_printf (_("%s is running as a privileged user"), application_name);
 		message = g_strjoin ("\n",
 				     _("Running graphical applications as a privileged user should be avoided for security reasons."),
-				     _("PackageKit applications are security sensitive and therefore this application will now close."), NULL);
+				     _("Package management applications are security sensitive and therefore this application will now close."), NULL);
 		gpk_error_dialog (title, message, "");
 		g_free (title);
 		g_free (message);

Modified: trunk/src/gpk-common.h
==============================================================================
--- trunk/src/gpk-common.h	(original)
+++ trunk/src/gpk-common.h	Wed Sep 17 10:53:44 2008
@@ -47,12 +47,13 @@
 #define GPK_CONF_FREQUENCY_REFRESH_CACHE	"/apps/gnome-packagekit/frequency_refresh_cache"
 #define GPK_CONF_AUTO_UPDATE			"/apps/gnome-packagekit/auto_update"
 #define GPK_CONF_UPDATE_BATTERY			"/apps/gnome-packagekit/update_battery"
-#define GPK_CONF_REPO_SHOW_DETAILS		"/apps/gnome-packagekit/repo/show_details"
 #define GPK_CONF_SHOW_DEPENDS			"/apps/gnome-packagekit/show_depends"
 #define GPK_CONF_PROMPT_FIRMWARE		"/apps/gnome-packagekit/prompt_firmware"
 
+#define GPK_CONF_REPO_SHOW_DETAILS		"/apps/gnome-packagekit/repo/show_details"
 #define GPK_CONF_APPLICATION_FILTER_BASENAME	"/apps/gnome-packagekit/application/filter_basename"
 #define GPK_CONF_APPLICATION_FILTER_NEWEST	"/apps/gnome-packagekit/application/filter_newest"
+#define GPK_CONF_UPDATE_VIEWER_PRECACHE_DETAILS	"/apps/gnome-packagekit/update_viewer/precache_details"
 
 #define GPK_BUGZILLA_URL			"https://bugs.freedesktop.org/";
 

Modified: trunk/src/gpk-install-catalog.c
==============================================================================
--- trunk/src/gpk-install-catalog.c	(original)
+++ trunk/src/gpk-install-catalog.c	Wed Sep 17 10:53:44 2008
@@ -61,9 +61,9 @@
 	}
 	g_type_init ();
 
-	g_set_application_name (_("PackageKit Catalog Installer"));
+	g_set_application_name (_("Catalog Installer"));
 	context = g_option_context_new ("gpk-install-catalog");
-	g_option_context_set_summary (context, _("PackageKit File Installer"));
+	g_option_context_set_summary (context, _("Catalog Installer"));
 	g_option_context_add_main_entries (context, options, NULL);
 	g_option_context_parse (context, &argc, &argv, NULL);
 	g_option_context_free (context);

Modified: trunk/src/gpk-install-mime-type.c
==============================================================================
--- trunk/src/gpk-install-mime-type.c	(original)
+++ trunk/src/gpk-install-mime-type.c	Wed Sep 17 10:53:44 2008
@@ -60,9 +60,9 @@
 	}
 	g_type_init ();
 
-	g_set_application_name (_("PackageKit MimeType Installer"));
+	g_set_application_name (_("Mime Type Installer"));
 	context = g_option_context_new ("gpk-install-mime-type");
-	g_option_context_set_summary (context, _("PackageKit MimeType Installer"));
+	g_option_context_set_summary (context, _("Mime Type Installer"));
 	g_option_context_add_main_entries (context, options, NULL);
 	g_option_context_parse (context, &argc, &argv, NULL);
 	g_option_context_free (context);

Modified: trunk/src/gpk-install-package-name.c
==============================================================================
--- trunk/src/gpk-install-package-name.c	(original)
+++ trunk/src/gpk-install-package-name.c	Wed Sep 17 10:53:44 2008
@@ -61,9 +61,9 @@
 	}
 	g_type_init ();
 
-	g_set_application_name (_("PackageKit Package Installer"));
+	g_set_application_name (_("Package Installer"));
 	context = g_option_context_new ("gpk-install-package");
-	g_option_context_set_summary (context, _("PackageKit Package Installer"));
+	g_option_context_set_summary (context, _("Package Installer"));
 	g_option_context_add_main_entries (context, options, NULL);
 	g_option_context_parse (context, &argc, &argv, NULL);
 	g_option_context_free (context);

Modified: trunk/src/gpk-install-provide-file.c
==============================================================================
--- trunk/src/gpk-install-provide-file.c	(original)
+++ trunk/src/gpk-install-provide-file.c	Wed Sep 17 10:53:44 2008
@@ -60,9 +60,9 @@
 	}
 	g_type_init ();
 
-	g_set_application_name (_("PackageKit Filename Installer"));
+	g_set_application_name (_("Filename Installer"));
 	context = g_option_context_new ("gpk-install-filename");
-	g_option_context_set_summary (context, _("PackageKit Filename Installer"));
+	g_option_context_set_summary (context, _("Filename Installer"));
 	g_option_context_add_main_entries (context, options, NULL);
 	g_option_context_parse (context, &argc, &argv, NULL);
 	g_option_context_free (context);

Modified: trunk/src/gpk-interface.h
==============================================================================
--- trunk/src/gpk-interface.h	(original)
+++ trunk/src/gpk-interface.h	Wed Sep 17 10:53:44 2008
@@ -53,7 +53,7 @@
 #endif /* !G_ENABLE_DEBUG */
 
 
-/* NONE:UINT,UINT,STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.79P0GU:1) */
+/* NONE:UINT,UINT,STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.CPEMHU:1) */
 extern void dbus_glib_marshal_gpk_dbus_VOID__UINT_UINT_STRING_POINTER (GClosure     *closure,
                                                                        GValue       *return_value,
                                                                        guint         n_param_values,
@@ -101,7 +101,7 @@
 }
 #define dbus_glib_marshal_gpk_dbus_NONE__UINT_UINT_STRING_POINTER	dbus_glib_marshal_gpk_dbus_VOID__UINT_UINT_STRING_POINTER
 
-/* NONE:UINT,UINT,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.79P0GU:2) */
+/* NONE:UINT,UINT,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.CPEMHU:2) */
 extern void dbus_glib_marshal_gpk_dbus_VOID__UINT_UINT_BOXED_POINTER (GClosure     *closure,
                                                                       GValue       *return_value,
                                                                       guint         n_param_values,

Modified: trunk/src/gpk-update-icon.c
==============================================================================
--- trunk/src/gpk-update-icon.c	(original)
+++ trunk/src/gpk-update-icon.c	Wed Sep 17 10:53:44 2008
@@ -144,9 +144,9 @@
 	g_type_init ();
 	notify_init ("gpk-update-icon");
 
-	g_set_application_name (_("PackageKit Update Applet"));
+	g_set_application_name (_("Update Applet"));
 	context = g_option_context_new (NULL);
-	g_option_context_set_summary (context, _("PackageKit Update Icon"));
+	g_option_context_set_summary (context, _("Update Applet"));
 	g_option_context_add_main_entries (context, options, NULL);
 	g_option_context_parse (context, &argc, &argv, NULL);
 	g_option_context_free (context);

Modified: trunk/src/gpk-update-viewer.c
==============================================================================
--- trunk/src/gpk-update-viewer.c	(original)
+++ trunk/src/gpk-update-viewer.c	Wed Sep 17 10:53:44 2008
@@ -33,6 +33,7 @@
 #include <locale.h>
 
 #include <polkit-gnome/polkit-gnome.h>
+#include <gconf/gconf-client.h>
 
 #include <pk-client.h>
 #include <pk-control.h>
@@ -574,6 +575,47 @@
 }
 
 /**
+ * gpk_update_viewer_do_precache:
+ **/
+static gboolean
+gpk_update_viewer_do_precache (const PkPackageList *list)
+{
+	gboolean ret;
+	GError *error = NULL;
+	gchar **package_ids;
+	GConfClient *client;
+	gboolean precache;
+
+	client = gconf_client_get_default ();
+	precache = gconf_client_get_bool (client, GPK_CONF_UPDATE_VIEWER_PRECACHE_DETAILS, NULL);
+	g_object_unref (client);
+
+	if (!precache)
+		return FALSE;
+
+	egg_debug ("doing precache");
+
+	/* reset */
+	ret = pk_client_reset (client_query, &error);
+	if (!ret) {
+		egg_warning ("failed to reset: %s", error->message);
+		g_error_free (error);
+		return FALSE;
+	}
+
+	/* pre-cache the update detail if we can */
+	package_ids = pk_package_list_to_strv (list);
+	ret = pk_client_get_update_detail (client_query, package_ids, &error);
+	g_strfreev (package_ids);
+	if (!ret) {
+		egg_warning ("failed to cache update detail: %s", error->message);
+		g_error_free (error);
+		return FALSE;
+	}
+	return TRUE;
+}
+
+/**
  * gpk_update_viewer_get_new_update_list:
  **/
 static void
@@ -588,9 +630,7 @@
 	gchar *text;
 	gchar *package_id;
 	const gchar *icon_name;
-	gchar **package_ids;
 	GtkTreeIter iter;
-	gboolean ret;
 	gboolean selected;
 
 	/* spin */
@@ -613,11 +653,10 @@
 
 	/* do we have updates? */
 	length = pk_package_list_get_size (list);
-	if (length == 0) {
+	if (length == 0)
 		are_updates_available = FALSE;
-	} else {
+	else
 		are_updates_available = TRUE;
-	}
 
 	for (i=0; i<length; i++) {
 		obj = pk_package_list_get_obj (list, i);
@@ -647,24 +686,7 @@
 	gtk_widget_set_sensitive (widget, are_updates_available);
 
 	gpk_update_viewer_populate_preview (list);
-
-	/* reset */
-	ret = pk_client_reset (client_query, &error);
-	if (!ret) {
-		egg_warning ("failed to reset: %s", error->message);
-		g_error_free (error);
-		goto out;
-	}
-
-	/* pre-cache the update detail if we can */
-	package_ids = pk_package_list_to_argv (list);
-	ret = pk_client_get_update_detail (client_query, package_ids, &error);
-	g_strfreev (package_ids);
-	if (!ret) {
-		egg_warning ("failed to cache update detail: %s", error->message);
-		g_error_free (error);
-		goto out;
-	}
+	gpk_update_viewer_do_precache (list);
 
 	/* don't spin */
 	gpk_update_viewer_description_animation_stop ();

Modified: trunk/src/gpk-watch.c
==============================================================================
--- trunk/src/gpk-watch.c	(original)
+++ trunk/src/gpk-watch.c	Wed Sep 17 10:53:44 2008
@@ -64,8 +64,8 @@
 
 #define GPK_WATCH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPK_TYPE_WATCH, GpkWatchPrivate))
 #define GPK_WATCH_MAXIMUM_TOOLTIP_LINES		10
-#define GPK_WATCH_GCONF_PROXY_HTTP 		"/system/http_proxy"
-#define GPK_WATCH_GCONF_PROXY_FTP 		"/system/proxy"
+#define GPK_WATCH_GCONF_PROXY_HTTP		"/system/http_proxy"
+#define GPK_WATCH_GCONF_PROXY_FTP		"/system/proxy"
 #define GPK_WATCH_SET_PROXY_RATE_LIMIT		200 /* ms */
 
 struct GpkWatchPrivate
@@ -143,11 +143,11 @@
 			break;
 		}
 	}
-	if (status->len == 0) {
+	if (status->len == 0)
 		g_string_append (status, "Doing something...");
-	} else {
+	else
 		g_string_set_size (status, status->len-1);
-	}
+
 	gtk_status_icon_set_tooltip (GTK_STATUS_ICON (watch->priv->sicon), status->str);
 	g_string_free (status, TRUE);
 	return TRUE;
@@ -168,9 +168,8 @@
 
 	/* shortcut */
 	length = pk_task_list_get_size (watch->priv->tlist);
-	if (length == 0) {
+	if (length == 0)
 		goto out;
-	}
 
 	/* add each status to a list */
 	for (i=0; i<length; i++) {
@@ -350,18 +349,16 @@
 		goto out;
 	}
 
-	if (role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
+	if (role == PK_ROLE_ENUM_REMOVE_PACKAGES)
 		message = g_strdup_printf (_("Package '%s' has been removed"), text);
-	} else if (role == PK_ROLE_ENUM_INSTALL_PACKAGES) {
+	else if (role == PK_ROLE_ENUM_INSTALL_PACKAGES)
 		message = g_strdup_printf (_("Package '%s' has been installed"), text);
-	} else if (role == PK_ROLE_ENUM_UPDATE_SYSTEM) {
+	else if (role == PK_ROLE_ENUM_UPDATE_SYSTEM)
 		message = g_strdup ("System has been updated");
-	}
 
 	/* nothing of interest */
-	if (message == NULL) {
+	if (message == NULL)
 		goto out;
-	}
 
 	/* do the bubble */
 	notification = notify_notification_new (_("Task completed"), message, "help-browser", NULL);
@@ -556,13 +553,12 @@
 		   "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n"
 		   "02110-1301, USA.")
 	};
-  	const char  *translators = _("translator-credits");
-	char	    *license_trans;
+	const char *translators = _("translator-credits");
+	char *license_trans;
 
 	/* Translators comment: put your own name here to appear in the about dialog. */
-  	if (!strcmp (translators, "translator-credits")) {
+	if (!strcmp (translators, "translator-credits"))
 		translators = NULL;
-	}
 
 	license_trans = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n",
 				     _(license[2]), "\n\n", _(license[3]), "\n",  NULL);
@@ -617,9 +613,8 @@
 	gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
 			gtk_status_icon_position_menu, status_icon,
 			button, timestamp);
-	if (button == 0) {
+	if (button == 0)
 		gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
-	}
 }
 
 /**
@@ -707,9 +702,8 @@
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	length = pk_task_list_get_size (watch->priv->tlist);
-	if (length == 0) {
+	if (length == 0)
 		return;
-	}
 
 	/* do a menu item for each job */
 	for (i=0; i<length; i++) {
@@ -723,11 +717,10 @@
 
 		icon_name = gpk_status_enum_to_icon_name (item->status);
 		if (!egg_strzero (item->text) &&
-		    item->role != PK_ROLE_ENUM_UPDATE_PACKAGES) {
+		    item->role != PK_ROLE_ENUM_UPDATE_PACKAGES)
 			text = g_strdup_printf ("%s %s (%s)", localised_role, item->text, localised_status);
-		} else {
+		else
 			text = g_strdup_printf ("%s (%s)", localised_role, localised_status);
-		}
 
 		/* add a job */
 		widget = gtk_image_menu_item_new_with_mnemonic (text);
@@ -863,11 +856,10 @@
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	egg_debug ("setting locked %i, doing g-p-m (un)inhibit", is_locked);
-	if (is_locked) {
+	if (is_locked)
 		gpk_inhibit_create (watch->priv->inhibit);
-	} else {
+	else
 		gpk_inhibit_remove (watch->priv->inhibit);
-	}
 }
 
 /**
@@ -899,11 +891,10 @@
 	port = gconf_client_get_int (watch->priv->gconf_client, "/system/proxy/ftp_port", NULL);
 
 	/* ftp has no username or password */
-	if (port == 0) {
+	if (port == 0)
 		connection = g_strdup (host);
-	} else {
+	else
 		connection = g_strdup_printf ("%s:%i", host, port);
-	}
 out:
 	g_free (mode);
 	g_free (host);
@@ -957,13 +948,12 @@
 		user = gconf_client_get_string (watch->priv->gconf_client, "/system/http_proxy/authentication_user", NULL);
 		password = gconf_client_get_string (watch->priv->gconf_client, "/system/http_proxy/authentication_password", NULL);
 
-		if (user != NULL && password != NULL) {
+		if (user != NULL && password != NULL)
 			auth = g_strdup_printf ("%s:%s", user, password);
-		} else if (user != NULL) {
+		else if (user != NULL)
 			auth = g_strdup (user);
-		} else if (password != NULL) {
+		else if (password != NULL)
 			auth = g_strdup_printf (":%s", user);
-		}
 
 		g_free (user);
 		g_free (password);
@@ -978,11 +968,10 @@
 	}
 
 	/* the whole auth section is optional */
-	if (egg_strzero (auth)) {
+	if (egg_strzero (auth))
 		proxy_http = g_strdup (connection);
-	} else {
+	else
 		proxy_http = g_strdup_printf ("%s %s", auth, connection);
-	}
 out:
 	g_free (mode);
 	g_free (connection);
@@ -1114,9 +1103,8 @@
 	watch->priv->pconnection = pk_connection_new ();
 	g_signal_connect (watch->priv->pconnection, "connection-changed",
 			  G_CALLBACK (pk_connection_changed_cb), watch);
-	if (pk_connection_valid (watch->priv->pconnection)) {
+	if (pk_connection_valid (watch->priv->pconnection))
 		pk_connection_changed_cb (watch->priv->pconnection, TRUE, watch);
-	}
 
 	pk_action = polkit_action_new ();
 	polkit_action_set_action_id (pk_action, "org.freedesktop.consolekit.system.restart");
@@ -1164,9 +1152,8 @@
 	g_return_if_fail (watch->priv != NULL);
 
 	/* we might we waiting for a proxy update */
-	if (watch->priv->set_proxy_timeout != 0) {
+	if (watch->priv->set_proxy_timeout != 0)
 		g_source_remove (watch->priv->set_proxy_timeout);
-	}
 
 	g_free (watch->priv->error_details);
 	g_object_unref (watch->priv->sicon);



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