[gnome-packagekit] Don't allow double click on a help item. Fixes rh#518854



commit caf4c9bb4632d39ec0a7bacb41964d4ab72c9403
Author: Richard Hughes <richard hughsie com>
Date:   Mon Aug 24 09:06:02 2009 +0100

    Don't allow double click on a help item. Fixes rh#518854

 src/gpk-application.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/gpk-application.c b/src/gpk-application.c
index 01bb19d..c351c26 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -3198,6 +3198,7 @@ gpk_application_package_row_activated_cb (GtkTreeView *treeview, GtkTreePath *pa
 	GtkTreeIter iter;
 	gboolean ret;
 	PkBitfield state;
+	gchar *package_id = NULL;
 
 	g_return_if_fail (GPK_IS_APPLICATION (application));
 
@@ -3209,13 +3210,24 @@ gpk_application_package_row_activated_cb (GtkTreeView *treeview, GtkTreePath *pa
 		return;
 	}
 
+	/* get data */
 	gtk_tree_model_get (model, &iter,
 			    PACKAGES_COLUMN_STATE, &state,
+			    PACKAGES_COLUMN_ID, &package_id,
 			    -1);
+
+	/* check we aren't a help line */
+	if (package_id == NULL) {
+		egg_debug ("ignoring help click");
+		goto out;
+	}
+
 	if (gpk_application_state_get_checkbox (state))
 		gpk_application_remove (application);
 	else
 		gpk_application_install (application);
+out:
+	g_free (package_id);
 }
 
 /**



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