gnome-packagekit r313 - trunk/src



Author: rhughes
Date: Sun Sep 28 07:54:19 2008
New Revision: 313
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=313&view=rev

Log:
from git

Modified:
   trunk/src/gpk-client-run.c
   trunk/src/gpk-client.c
   trunk/src/gpk-dbus.c
   trunk/src/gpk-hardware.c

Modified: trunk/src/gpk-client-run.c
==============================================================================
--- trunk/src/gpk-client-run.c	(original)
+++ trunk/src/gpk-client-run.c	Sun Sep 28 07:54:19 2008
@@ -244,7 +244,7 @@
 	for (i=0; i<length; i++) {
 		package_id = package_ids[i];
 		egg_debug ("package_id=%s", package_id);
-		files = gpk_client_get_file_list (gclient, package_ids[0], &error);
+		files = gpk_client_get_file_list (gclient, package_id, &error);
 		if (files == NULL) {
 			egg_warning ("could not get file list: %s", error->message);
 			g_error_free (error);

Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c	(original)
+++ trunk/src/gpk-client.c	Sun Sep 28 07:54:19 2008
@@ -1329,6 +1329,7 @@
 
 	/* set title */
 	gpk_client_dialog_set_title (gclient->priv->dialog, _("Installing packages"));
+	gpk_client_dialog_set_message (gclient->priv->dialog, "");
 
 	/* setup the UI */
 	if (gclient->priv->show_progress)
@@ -1875,6 +1876,7 @@
 	/* set title */
 	gpk_client_dialog_set_title (gclient->priv->dialog, _("Searching for codecs"));
 	gpk_client_dialog_set_image_status (gclient->priv->dialog, PK_STATUS_ENUM_WAIT);
+	gpk_client_dialog_set_message (gclient->priv->dialog, "");
 
 	/* setup the UI */
 	if (gclient->priv->show_progress)
@@ -2378,6 +2380,7 @@
 
 	/* set title */
 	gpk_client_dialog_set_title (gclient->priv->dialog, _("System update"));
+	gpk_client_dialog_set_message (gclient->priv->dialog, "");
 
 	/* wrap update, but handle all the GPG and EULA stuff */
 	ret = pk_client_update_system (gclient->priv->client_action, &error_local);
@@ -2655,6 +2658,7 @@
 
 	/* setup the UI */
 	gpk_client_dialog_set_title (gclient->priv->dialog, _("Update packages"));
+	gpk_client_dialog_set_message (gclient->priv->dialog, "");
 	if (gclient->priv->show_progress)
 		gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
 

Modified: trunk/src/gpk-dbus.c
==============================================================================
--- trunk/src/gpk-dbus.c	(original)
+++ trunk/src/gpk-dbus.c	Sun Sep 28 07:54:19 2008
@@ -272,7 +272,7 @@
 				&format_return, &nitems_return, &bytes_after_return,
 				&data) == Success) {
 		if ((type_return == XA_CARDINAL) && (format_return == 32) && (data)) {
-			timestamp = (guint32 )data;
+			timestamp = (guint32) *data;
 			g_message ("got timestamp %i", timestamp);
 		}
 	}

Modified: trunk/src/gpk-hardware.c
==============================================================================
--- trunk/src/gpk-hardware.c	(original)
+++ trunk/src/gpk-hardware.c	Sun Sep 28 07:54:19 2008
@@ -58,6 +58,7 @@
 
 #define GPK_HARDWARE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPK_TYPE_HARDWARE, GpkHardwarePrivate))
 #define GPK_HARDWARE_LOGIN_DELAY	50 /* seconds */
+#define GPK_HARDWARE_MULTIPLE_HAL_SIGNALS_DELAY	5 /* seconds */
 #define GPK_HARDWARE_INSTALL_ACTION  "GpkHardware - install this package"
 #define GPK_HARDWARE_DONT_PROMPT_ACTION  "GpkHardware - dont prompt again"
 
@@ -67,6 +68,7 @@
 	DBusGConnection		*connection;
 	DBusGProxy		*proxy;
 	gchar			**package_ids;
+	gchar			*udi;
 };
 
 G_DEFINE_TYPE (GpkHardware, gpk_hardware, G_TYPE_OBJECT)
@@ -183,15 +185,34 @@
 	g_object_unref (client);
 }
 
+static gboolean
+gpk_hardware_device_added_timeout (gpointer data)
+{
+	GpkHardware *hardware = GPK_HARDWARE (data);
+	egg_debug ("multiple signal timeout callback");
+	gpk_hardware_check_for_driver_available (hardware, hardware->priv->udi);
+
+	g_free (hardware->priv->udi);
+	hardware->priv->udi = NULL;
+	return FALSE;
+}
+
 /**
  * gpk_hardware_device_added_cb:
- * FIXME - not sure about this method signature
  **/
 static void
 gpk_hardware_device_added_cb (DBusGProxy *proxy, const gchar *udi, GpkHardware *hardware)
 {
 	egg_debug ("hardware added. udi=%s", udi);
-	gpk_hardware_check_for_driver_available (hardware, udi);
+	/* we get multiple hal signals for one device plugin. Ignore all but first one.
+	   TODO: should we act on a different one ?
+	*/
+	if (hardware->priv->udi == NULL)
+	{
+		hardware->priv->udi = g_strdup (udi);
+		g_timeout_add_seconds (GPK_HARDWARE_MULTIPLE_HAL_SIGNALS_DELAY,
+				       gpk_hardware_device_added_timeout, hardware);
+	}
 }
 
 /**
@@ -220,6 +241,7 @@
 	hardware->priv = GPK_HARDWARE_GET_PRIVATE (hardware);
 	hardware->priv->gconf_client = gconf_client_get_default ();
 	hardware->priv->package_ids = NULL;
+	hardware->priv->udi = NULL;
 
 	/* should we check and show the user */
 	ret = gconf_client_get_bool (hardware->priv->gconf_client, GPK_CONF_PROMPT_HARDWARE, NULL);



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