[packagekit] [PATCH 1/2] gpk-application:avoid multi-search at the same time

Zhang Qiang qiang.z.zhang at intel.com
Tue Nov 16 22:14:47 PST 2010


This patch avoid multi-search at the same time. With out this patch,
user can press Enter key to execute search time by time, which  result
in duplicate entries in the results list.

related bug: http://bugs.meego.com/show_bug.cgi?id=9900
---
 src/gpk-application.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gpk-application.c b/src/gpk-application.c
index e0bd6f2..ec7cfc1 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -1831,6 +1831,10 @@ gpk_application_find_cb (GtkWidget *button_widget, GpkApplication *application)
 {
 	g_return_if_fail (GPK_IS_APPLICATION (application));
 
+	/*if we are in the middle of a search, just return*/
+	if (application->priv->search_in_progress == TRUE)
+		return;
+
 	application->priv->search_mode = GPK_MODE_NAME_DETAILS_FILE;
 	gpk_application_perform_search (application);
 }
-- 
1.7.2.2




More information about the PackageKit mailing list